Re: How do I show only log messages for commits on a specific branch?

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

 



On Wed, Dec 16, 2009 at 4:26 PM, Miklos Vajna <vmiklos@xxxxxxxxxxxxxx> wrote:
> On Wed, Dec 16, 2009 at 11:05:52AM -0700, Elijah Newren <newren@xxxxxxxxx> wrote:
>>   git log new@{30.years.ago}..new
>> (You'll get a warning that 'new' hasn't existed for 30 years but it
>> doesn't hurt anything)
>
> That's the same as "git log new", if I'm not mistaken.

Did you try it with a 'new' branch in your repository that started at
the beginning of history rather than at some commit?  "git log new"
and "git log new@{30.years.ago}..new" are not the same for me with
git-1.6.5.5:

$ git init repo
$ cd repo
$ echo content> foo && git add foo && git commit -mone foo
$ echo more content >> foo && git commit -mtwo foo
$ git checkout -b new master~1
$ echo stuff >> foo && git commit -mthree foo
$ git log new@{30.years.ago}..new
warning: Log for 'new' only goes back to Wed, 16 Dec 2009 16:48:02 -0700.
commit 7df8bad7cc146875c59ab030da0d25555976e79c
Author: Elijah Newren <newren@xxxxxxxxx>
Date:   Wed Dec 16 16:48:07 2009 -0700

    three
$ git log new

commit 7df8bad7cc146875c59ab030da0d25555976e79c
Author: Elijah Newren <newren@xxxxxxxxx>
Date:   Wed Dec 16 16:48:07 2009 -0700

    three

commit b86eadcdb152877ade44bebf4b8742884949f29f
Author: Elijah Newren <newren@xxxxxxxxx>
Date:   Wed Dec 16 16:47:31 2009 -0700

    one

> What Stefan wants to do is to let git log show the commits which are
> only in the "new" branch, but I don't think there is an out-of-the-box
> solution for that.

Are you sure?  I'm more inclined to believe he'd like to see all the
commits that have been added to the "new" branch since he created it
(which may be the same as what you say, but not necessarily).  Of
course, neither my assumption or yours match what he actually asked
for (though I think what he asked for isn't possible and is merely an
means to the end he really wants).

Also, I think this does what you asked for (the commits in the "new"
branch but no other branch):
$ git log new $(git for-each-ref --format='%(refname)' 'refs/heads/*'
| grep -v '^refs/heads/new$' | sed -e s/^/^/)
--
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]