From 393e57f88c68a4353a37caf507ee0f8b00e73fc2 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 20 Nov 2007 04:53:25 +0000 Subject: [PATCH] Autogenerated HTML docs for v1.5.3.6-736-gb7f30 --- RelNotes-1.5.4.txt | 5 +- cmds-ancillaryinterrogators.txt | 2 +- git-get-tar-commit-id.html | 6 +-- git-get-tar-commit-id.txt | 4 +- git-remote.html | 4 +- git-remote.txt | 2 +- git.html | 4 +- user-manual.html | 53 +++++++++++++++++---- user-manual.txt | 81 +++++++++++++++++++++++++++++++-- 9 files changed, 135 insertions(+), 26 deletions(-) diff --git a/RelNotes-1.5.4.txt b/RelNotes-1.5.4.txt index 96ec55eb1..a4a2a7f42 100644 --- a/RelNotes-1.5.4.txt +++ b/RelNotes-1.5.4.txt @@ -33,8 +33,9 @@ Updates since v1.5.3 too many loose objects. * You need to explicitly set clean.requireForce to "false" to allow - git-clean to do any damage (lack of the configuration variable - used to mean "do not require", but we now use the safer default). + git-clean without -f to do any damage (lack of the configuration + variable used to mean "do not require", but we now use the safer + default). * git-push has been rewritten in C. diff --git a/cmds-ancillaryinterrogators.txt b/cmds-ancillaryinterrogators.txt index c8b7db28e..b4db818b0 100644 --- a/cmds-ancillaryinterrogators.txt +++ b/cmds-ancillaryinterrogators.txt @@ -14,7 +14,7 @@ gitlink:git-fsck[1]:: Verifies the connectivity and validity of the objects in the database. gitlink:git-get-tar-commit-id[1]:: - Extract commit ID from an archive created using git-tar-tree. + Extract commit ID from an archive created using git-archive. gitlink:git-instaweb[1]:: Instantly browse your working repository in gitweb. diff --git a/git-get-tar-commit-id.html b/git-get-tar-commit-id.html index 1633c6d56..21a580ae1 100644 --- a/git-get-tar-commit-id.html +++ b/git-get-tar-commit-id.html @@ -266,7 +266,7 @@ git-get-tar-commit-id(1) Manual Page

NAME

git-get-tar-commit-id - - Extract commit ID from an archive created using git-tar-tree + Extract commit ID from an archive created using git-archive

@@ -281,7 +281,7 @@ git-get-tar-commit-id(1) Manual Page runtime is not influenced by the size of <tarfile> very much.

If no commit ID is found, git-get-tar-commit-id quietly exists with a return code of 1. This can happen if <tarfile> had not been created -using git-archive or if the <treeish> parameter of git-archive had been +using git-archive or if the first parameter of git-archive had been a tree ID instead of a commit ID or tag.

Author

@@ -298,7 +298,7 @@ a tree ID instead of a commit ID or tag.

diff --git a/git-get-tar-commit-id.txt b/git-get-tar-commit-id.txt index 76316bbc9..60d1c52f4 100644 --- a/git-get-tar-commit-id.txt +++ b/git-get-tar-commit-id.txt @@ -3,7 +3,7 @@ git-get-tar-commit-id(1) NAME ---- -git-get-tar-commit-id - Extract commit ID from an archive created using git-tar-tree +git-get-tar-commit-id - Extract commit ID from an archive created using git-archive SYNOPSIS @@ -19,7 +19,7 @@ runtime is not influenced by the size of very much. If no commit ID is found, git-get-tar-commit-id quietly exists with a return code of 1. This can happen if had not been created -using git-archive or if the parameter of git-archive had been +using git-archive or if the first parameter of git-archive had been a tree ID instead of a commit ID or tag. diff --git a/git-remote.html b/git-remote.html index c4e6d9364..f41e90cea 100644 --- a/git-remote.html +++ b/git-remote.html @@ -379,7 +379,7 @@ Add a new remote, fetch, and check out a branch from it origin $ git branch -r origin/master -$ git remote add linux-nfs git://linux-nfs.org/pub/nfs-2.6.git +$ git remote add linux-nfs git://linux-nfs.org/pub/linux/nfs-2.6.git $ git remote linux-nfs origin @@ -428,7 +428,7 @@ $ git merge origin diff --git a/git-remote.txt b/git-remote.txt index 0da8704a2..4b263c249 100644 --- a/git-remote.txt +++ b/git-remote.txt @@ -101,7 +101,7 @@ $ git remote origin $ git branch -r origin/master -$ git remote add linux-nfs git://linux-nfs.org/pub/nfs-2.6.git +$ git remote add linux-nfs git://linux-nfs.org/pub/linux/nfs-2.6.git $ git remote linux-nfs origin diff --git a/git.html b/git.html index 9209d3b04..5978784ef 100644 --- a/git.html +++ b/git.html @@ -827,7 +827,7 @@ ancillary user utilities.

