Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Mon, 19 Nov 2007 08:19:15 +0000 (00:19 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Nov 2007 08:19:15 +0000 (00:19 -0800)
* maint:
Documentation: Fix references to deprecated commands
user-manual: mention "..." in "Generating diffs", etc.
user-manual: Add section "Why bisecting merge commits can be harder ..."
git-remote.txt: fix example url

1  2 
Documentation/git-remote.txt
Documentation/user-manual.txt
index 0da8704a25f7010d84008396ab1bb0be5b4a4da1,886bc03c4af0c1a9ab8232fc305c68a6a5e10d2a..4b263c249cd93695b1c373887600d335685e82bb
@@@ -10,8 -10,7 +10,8 @@@ SYNOPSI
  --------
  [verse]
  'git-remote'
 -'git-remote' add [-t <branch>] [-m <branch>] [-f] <name> <url>
 +'git-remote' add [-t <branch>] [-m <branch>] [-f] [--mirror] <name> <url>
 +'git-remote' rm <name>
  'git-remote' show <name>
  'git-remote' prune <name>
  'git-remote' update [group]
@@@ -46,15 -45,6 +46,15 @@@ multiple branches without grabbing all 
  With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set
  up to point at remote's `<master>` branch instead of whatever
  branch the `HEAD` at the remote repository actually points at.
 ++
 +In mirror mode, enabled with `--mirror`, the refs will not be stored
 +in the 'refs/remotes/' namespace, but in 'refs/heads/'.  This option
 +only makes sense in bare repositories.
 +
 +'rm'::
 +
 +Remove the remote named <name>. All remote tracking branches and
 +configuration settings for the remote are removed.
  
  'show'::
  
@@@ -101,7 -91,7 +101,7 @@@ $ git remot
  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
index 518b7b5c9e283eccd20ce2d84ea85f107c98ca39,c0273533370ac0e5365146ce82b27bc7dfa9862d..3661879f1ae00c3951c4ecd320b7fab747886902
@@@ -475,7 -475,7 +475,7 @@@ Bisecting: 3537 revisions left to test 
  If you run "git branch" at this point, you'll see that git has
  temporarily moved you to a new branch named "bisect".  This branch
  points to a commit (with commit id 65934...) that is reachable from
 -v2.6.19 but not from v2.6.18.  Compile and test it, and see whether
 +"master" but not from v2.6.18.  Compile and test it, and see whether
  it crashes.  Assume it does crash.  Then:
  
  -------------------------------------------------
@@@ -658,16 -658,23 +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
@@@ -926,7 -933,7 +933,7 @@@ file such that it contained the given c
  commit.  You can find out with this:
  
  -------------------------------------------------
 -$  git log --raw --abbrev=40 --pretty=oneline -- filename |
 +$  git log --raw --abbrev=40 --pretty=oneline |
        grep -B 1 `git hash-object filename`
  -------------------------------------------------
  
@@@ -1367,7 -1374,7 +1374,7 @@@ If you make a commit that you later wis
  fundamentally different ways to fix the problem:
  
        1. You can create a new commit that undoes whatever was done
 -      by the previous commit.  This is the correct thing if your
 +      by the old commit.  This is the correct thing if your
        mistake has already been made public.
  
        2. You can go back and modify the old commit.  You should
@@@ -1495,7 -1502,7 +1502,7 @@@ Ensuring good performanc
  -------------------------
  
  On large repositories, git depends on compression to keep the history
 -information from taking up to much space on disk or in memory.
 +information from taking up too much space on disk or in memory.
  
  This compression is not performed automatically.  Therefore you
  should occasionally run gitlink:git-gc[1]:
@@@ -1536,7 -1543,7 +1543,7 @@@ dangling tree b24c2473f1fd3d91352a62479
  Dangling objects are not a problem.  At worst they may take up a little
  extra disk space.  They can sometimes provide a last-resort method for
  recovering lost work--see <<dangling-objects>> for details.  However, if
 -you wish, you can remove them with gitlink:git-prune[1] or the --prune
 +you wish, you can remove them with gitlink:git-prune[1] or the `--prune`
  option to gitlink:git-gc[1]:
  
  -------------------------------------------------
@@@ -1555,7 -1562,7 +1562,7 @@@ Recovering lost change
  Reflogs
  ^^^^^^^
  
 -Say you modify a branch with gitlink:git-reset[1] --hard, and then
 +Say you modify a branch with `gitlink:git-reset[1] --hard`, and then
  realize that the branch was the only reference you had to that point in
  history.
  
@@@ -1567,9 -1574,9 +1574,9 @@@ old history using, for example
  $ git log master@{1}
  -------------------------------------------------
  
 -This lists the commits reachable from the previous version of the head.
 -This syntax can be used to with any git command that accepts a commit,
 -not just with git log.  Some other examples:
 +This lists the commits reachable from the previous version of the
 +"master" branch head.  This syntax can be used with any git command
 +that accepts a commit, not just with git log.  Some other examples:
  
  -------------------------------------------------
  $ git show master@{2}         # See where the branch pointed 2,
@@@ -1684,7 -1691,7 +1691,7 @@@ $ git pul
  More generally, a branch that is created from a remote branch will pull
  by default from that branch.  See the descriptions of the
  branch.<name>.remote and branch.<name>.merge options in
 -gitlink:git-config[1], and the discussion of the --track option in
 +gitlink:git-config[1], and the discussion of the `--track` option in
  gitlink:git-checkout[1], to learn how to control these defaults.
  
  In addition to saving you keystrokes, "git pull" also helps you by
@@@ -1782,7 -1789,7 +1789,7 @@@ $ git clone /path/to/repositor
  $ git pull /path/to/other/repository
  -------------------------------------------------
  
 -or an ssh url:
 +or an ssh URL:
  
  -------------------------------------------------
  $ git clone ssh://yourhost/~you/repository
@@@ -1843,7 -1850,7 +1850,7 @@@ Exporting a git repository via the git 
  This is the preferred method.
  
  If someone else administers the server, they should tell you what
 -directory to put the repository in, and what git:// url it will appear
 +directory to put the repository in, and what git:// URL it will appear
  at.  You can then skip to the section
  "<<pushing-changes-to-a-public-repository,Pushing changes to a public
  repository>>", below.
@@@ -1880,8 -1887,8 +1887,8 @@@ $ chmod a+x hooks/post-updat
  gitlink:git-update-server-info[1], and the documentation
  link:hooks.html[Hooks used by git].)
  
 -Advertise the url of proj.git.  Anybody else should then be able to
 -clone or pull from that url, for example with a command line like:
 +Advertise the URL of proj.git.  Anybody else should then be able to
 +clone or pull from that URL, for example with a command line like:
  
  -------------------------------------------------
  $ git clone http://yourserver.com/~you/proj.git
