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

Re: help with git query

From
Nathan W. Panike <nathan.panike@gmail.com>
Date
Apr 13, 2009, 22:33 UTC
Message-ID
<d77df1110904131533y46234255qc0ec533ee583df95@mail.gmail.com>
In-Reply-To
<3a69fa7c0904131357w5ef6b8feu7aac503fdcc4486c@mail.gmail.com>
On Mon, Apr 13, 2009 at 3:57 PM, E R <pc88mxer@gmail.com> wrote:
> Thanks - that's very helpful.
>
> For the second question, is it possible to find the commit that
> represents the merge in the master branch?
There might not be an actual commit, if the merge was a fast forward.
Show 7 quoted lines
>
> i.e.
>
>   git merge-base XXX master
>
> returns the commit in branch XXX that got merged into master. I'd like
> to also find the commit that represents the merge in master.
If one exists, I think this might do what you want:
git log --pretty=oneline master --not $(git merge-base XXX master) | tail -1
Show 34 quoted lines
> On Mon, Apr 13, 2009 at 3:31 PM, Nathan W. Panike
> <nathan.panike@gmail.com> wrote:
>> On Mon, Apr 13, 2009 at 1:51 PM, E R <pc88mxer@gmail.com> wrote:
>>> Hi,
>>>
>>> I'd like to generate the following report from git:
>>>
>>> for each branch:
>>>  - info about the latest commit on that branch (date and time, message, etc.)
>>
>> Depending on what you want to do---from a bash shell, you could do:
>>
>> for i in $(git branch -a | cut -b3-); do echo $i; git show -s $i; echo; done
>>
>>>  - info about the last time it was merged into master
>>
>> for i in $(git branch -a | cut -b3-); do echo $i; git show -s $(git
>> merge-base $i master); echo; done
>>>
>>> What commands can I run to figure this out? I think I can figure out
>>> the first one - it's the second one I'm having trouble with.
>>>
>>> And if it would easier to do it from the C API (or something like the
>>> perl Git::PurePerl module) I'd be interested in knowing that, too.
>>>
>>> Thanks,
>>> ER
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe git" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>>
>
Previous: E RNext: Jeff King
Message 4 of 6 in “help with git query”
  1. E RApr 13, 2009
  2. Nathan W. PanikeApr 13, 2009
  3. E RApr 13, 2009
  4. Nathan W. PanikeApr 13, 2009
  5. Jeff KingApr 14, 2009
  6. Björn SteinbrinkApr 14, 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.