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