@@@ -1920,7 -1927,7 +1927,7 @@@ As with git-fetch, git-push will compla
  a <<fast-forwards,fast forward>>.  Normally this is a sign of
  something wrong.  However, if you are sure you know what you're
  doing, you may force git-push to perform the update anyway by
 -proceeding the branch name by a plus sign:
 +preceding the branch name by a plus sign:
  
  -------------------------------------------------
  $ git push ssh://yourserver.com/~you/proj.git +master
@@@ -2040,7 -2047,7 +2047,7 @@@ $ git branch --track test origin/maste
  $ git branch --track release origin/master
  -------------------------------------------------
  
 -These can be easily kept up to date using gitlink:git-pull[1]
 +These can be easily kept up to date using gitlink:git-pull[1].
  
  -------------------------------------------------
  $ git checkout test && git pull
@@@ -2132,7 -2139,7 +2139,7 @@@ changes are in a specific branch, use
  $ git log linux..branchname | git-shortlog
  -------------------------------------------------
  
 -To see whether it has already been merged into the test or release branches
 +To see whether it has already been merged into the test or release branches,
  use:
  
  -------------------------------------------------
  $ git log release..branchname
  -------------------------------------------------
  
 -(If this branch has not yet been merged you will see some log entries.
 +(If this branch has not yet been merged, you will see some log entries.
  If it has been merged, then there will be no output.)
  
  Once a patch completes the great cycle (moving from test to release,
  then pulled by Linus, and finally coming back into your local
 -"origin/master" branch) the branch for this change is no longer needed.
 +"origin/master" branch), the branch for this change is no longer needed.
  You detect this when the output from:
  
  -------------------------------------------------
