git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Nicolas Pitre <nico@fluxnic.net>, E R <pc88mxer@gmail.com>,
	git@vger.kernel.org
Subject: Re: keeping track of where a patch begins
Date: Mon, 26 Oct 2009 10:30:07 -0400	[thread overview]
Message-ID: <20091026143006.GA3300@sigill.intra.peff.net> (raw)
In-Reply-To: <7veiow4iqc.fsf@alter.siamese.dyndns.org>

On Wed, Oct 21, 2009 at 01:03:55PM -0700, Junio C Hamano wrote:

>  (0) Define a way to identify the bottom of a branch.  One way to do this
>      is by an extra ref (e.g. refs/branchpoints/frotz).  Then the commits
>      between refs/branchpoints/frotz..refs/heads/frotz identifies the
>      commits on the branch.  None of the additional restrictions below
>      applies when the branch does not have such bottom defined (i.e.
>      created by the current git without this extension).

Hmm. This feels like redundant information to me. It has always been
git's strategy to record the history graph, and to use merge bases as
the "bottom" of branches, rather than keeping an artificial "started
here" commit. So I am trying to see the advantages of recording a static
bottom versus doing a merge-base calculation later. Some things I can
think of:

  - a bottom implies a specific commit, whereas a merge-base is always
    with respect to anothe tip. So to have a default "bottom" calculated
    by merge-base, you need a default "upstream". Which we do have, but
    of course it is subject to being rewound.

  - your merge-base will move when you merge. But arguably, that is a
    good thing. If you are talking about "git log" only looking at the
    commits on this branch (as you do later in the quoted email), I
    would expect to see only stuff that happened since upstream last
    merged. Although to be honest, I am not sure such a limit is all
    that useful. We already have "git log upstream..branch".

So I am not really clear on what you are trying to accomplish by
recording such a bottom. Your steps (0) through (3) seem to be leading
up to this use case:

>  (4) Operations that browse histories, e.g. "log", "show-branch", while on
>      a branch that records its bottom can be taught to pay attention to
>      the bottom.  For example, it is conceivable that
> 
>      $ git log
>      $ git log -- Documentation/
> 
>      without an explicit branch name that fell back to the default HEAD
>      while on branch "frotz" might be better run with an implicit bottom
>      ^refs/branchpoint/frotz.

If that is all you want, can't we just default to something like:

  $ git log $(git for-each-ref --format='%(upstream)' $(git symbolic-ref HEAD)))..

Of course it would be much easier to type as "git log @{upstream}.." :)

-Peff

      parent reply	other threads:[~2009-10-26 14:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-21 14:45 keeping track of where a patch begins E R
2009-10-21 18:14 ` Nicolas Pitre
2009-10-21 20:03   ` Junio C Hamano
2009-10-21 20:50     ` Nicolas Pitre
2009-10-22  8:27     ` Thomas Rast
2009-10-30  7:25       ` Pascal Obry
2009-10-30  8:37         ` Thomas Rast
2009-10-26 14:30     ` Jeff King [this message]

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=20091026143006.GA3300@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nico@fluxnic.net \
    --cc=pc88mxer@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).