Re: Show containing branches in log?

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

 



On Wed, Jul 2, 2014 at 11:52 AM, Jason Pyeron <jpyeron@xxxxxxxx> wrote:
>> -----Original Message-----
>> From: Jeff King
>> Sent: Wednesday, July 02, 2014 12:35
>>
>> On Wed, Jul 02, 2014 at 09:50:57AM -0500, Robert Dailey wrote:
>>
>> > I know that with the `git branch` command I can determine which
>> > branches contain a commit. Is there a way to represent this
>> > graphically with `git log`? Sometimes I just have a commit,
>> and I need
>> > to find out what branch contains that commit. The reason why `git
>> > branch --contains` doesn't solve this problem for me is
>> that it names
>> > almost all branches because of merge commits. Too much ancestry has
>> > been built since this commit, so there is no way to find
>> the "closest"
>> > branch that contains that commit.
>> >
>> > Is there a way to graphically see what is the "nearest" named ref to
>> > the specified commit in the logs?
>>
>> Have you tried "git describe --contains --all <commit>"?
>>
>> To some degree, I fear your question isn't something git can
>> answer. If
>> the branch containing the commit has been merged into other branches,
>> then they all "contain" the commit. There is not really any reason to
>> prefer one over the other ("describe --contains" will try to find the
>> "closest" branch, but that is based on heuristics and is not
>> necessarily
>> well-defined).
>
> Another way I answer this question is git log --oneline --graph --all and then
> search for the commit and follow the lines.

If that were a practical solution I wouldn't be here asking this
question. Unfortunately, in a repository with multiple parallel
release branches, it is impossible to just "eye-ball" the graph and
find what you're looking for. Especially when the last 4 weeks worth
of commits consumes over 10 pages of log graph.
--
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]