Re: keeping track of where a patch begins

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]