- Extract commit ID from an archive created using git-tar-tree. + Extract commit ID from an archive created using git-archive.

@@ -1925,7 +1925,7 @@ contributors on the git-list <git@vger.kernel.org>.

diff --git a/user-manual.html b/user-manual.html index ee2576f03..7a887a16c 100644 --- a/user-manual.html +++ b/user-manual.html @@ -1,4 +1,4 @@ -Git User's Manual (for version 1.5.3 or newer)

Git User's Manual (for version 1.5.3 or newer)


Table of Contents

Preface
1. Repositories and Branches
How to get a git repository
How to check out a different version of a project
Understanding History: Commits
Understanding history: commits, parents, and reachability
Understanding history: History diagrams
Understanding history: What is a branch?
Manipulating branches
Examining an old version without creating a new branch
Examining branches from a remote repository
Naming branches, tags, and other references
Updating a repository with git fetch
Fetching branches from other repositories
2. Exploring git history
How to use bisect to find a regression
Naming commits
Creating tags
Browsing revisions
Generating diffs
Viewing old file versions
Examples
Counting the number of commits on a branch
Check whether two branches point at the same history
Find first tagged version including a given fix
Showing commits unique to a given branch
Creating a changelog and tarball for a software release
Finding commits referencing a file with given content
3. Developing with git
Telling git your name
Creating a new repository
How to make a commit
Creating good commit messages
Ignoring files
How to merge
Resolving a merge
Getting conflict-resolution help during a merge
Undoing a merge
Fast-forward merges
Fixing mistakes
Fixing a mistake with a new commit
Fixing a mistake by editing history
Checking out an old version of a file
Temporarily setting aside work in progress
Ensuring good performance
Ensuring reliability
Checking the repository for corruption
Recovering lost changes
4. Sharing development with others
Getting updates with git pull
Submitting patches to a project
Importing patches to a project
Public git repositories
Setting up a public repository
Exporting a git repository via the git protocol
Exporting a git repository via http
Pushing changes to a public repository
Setting up a shared repository
Allowing web browsing of a repository
Examples
Maintaining topic branches for a Linux subsystem maintainer
5. Rewriting history and maintaining patch series
Creating the perfect patch series
Keeping a patch series up to date using git-rebase
Modifying a single commit
Reordering or selecting from a patch series
Other tools
Problems with rewriting history
6. Advanced branch management
Fetching individual branches
git fetch and fast-forwards
Forcing git fetch to do non-fast-forward updates
Configuring remote branches
7. Git concepts
The Object Database
Commit Object
Tree Object
Blob Object
Trust
Tag Object
How git stores objects efficiently: pack files
Dangling objects
The index
8. Submodules
Pitfalls with submodules
9. Low-level git operations
Object access and manipulation
The Workflow
working directory -> index
index -> object database
object database -> index
index -> working directory
Tying it all together
Examining the data
Merging multiple trees
Merging multiple trees, continued
10. Hacking git
Object storage format
A birds-eye view of Git's source code
11. GIT Glossary
A. Git Quick Reference
Creating a new repository
Managing branches
Exploring history
Making changes
Merging
Sharing your changes
Repository maintenance
B. Notes and todo list for this manual

Preface

Git is a fast distributed revision control system.

This manual is designed to be readable by someone with basic UNIX +Git User's Manual (for version 1.5.3 or newer)

