git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
SBSanti Béjar <santi@agolina.net>
Date
Dec 16, 2009, 23:58 UTC
Message-ID
<adf1fd3d0912161558u36d9674eid36e3042d181ed8f@mail.gmail.com>
In-Reply-To
<20091216232641.GK25474@genesis.frugalware.org>
On Thu, Dec 17, 2009 at 12:26 AM, Miklos Vajna <vmiklos@frugalware.org> wrote:
Show 10 quoted lines
> On Wed, Dec 16, 2009 at 11:05:52AM -0700, Elijah Newren <newren@gmail.com> 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.
>
> 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.

Not out-of-the-box but this does exactly what you said, print all commits only reachable from the "new" branch:

git log new --not $(git for-each-ref --format='%(refname)' 'refs/heads/*' | grep -v refs/heads/new)

For the original question, I think what makes most sense in this case is asking for the commits since the upstream branch. Some time ago there was a discussion about a syntax for the tracking branch and there was even a patch:

Subject: [PATCH v2] Introduce <branch>@{upstream} as shortcut to the
tracked branch
Date: 2009-09-10 15:25:57 GMT
http://news.gmane.org/find-root.php?message_id=%3calpine.DEB.1.00.0909101724520.8306%40pacific.mpi%2dcbg.de%3e
but it's not in git.git.

HTH, Santi

Previous: Miklos VajnaNext: Elijah Newren
Message 4 of 10 in “How do I show only log messages for commits on a specific branch?”
  1. bd@bc-bd.orgDec 16, 2009
  2. Elijah NewrenDec 16, 2009
  3. Miklos VajnaDec 16, 2009
  4. Santi BéjarDec 16, 2009
  5. Elijah NewrenDec 17, 2009
  6. Elijah NewrenDec 16, 2009
  7. Miklos VajnaDec 17, 2009
  8. Stefan VölkelDec 17, 2009
  9. David RodenDec 17, 2009
  10. Pat NotzDec 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.