emacs-devel
[Top][All Lists]
Advanced

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

Re: git log question


From: Kaushal Modi
Subject: Re: git log question
Date: Thu, 30 Nov 2017 15:21:03 +0000

On Thu, Nov 30, 2017 at 10:06 AM Andreas Schwab <address@hidden> wrote:
On Nov 30 2017, Stephen Berman <address@hidden> wrote:

> Thanks, but this does do what I want.  For example, when I invoke `git
> branch --contains b407c521f2' on emacs-26 (here currently at
> 408862f02a), it outputs `master', but when I invoke `git merge-base
> --is-ancestor b407c521f2 HEAD && git log -1 b407c521f2' on emacs-26, it
> outputs nothing;

That's correct, b407c521f2 is only reachable from master.  So this is
exactly what you were looking for.

I am just chiming in to mention Magit as I am surprised why no one else has mentioned it yet.

See how easy it is to figure out such things (and many more git things) in Magit:

1. Do M-x magit-status in emacs repo
2. Hit 'lb' to view the log of all branches (that gives the buffer on the left you see in the below image).
3. C-s b407c521f2 (the commit you are interested in).
4. Hit RET
5. Boom! The commit details show up in the buffer you see in the right in the below linked image. Notice the yellow highlighted "master". Only "master" and few other branches are listed there.. but *not* "emacs-26". So that commit is only on "master". If a commit were on both branches, both would be listed on that row.

And the image..https://i.imgur.com/ec9izl4.png

That is one way to do that.. you could have alternatively just follow the branching graphics/ascii art in that log view buffer to figure out that that commit was only on origin/master and not on origin/emacs-26.

(no need to memorize cryptic git commands)
--

Kaushal Modi


reply via email to

[Prev in Thread] Current Thread [Next in Thread]