Git User's Manual (for version 1.5.3 or newer)


Table of Contents

Preface
1. Repositories and Branches
How to get a git repository
How to check out a different version of a project
Understanding History: Commits
Understanding history: commits, parents, and reachability
Understanding history: History diagrams
Understanding history: What is a branch?
Manipulating branches
Examining an old version without creating a new branch
Examining branches from a remote repository
Naming branches, tags, and other references
Updating a repository with git fetch
Fetching branches from other repositories
2. Exploring git history
How to use bisect to find a regression
Naming commits
Creating tags
Browsing revisions
Generating diffs
Viewing old file versions
Examples
Counting the number of commits on a branch
Check whether two branches point at the same history
Find first tagged version including a given fix
Showing commits unique to a given branch
Creating a changelog and tarball for a software release
Finding commits referencing a file with given content
3. Developing with git
Telling git your name
Creating a new repository
How to make a commit
Creating good commit messages
Ignoring files
How to merge
Resolving a merge
Getting conflict-resolution help during a merge
Undoing a merge
Fast-forward merges
Fixing mistakes
Fixing a mistake with a new commit
Fixing a mistake by editing history
Checking out an old version of a file
Temporarily setting aside work in progress
Ensuring good performance
Ensuring reliability
Checking the repository for corruption
Recovering lost changes
4. Sharing development with others
Getting updates with git pull
Submitting patches to a project
Importing patches to a project
Public git repositories
Setting up a public repository
Exporting a git repository via the git protocol
Exporting a git repository via http
Pushing changes to a public repository
Setting up a shared repository
Allowing web browsing of a repository
Examples
Maintaining topic branches for a Linux subsystem maintainer
5. Rewriting history and maintaining patch series
Creating the perfect patch series
Keeping a patch series up to date using git-rebase
Modifying a single commit
Reordering or selecting from a patch series
Other tools
Problems with rewriting history
Why bisecting merge commits can be harder than bisecting linear history
6. Advanced branch management
Fetching individual branches
git fetch and fast-forwards
Forcing git fetch to do non-fast-forward updates
Configuring remote branches
7. Git concepts
The Object Database
Commit Object
Tree Object
Blob Object
Trust
Tag Object
How git stores objects efficiently: pack files
Dangling objects
The index
8. Submodules
Pitfalls with submodules
9. Low-level git operations
Object access and manipulation
The Workflow
working directory -> index
index -> object database
object database -> index
index -> working directory
Tying it all together
Examining the data
Merging multiple trees
Merging multiple trees, continued
10. Hacking git
Object storage format
A birds-eye view of Git's source code
11. GIT Glossary
A. Git Quick Reference
Creating a new repository
Managing branches
Exploring history
Making changes
Merging
Sharing your changes
Repository maintenance
B. Notes and todo list for this manual

Preface

Git is a fast distributed revision control system.

This manual is designed to be readable by someone with basic UNIX command-line skills, but no previous knowledge of git.

Chapter 1, Repositories and Branches and Chapter 2, Exploring git history explain how to fetch and study a project using git—read these chapters to learn how to build and test a particular version of a software project, search for @@ -304,10 +304,11 @@ display options.

Note that git log starts with the most recent commit and backwards through the parents; however, since git history can contain multiple independent lines of development, the particular order that commits are listed in may be somewhat arbitrary.

Generating diffs

You can generate diffs between any two versions using -git-diff(1):

$ git diff master..test

Sometimes what you want instead is a set of patches:

$ git format-patch master..test

will generate a file with a patch for each commit reachable from test -but not from master. Note that if master also has commits which are -not reachable from test, then the combined result of these patches -will not be the same as the diff produced by the git-diff example.

Viewing old file versions

You can always view an old version of a file by just checking out the +git-diff(1):

$ git diff master..test

That will produce the diff between the tips of the two branches. If +you'd prefer to find the diff from their common ancestor to test, you +can use three dots instead of two:

$ git diff master...test

Sometimes what you want instead is a set of patches; for this you can +use git-format-patch(1):

$ git format-patch master..test

will generate a file with a patch for each commit reachable from test +but not from master.

