git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: keeping track of where a patch begins

From
Jeff King <peff@peff.net>
Date
Oct 26, 2009, 14:30 UTC
Message-ID
<20091026143006.GA3300@sigill.intra.peff.net>
In-Reply-To
<7veiow4iqc.fsf@alter.siamese.dyndns.org>
On Wed, Oct 21, 2009 at 01:03:55PM -0700, Junio C Hamano wrote:
Show 6 quoted lines
>  (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:

Show 10 quoted lines
>  (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
Previous: Thomas Rast
Message 8 of 8 in “keeping track of where a patch begins”
  1. E ROct 21, 2009
  2. Nicolas PitreOct 21, 2009
  3. Junio C HamanoOct 21, 2009
  4. Nicolas PitreOct 21, 2009
  5. Thomas RastOct 22, 2009
  6. Pascal ObryOct 30, 2009
  7. Thomas RastOct 30, 2009
  8. Jeff KingOct 26, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.