Thread (6 messages) flat view 6 messages, 4 authors, 2016-06-15

Re: help with git query

From: Nathan W. Panike <hidden>
Date: 2016-06-15 22:46:36

On Mon, Apr 13, 2009 at 3:57 PM, E R [off-list ref] 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.
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
On Mon, Apr 13, 2009 at 3:31 PM, Nathan W. Panike
[off-list ref] wrote:
quoted
On Mon, Apr 13, 2009 at 1:51 PM, E R [off-list ref] wrote:
quoted
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
quoted
 - 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
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help