Viewing old file versions

You can always view an old version of a file by just checking out the correct revision first. But sometimes it is more convenient to be able to view an old version of a single file without checking anything out; this command does that:

$ git show v2.5:fs/locks.c

Before the colon may be anything that names a commit, and after it @@ -939,7 +940,7 @@ do
                ;;
        esac
        git log origin/master..$branch | git shortlog
-done

Chapter 5. Rewriting history and maintaining patch series

Normally commits are only added to a project, never taken away or +done

Chapter 5. Rewriting history and maintaining patch series

Normally commits are only added to a project, never taken away or replaced. Git is designed with this assumption, and violating it will cause git's merge machinery (for example) to do the wrong thing.

However, there is a situation in which it can be useful to violate this assumption.

Creating the perfect patch series

Suppose you are a contributor to a large project, and you want to add a @@ -1035,7 +1036,41 @@ new. The results are likely to be unexpected.

You may still choose to pub and it may be useful for others to be able to fetch those branches in order to examine or test them, but they should not attempt to pull such branches into their own work.

For true distributed development that supports proper merging, -published branches should never be rewritten.

Chapter 6. Advanced branch management

Fetching individual branches

Instead of using git-remote(1), you can also choose just +published branches should never be rewritten.

Why bisecting merge commits can be harder than bisecting linear history

The git-bisect(1) command correctly handles history that +includes merge commits. However, when the commit that it finds is a +merge commit, the user may need to work harder than usual to figure out +why that commit introduced a problem.

Imagine this history:

      ---Z---o---X---...---o---A---C---D
+          \                       /
+           o---o---Y---...---o---B

Suppose that on the upper line of development, the meaning of one +of the functions that exists at Z is changed at commit X. The +commits from Z leading to A change both the function's +implementation and all calling sites that exist at Z, as well +as new calling sites they add, to be consistent. There is no +bug at A.

Suppose that in the meantime on the lower line of development somebody +adds a new calling site for that function at commit Y. The +commits from Z leading to B all assume the old semantics of that +function and the callers and the callee are consistent with each +other. There is no bug at B, either.

Suppose further that the two development lines merge cleanly at C, +so no conflict resolution is required.

Nevertheless, the code at C is broken, because the callers added +on the lower line of development have not been converted to the new +semantics introduced on the upper line of development. So if all +you know is that D is bad, that Z is good, and that +git-bisect(1) identifies C as the culprit, how will you +figure out that the problem is due to this change in semantics?

When the result of a git-bisect is a non-merge commit, you should +normally be able to discover the problem by examining just that commit. +Developers can make this easy by breaking their changes into small +self-contained commits. That won't help in the case above, however, +because the problem isn't obvious from examination of any single +commit; instead, a global view of the development is required. To +make matters worse, the change in semantics in the problematic +function may be just one small part of the changes in the upper +line of development.

On the other hand, if instead of merging at C you had rebased the +history between Z to B on top of A, you would have gotten this +linear history:

    ---Z---o---X--...---o---A---o---o---Y*--...---o---B*--D*

Bisecting between Z and D* would hit a single culprit commit Y*, +and understanding why Y* was broken would probably be easier.

Partly for this reason, many experienced git users, even when +working on an otherwise merge-heavy project, keep the history +linear by rebasing against the latest upstream version before +publishing.

Chapter 6. Advanced branch management

Fetching individual branches

Instead of using git-remote(1), you can also choose just to update one branch at a time, and to store it locally under an arbitrary name:

$ git fetch origin todo:my-todo-work

The first argument, "origin", just tells git to fetch from the repository you originally cloned from. The second argument tells git @@ -1332,7 +1367,7 @@ column in the git-ls-files(1) outp number, and will take on values other than 0 for files with merge conflicts.

The index is thus a sort of temporary staging area, which is filled with a tree which you are in the process of working on.

If you blow the index away entirely, you generally haven't lost any -information as long as you have the name of the tree that it described.

Chapter 8. Submodules

Table of Contents

Pitfalls with submodules

Large projects are often composed of smaller, self-contained modules. For +information as long as you have the name of the tree that it described.

Chapter 8. Submodules

