Re: Find out on which branch a commit was originally made

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/18/10 17:26, Stefan Haller wrote:
> Ævar Arnfjör? Bjarmason <avarab@xxxxxxxxx> wrote:
>>                      A---B---C topic
>>                     /         \
>>                D---E---F---G---H master

 The question is the same though: if I hit commit B while blaming, how do
> I know what topic it was a part of?  For that, I need to find commit H
> which will tell me, right?  How do I do that?

git rev-list --ancestry-path --merges --reverse B..master --format=oneline

> One concern that they are raising is that in Git there doesn't seem to
> be an easy way to find out on which branch a given commit was originally
> made, after the branch is merged back and deleted. They consider this a
> show-stopper.  In Mercurial, branch information is meta data attached to
> each commit, so you can easily get this information even after a branch
> is closed.

Don't do that, then. 
IOW if you know you could still need the old branch info, make an alias
that doesn't actually delete the branch after merging, but moves the ref
away, eg 'topic-name' -> "merged/topic-name" or just adds a
"merged/topic-name" tag. Then simply checking from which "merged/*"
branch/tag the offending commit is reachable would be enough.
Deleting a merged branch does not do anything more than removing the
reference (to 'C' in the above example), all the history stays around
forever anyway...

artur
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]