From: Jeff King <peff@peff.net>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Finding a branch point in git
Date: Mon, 28 May 2012 15:06:39 -0400 [thread overview]
Message-ID: <20120528190639.GA2478@sigill.intra.peff.net> (raw)
In-Reply-To: <CAMP44s04msWMOaaH8U30XXg5yXJnEd=bULJ7VPxWSD0Wfh2=EA@mail.gmail.com>
On Mon, May 28, 2012 at 02:36:04PM +0200, Felipe Contreras wrote:
> > What about a history with multiple branches?
> >
> > --X--A--B--C--D----E (master)
> > \ /
> > G--H--I---J (branch X)
> > \ /
> > K--L (branch Y)
> [...]
>
> Yes, but then you would need to specify a second branch. I would avoid
> that if possible.
I agree that is less nice. But I don't think the operation is
well-defined with a single branch. If you ask for "when did branch X
split", then in the above graph it is unclear if you meant "split from
master", or "split from Y".
Maybe you could assume "master", or assume "git symbolic-ref HEAD" as
the second branch?
> There's also another case that doesn't work:
>
> -- X -- A -- B (master)
> \
> \
> C (branch A)
>
> Shouldn't be hard to add checks for those cases I think.
Actually, I think that one extends naturally. They are never merged, so
your rev-list never finds a merge commit, and you can just take the
merge base of the branch tips.
-Peff
next prev parent reply other threads:[~2012-05-28 19:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-27 12:37 Finding a branch point in git Felipe Contreras
2012-05-28 6:20 ` Jeff King
2012-05-28 12:36 ` Felipe Contreras
2012-05-28 19:06 ` Jeff King [this message]
2012-05-30 17:07 ` Felipe Contreras
2012-05-30 21:54 ` Jeff King
2012-05-31 15:27 ` Felipe Contreras
2012-05-31 16:10 ` Felipe Contreras
2012-05-31 20:37 ` PJ Weisberg
2012-06-01 9:15 ` Felipe Contreras
2012-05-31 15:37 ` Martin Langhoff
2012-05-30 16:52 ` Felipe Contreras
2012-05-30 21:45 ` Jeff King
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=20120528190639.GA2478@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
/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).