@@@ -2412,7 -2419,7 +2419,7 @@@ $ git rebase --continu
  
  and git will continue applying the rest of the patches.
  
 -At any point you may use the --abort option to abort this process and
 +At any point you may use the `--abort` option to abort this process and
  return mywork to the state it had before you started the rebase:
  
  -------------------------------------------------
@@@ -2479,9 -2486,9 +2486,9 @@@ $ git checkout -b mywork-new origi
  $ gitk origin..mywork &
  -------------------------------------------------
  
 -And browse through the list of patches in the mywork branch using gitk,
 +and browse through the list of patches in the mywork branch using gitk,
  applying them (possibly in a different order) to mywork-new using
 -cherry-pick, and possibly modifying them as you go using commit --amend.
 +cherry-pick, and possibly modifying them as you go using `commit --amend`.
  The gitlink:git-gui[1] command may also help as it allows you to
  individually select diff hunks for inclusion in the index (by
  right-clicking on the diff hunk and choosing "Stage Hunk for Commit").
@@@ -2554,6 -2561,72 +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
  ==========================
@@@ -2739,7 -2812,7 +2812,7 @@@ others
  
  - Git can quickly determine whether two objects are identical or not,
    just by comparing names.
 -- Since object names are computed the same way in ever repository, the
 +- Since object names are computed the same way in every repository, the
    same content stored in two repositories will always be stored under
    the same name.
  - Git can detect errors when it reads an object, by checking that the
@@@ -2756,7 -2829,7 +2829,7 @@@ There are four different types of objec
    "blob" objects into a directory structure. In addition, a tree object
    can refer to other tree objects, thus creating a directory hierarchy.
  - A <<def_commit_object,"commit" object>> ties such directory hierarchies
 -  together into a <<def_DAG,directed acyclic graph>> of revisions - each
 +  together into a <<def_DAG,directed acyclic graph>> of revisions--each
    commit contains the object name of exactly one tree designating the
    directory hierarchy at the time of the commit. In addition, a commit
    refers to "parent" commit objects that describe the history of how we
@@@ -3029,7 -3102,7 +3102,7 @@@ There are also other situations that ca
  example, a "dangling blob" may arise because you did a "git add" of a
  file, but then, before you actually committed it and made it part of the
  bigger picture, you changed something else in that file and committed
 -that *updated* thing - the old state that you added originally ends up
 +that *updated* thing--the old state that you added originally ends up
  not being pointed to by any commit or tree, so it's now a dangling blob
  object.
  
@@@ -3044,7 -3117,7 +3117,7 @@@ up pointing to them, so they end up "da
  Generally, dangling objects aren't anything to worry about. They can
  even be very useful: if you screw something up, the dangling objects can
  be how you recover your old tree (say, you did a rebase, and realized
 -that you really didn't want to - you can look at what dangling objects
 +that you really didn't want to--you can look at what dangling objects
  you have, and decide to reset your head to some old dangling state).
  
  For commits, you can just use:
