git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Dailey <rcdailey.lists@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git <git@vger.kernel.org>
Subject: Re: Show containing branches in log?
Date: Wed, 2 Jul 2014 11:52:43 -0500	[thread overview]
Message-ID: <CAHd499Bk6ZG+DDjN1HuC-RFczwd+AGZaUSkXA6a8MsZjOL5H8A@mail.gmail.com> (raw)
In-Reply-To: <20140702163451.GB14404@sigill.intra.peff.net>

On Wed, Jul 2, 2014 at 11:34 AM, Jeff King <peff@peff.net> wrote:
> Have you tried "git describe --contains --all <commit>"?
>
> To some degree, I fear your question isn't something git can answer. If
> the branch containing the commit has been merged into other branches,
> then they all "contain" the commit. There is not really any reason to
> prefer one over the other ("describe --contains" will try to find the
> "closest" branch, but that is based on heuristics and is not necessarily
> well-defined).

I have not tried that command. Note I mentioned named refs, so
nameless branches I'm not worried about. Even if I merge branch A into
branch B, branch A is still closest in terms of number of steps to get
to the commit, because to get to the commit through B you have to
cross over a merge commit. Basically the priority should be directness
and distance. The more direct a branch is (i.e. the lesser number of
merge commits it goes through to get to the commit) the more relevant
it is. As a second condition, distance would be used in cases where
the directness of it is the same.

Sorting this in the log graph and seeing it visually (I could even use
--simplify-by-decoration) would help me understand the topography of
git's history relative to the commit(s) I specify.

  reply	other threads:[~2014-07-02 16:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02 14:50 Show containing branches in log? Robert Dailey
2014-07-02 16:34 ` Jeff King
2014-07-02 16:52   ` Robert Dailey [this message]
2014-07-02 16:52   ` Jason Pyeron
2014-07-02 16:59     ` Robert Dailey
2014-07-03 14:18 ` Peter Krefting
2014-07-03 17:25   ` Jeff King
2014-07-03 19:41 ` Øyvind A. Holm
2014-08-01 18:01   ` Robert Dailey
2014-08-25 23:35   ` Robert Dailey

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=CAHd499Bk6ZG+DDjN1HuC-RFczwd+AGZaUSkXA6a8MsZjOL5H8A@mail.gmail.com \
    --to=rcdailey.lists@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).