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

Re: git show-branch --topics and merge commits

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2011, 18:14 UTC
Message-ID
<7v4o2jlalx.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CA+6x0LXHKZgvW4_hWz8qrWQshqxB3pQ-=08itqnV5smA_NCrBA@mail.gmail.com>
Mike Shal <marfey@gmail.com> writes:
> Ok, makes sense. Is 'git rev-list' supposed to give the same list of
> commits then? In my example, rev-list shows the commit on the branch
> even after upstream has been merged in.

"show-branch" was designed to stop after seeing a commit that are shared with all the branches it was given, so

	git show-branch A B
is more like
	git rev-list --left-right --boundary A...B
and not at all like
	git rev-list A..B
which is to show all commits not in A that appear in B.

Note that show-branch was invented way before the log family of commands (which rev-list is a member of) learned --left-right/--boundary/--graph options, and I personally think its graphical output mode outlived its usefulness as a stopgap measure. As its "merge-base" and "independent" modes have also been made redundant (see "git merge-base" for two options to mimic their behaviour), we may want to start thinking about deprecating the command, and the first step perhaps would be to replace its mention from the first part of the Everyday Git document with something more appropriate such as "git log".

Previous: Mike ShalNext: Mike Shal
Message 4 of 5 in “git show-branch --topics and merge commits”
  1. Mike ShalJul 17, 2011
  2. Junio C HamanoJul 18, 2011
  3. Mike ShalJul 18, 2011
  4. Junio C HamanoJul 18, 2011
  5. Mike ShalJul 18, 2011

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.