git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git-show-branch doesn't work as advertised?

From
SOSergei Organov <osv@javad.com>
Date
Oct 27, 2007, 13:26 UTC
Message-ID
<ffvea2$g2n$2@ger.gmane.org>
Hello,

I'm rather new to git. I'm reading Documentation/core-tutorial.txt from git repository cloned yesterday [no, it's not the first git manual I read], and I'm stuck at the example beginning at line 938 of the tutorial:

------------------------------------------------
$ git show-branch --topo-order master mybranch
* [master] Merge work in mybranch
 ! [mybranch] Some work.
--
-  [master] Merge work in mybranch
*+ [mybranch] Some work.
------------------------------------------------

The problem is that even though the output of git matches the above output (after I've replayed all the commands to this point), both the state of the repo and the text below the example in the tutorial suggest that one commit is missing from the output. In particular, the tutorial says: "Three commits are shown along with their log messages." and later "'master~1' is the first parent of 'master' branch head.", while there are only 2 commits shown and there is no 'master~1' in the output.

The behavior is the same with git version 1.5.2.2 and 1.5.3.4.
For reference, from gitk output, the history looks like this:

. [master] . o Merge work in mybranch . |\[mybranch] . | o Some work . | | . o | Some fun . \| . o Commit message . | . o Initial commit

Why "[master~1] Some fun." is not shown by git-show-branch?

Another issue. After above confusion I turned to the manual page and decided to try --independent option, expecting an output similar to the above, but missing all the common commits. However, to my surprise I've got just:

$ git show-branch --topo-order --independent master mybranch 715ec06a744a801237c7233f3fb87ad583653c3a

instead. Nowhere the manual page says that this particular option changes the format of the output so dramatically. And back to the first issue, there is still only 1 commit shown, while it seems there should be 2 of them, one from master, and one from mybranch.

-- 
Sergei.
Message 1 of 1 in “git-show-branch doesn't work as advertised?”
  1. Sergei OrganovOct 27, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.