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

Re: branch management

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 10, 2009, 17:37 UTC
Message-ID
<alpine.LFD.2.01.0906101026121.6847@localhost.localdomain>
In-Reply-To
<alpine.LFD.2.00.0906101118070.31536@xanadu.home>
On Wed, 10 Jun 2009, Nicolas Pitre wrote:
Show 17 quoted lines
> On Wed, 10 Jun 2009, Jakub Narebski wrote:
> 
> > Harry Duin <hduin@optionshouse.com> writes:
> > 
> > > 2. show list of files/directories touched by a branch (useful when
> > >    looking for past fixes, but are unsure where the fix was done)
> > 
> > If you can use pickaxe search (git log -S...), or git-blame, or just
> > looking throught "git log ... -- <path>", you can use
> > 
> > $ git rev-list master..branch | 
> >   git diff-tree --stdin -r --name-only |
> >   sort -u
> 
> What I use in that case is simply
> 
> 	git diff --stat master...branch

No, that's not going to work in general. The "master...branch" thing works most of the time, but there isn't always a single merge-point, and in the case of criss-cross merges, you'll get it wrong.

It will also hide changes that got reverted (or undone some other way), which can be relevant.

That said, the "git rev-list | git diff-tree" thing has a new name. We call it "git log".

So what Jakub wrote can generally be written as
	git log --name-only --pretty=format:'' master..branch | sort -u

if you're willing to accept the empty line from all the suppressed commit messages (with that "git diff-tree" he'll see all the commit numbers, though, so I guess the 'git log' thing is still better)

			Linus
Previous: Nicolas PitreNext: Daniel Barkalow
Message 11 of 12 in “show-branch: fix segfault when showbranch.default exists”
  1. show-branch: fix segfault when showbranch.default existsJunio C Hamano, Jun 9, 2009
  2. Stephen BoydJun 9, 2009
  3. Pierre HabouzitJun 9, 2009
  4. Junio C HamanoJun 9, 2009
  5. Pierre HabouzitJun 9, 2009
  6. branch managementHarry Duin, Jun 9, 2009
  7. Alex RiesenJun 9, 2009
  8. Harry DuinJun 10, 2009
  9. Jakub NarebskiJun 10, 2009
  10. Nicolas PitreJun 10, 2009
  11. Linus TorvaldsJun 10, 2009
  12. Daniel BarkalowJun 10, 2009

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.