Table of Contents

Pitfalls with submodules

Large projects are often composed of smaller, self-contained modules. For example, an embedded Linux distribution's source tree would include every piece of software in the distribution with some local modifications; a movie player might need to build against a specific, known-working version of a @@ -1426,7 +1461,7 @@ index d266b98..261dfac 160000
$ git add a
$ git commit -m "Updated submodule a."
$ git push

You have to run git submodule update after git pull if you want to update -submodules, too.

Pitfalls with submodules

Always publish the submodule change before publishing the change to the +submodules, too.

Pitfalls with submodules

Always publish the submodule change before publishing the change to the superproject that references it. If you forget to publish the submodule change, others won't be able to clone the repository:

$ cd ~/git/super/a
$ echo i added another line to this file >> a.txt
diff --git a/user-manual.txt b/user-manual.txt index 518b7b5c9..3661879f1 100644 --- a/user-manual.txt +++ b/user-manual.txt @@ -658,16 +658,23 @@ gitlink:git-diff[1]: $ git diff master..test ------------------------------------------------- -Sometimes what you want instead is a set of patches: +That will produce the diff between the tips of the two branches. If +you'd prefer to find the diff from their common ancestor to test, you +can use three dots instead of two: + +------------------------------------------------- +$ git diff master...test +------------------------------------------------- + +Sometimes what you want instead is a set of patches; for this you can +use gitlink:git-format-patch[1]: ------------------------------------------------- $ git format-patch master..test ------------------------------------------------- will generate a file with a patch for each commit reachable from test -but not from master. Note that if master also has commits which are -not reachable from test, then the combined result of these patches -will not be the same as the diff produced by the git-diff example. +but not from master. [[viewing-old-file-versions]] Viewing old file versions @@ -2554,6 +2561,72 @@ branches into their own work. For true distributed development that supports proper merging, published branches should never be rewritten. +[[bisect-merges]] +Why bisecting merge commits can be harder than bisecting linear history +----------------------------------------------------------------------- + +The gitlink:git-bisect[1] command correctly handles history that +includes merge commits. However, when the commit that it finds is a +merge commit, the user may need to work harder than usual to figure out +why that commit introduced a problem. + +Imagine this history: + +................................................ + ---Z---o---X---...---o---A---C---D + \ / + o---o---Y---...---o---B +................................................ + +Suppose that on the upper line of development, the meaning of one +of the functions that exists at Z is changed at commit X. The +commits from Z leading to A change both the function's +implementation and all calling sites that exist at Z, as well +as new calling sites they add, to be consistent. There is no +bug at A. + +Suppose that in the meantime on the lower line of development somebody +adds a new calling site for that function at commit Y. The +commits from Z leading to B all assume the old semantics of that +function and the callers and the callee are consistent with each +other. There is no bug at B, either. + +Suppose further that the two development lines merge cleanly at C, +so no conflict resolution is required. + +Nevertheless, the code at C is broken, because the callers added +on the lower line of development have not been converted to the new +semantics introduced on the upper line of development. So if all +you know is that D is bad, that Z is good, and that +gitlink:git-bisect[1] identifies C as the culprit, how will you +figure out that the problem is due to this change in semantics? + +When the result of a git-bisect is a non-merge commit, you should +normally be able to discover the problem by examining just that commit. +Developers can make this easy by breaking their changes into small +self-contained commits. That won't help in the case above, however, +because the problem isn't obvious from examination of any single +commit; instead, a global view of the development is required. To +make matters worse, the change in semantics in the problematic +function may be just one small part of the changes in the upper +line of development. + +On the other hand, if instead of merging at C you had rebased the +history between Z to B on top of A, you would have gotten this +linear history: + +................................................................ + ---Z---o---X--...---o---A---o---o---Y*--...---o---B*--D* +................................................................ + +Bisecting between Z and D* would hit a single culprit commit Y*, +and understanding why Y* was broken would probably be easier. + +Partly for this reason, many experienced git users, even when +working on an otherwise merge-heavy project, keep the history +linear by rebasing against the latest upstream version before +publishing. + [[advanced-branch-management]] Advanced branch management ========================== -- 2.26.2