All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Junio C Hamano <gitster@pobox.com>
Cc: Nicolas Pitre <nico@fluxnic.net>, E R <pc88mxer@gmail.com>,
	<git@vger.kernel.org>, Jeff King <peff@peff.net>
Subject: Re: keeping track of where a patch begins
Date: Thu, 22 Oct 2009 10:27:31 +0200	[thread overview]
Message-ID: <200910221027.32739.trast@student.ethz.ch> (raw)
In-Reply-To: <7veiow4iqc.fsf@alter.siamese.dyndns.org>

Junio C Hamano wrote:
> 
> A branch in git, as Randal often used to say on #git, is an illusion---it
> points only at the top and does not identify the bottom.
> 
> But it does _not_ have to stay that way at the Porcelain level.
> 
> Here is a rough sketch of one possible solution.  It is not fully thought
> out; the basic idea is probably sound but I did not try to exhaustively
> cover changes to various tools that are necessary to maintain the
> invariants this scheme requires.
> 
>  (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).
> 
>  (1) At branch creation, the branchpoint is noted. [...]
> 
>  (2) You can grow the branch naturally with "commit", "am" and "merge".
>      The bottom of the branch does not have to move with these operations.
> 
>  (3) Operations that alter histories, e.g. "commit --amend", "rebase",
>      "reset", while on a branch that records its bottom need to be taught
>      to pay attention to not break its bottom. [...]
> 
>  (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. [...]

I think this not only changes the model of branches, but also commits,
to some extent.  Currently, commit have no intrinsic branch
membership; if you say

  git branch foo bar

you cannot distinguish whether the commits on 'bar' were created on
'foo' or on 'bar'.  (By git's means; of course the decision would
favour 'master' if I had used that instead.)

Technically your proposal does not change this fact very much; it is
still possible to create "clones" of branches that are
indistinguishable.  However, to the *user* I think we would create a
notion that "a commit belongs to one specific branch", in that, during
the course of normal operations, a commit will end up on exactly one

  git rev-list --first-parent base..branch

range.

(Not sure if I consider this as an argument in favour or against yet,
but I wanted to point it out anyway.)

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  parent reply	other threads:[~2009-10-22  8:28 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 [this message]
2009-10-30  7:25       ` Pascal Obry
2009-10-30  8:37         ` Thomas Rast
2009-10-26 14:30     ` 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=200910221027.32739.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nico@fluxnic.net \
    --cc=pc88mxer@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.