core-tutorial.txt: Fix git-show-branch example and its description
Signed-off-by: Sergei Organov <osv@javad.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sergei Organov committed
Nov 8, 2007 at 18:10 UTC
2782c9355a97667acfc40a828dbae5c5bc151047
1 file changed
+15
-2
Documentation/core-tutorial.txt
+15
-2
@@ -931,12 +931,13 @@ Another useful tool, especially if you do not always work in X-Window
931
environment, is `git show-branch`.
932
933
------------------------------------------------
934
-$ git show-branch --topo-order master mybranch
934
+$ git-show-branch --topo-order --more=1 master mybranch
935
* [master] Merge work in mybranch
936
! [mybranch] Some work.
937
--
938
- [master] Merge work in mybranch
939
*+ [mybranch] Some work.
940
+* [master^] Some fun.
941
------------------------------------------------
942
943
The first two lines indicate that it is showing the two branches
@@ -954,10 +955,22 @@ because `mybranch` has not been merged to incorporate these
955
commits from the master branch. The string inside brackets
956
before the commit log message is a short name you can use to
957
name the commit. In the above example, 'master' and 'mybranch'
957
-are branch heads. 'master~1' is the first parent of 'master'
958
+are branch heads. 'master^' is the first parent of 'master'
959
branch head. Please see 'git-rev-parse' documentation if you
960
see more complex cases.
961
962
+[NOTE]
963
+Without the '--more=1' option, 'git-show-branch' would not output the
964
+'[master^]' commit, as '[mybranch]' commit is a common ancestor of
965
+both 'master' and 'mybranch' tips. Please see 'git-show-branch'
966
+documentation for details.
967
+
968
+[NOTE]
969
+If there were more commits on the 'master' branch after the merge, the
970
+merge commit itself would not be shown by 'git-show-branch' by
971
+default. You would need to provide '--sparse' option to make the
972
+merge commit visible in this case.
973
+
974
Now, let's pretend you are the one who did all the work in
975
`mybranch`, and the fruit of your hard work has finally been merged
976
to the `master` branch. Let's go back to `mybranch`, and run