From: Jeff King <peff@peff.net>
To: lei yang <yanglei.fage@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: how to know this commit is merged by whic commit
Date: Wed, 13 Jun 2012 17:34:35 -0400 [thread overview]
Message-ID: <20120613213435.GA25301@sigill.intra.peff.net> (raw)
In-Reply-To: <CAHsH0E9HooVsAq8NhWm-OSk7gSPFMmoYHsArtYqhwTmE0ngwjA@mail.gmail.com>
On Thu, Jun 14, 2012 at 12:50:59AM +0800, lei yang wrote:
> I have a question as the title indicate. assume the commmit id is
> ee5r3343. how to know this commit is merged by which commit?
There is not one answer to "which commit"; there may be an infinite
number of commits which merge it into something else. The best you can
do is start at some point (e.g., the tip of "master") and walk backwards
looking for commits which merge it (and you still may find multiple, if
the commit was merged into two other lines of development, each of which
was merged into your starting point). There is not an option to do this
search automatically, so you would have to use grep, like:
git log --format='%H %P' |
grep " $commit" |
cut -d' ' -f1
which will list the id of all commits (%H) for which $commit appears in
the list of parents (%P).
-Peff
PS You didn't give any background on your problem, but you may also find
"git tag --contains" and "git branch --contains" useful.
next prev parent reply other threads:[~2012-06-13 21:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-13 16:50 how to know this commit is merged by whic commit lei yang
2012-06-13 21:34 ` Jeff King [this message]
2012-06-13 22:22 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120613213435.GA25301@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=yanglei.fage@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).