@@@ -3088,10 -3161,10 +3161,10 @@@ $ git prun
  ------------------------------------------------
  
  and they'll be gone. But you should only run "git prune" on a quiescent
 -repository - it's kind of like doing a filesystem fsck recovery: you
 +repository--it's kind of like doing a filesystem fsck recovery: you
  don't want to do that while the filesystem is mounted.
  
 -(The same is true of "git-fsck" itself, btw - but since
 +(The same is true of "git-fsck" itself, btw, but since
  git-fsck never actually *changes* the repository, it just reports
  on what it found, git-fsck itself is never "dangerous" to run.
  Running it while somebody is actually changing the repository can cause
@@@ -3425,10 -3498,9 +3498,10 @@@ The Workflo
  ------------
  
  High-level operations such as gitlink:git-commit[1],
 -gitlink:git-checkout[1] and git-reset[1] work by moving data between the
 -working tree, the index, and the object database.  Git provides
 -low-level operations which perform each of these steps individually.
 +gitlink:git-checkout[1] and gitlink:git-reset[1] work by moving data
 +between the working tree, the index, and the object database.  Git
 +provides low-level operations which perform each of these steps
 +individually.
  
  Generally, all "git" operations work on the index file. Some operations
  work *purely* on the index file (showing the current state of the
@@@ -3483,7 -3555,7 +3556,7 @@@ You write your current index file to a 
  $ git write-tree
  -------------------------------------------------
  
 -that doesn't come with any options - it will just write out the
 +that doesn't come with any options--it will just write out the
  current index into the set of tree objects that describe that state,
  and it will return the name of the resulting top-level tree. You can
  use that tree to re-generate the index at any time by going in the
@@@ -3494,7 -3566,7 +3567,7 @@@ object database -> inde
  ~~~~~~~~~~~~~~~~~~~~~~~~
  
  You read a "tree" file from the object database, and use that to
 -populate (and overwrite - don't do this if your index contains any
 +populate (and overwrite--don't do this if your index contains any
  unsaved state that you might want to restore later!) your current
  index.  Normal operation is just
  
@@@ -3542,7 -3614,7 +3615,7 @@@ Tying it all togethe
  
  To commit a tree you have instantiated with "git-write-tree", you'd
  create a "commit" object that refers to that tree and the history
 -behind it - most notably the "parent" commits that preceded it in
 +behind it--most notably the "parent" commits that preceded it in
  history.
  
  Normally a "commit" has one parent: the previous state of the tree
@@@ -3685,7 -3757,7 +3758,7 @@@ Once you know the three trees you are g
  tree, aka the common tree, and the two "result" trees, aka the branches
  you want to merge), you do a "merge" read into the index. This will
  complain if it has to throw away your old index contents, so you should
 -make sure that you've committed those - in fact you would normally
 +make sure that you've committed those--in fact you would normally
  always do a merge against your last commit (which should thus match what
  you have in your current index anyway).
  
@@@ -3705,7 -3777,7 +3778,7 @@@ Merging multiple trees, continue
  ---------------------------------
  
  Sadly, many merges aren't trivial. If there are files that have
 -been added.moved or removed, or if both branches have modified the
 +been addedmoved or removed, or if both branches have modified the
  same file, you will be left with an index tree that contains "merge
  entries" in it. Such an index tree can 'NOT' be written out to a tree
  object, and you will have to resolve any such merge clashes using
@@@ -3957,7 -4029,7 +4030,7 @@@ Two things are interesting here
  
  - `get_sha1()` returns 0 on _success_.  This might surprise some new
    Git hackers, but there is a long tradition in UNIX to return different
 -  negative numbers in case of different errors -- and 0 on success.
 +  negative numbers in case of different errors--and 0 on success.
  
  - the variable `sha1` in the function signature of `get_sha1()` is `unsigned
    char \*`, but is actually expected to be a pointer to `unsigned
@@@ -4062,7 -4134,7 +4135,7 @@@ $ git branch new     # create branch "n
  $ git branch -d new  # delete branch "new"
  -----------------------------------------------
  
 -Instead of basing new branch on current HEAD (the default), use:
 +Instead of basing new branch on current HEAD (the default), use:
  
  -----------------------------------------------
  $ git branch new test    # branch named "test"