git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Sam Vilain <sam.vilain@catalyst.net.nz>
Cc: git@vger.kernel.org
Subject: Re: [RFC] [PATCH 0/5] Implement 'prior' commit object links
Date: Mon, 24 Apr 2006 22:16:08 -0700	[thread overview]
Message-ID: <7vwtde2q1z.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20060425035421.18382.51677.stgit@localhost.localdomain> (Sam Vilain's message of "Tue, 25 Apr 2006 15:54:21 +1200")

Sam Vilain <sam.vilain@catalyst.net.nz> writes:

> Examples of use cases this helps:

My reaction to this patch series is that you try to cover quite
different and unrelated things, without thinking things through,
and end up covering nothing usefully.  What is missing in these
"use cases" is a coherent semantics.

What the "prior" means to humans and tools.  And my *guess* of
what they mean suggests you are trying to make it mean many
unrelated concepts.

>  1. heads that represent topic branch merges
>
>     This is the "pu" branch case, where the head is a merge of several
>     topic branches that is continually moved forward.

For usage like "pu", the previous "pu" head could be recorded as
one of the parents; you do not need anything special.

The reason I do not include the previous head when I reconstruct
"pu" is because I explicitly *want* to drop history -- not
having to carry forward a failed experiment is what is desired
there.  Otherwise I would manage "pu" just like I currently do
"next" and "master".  So this is not a justification to add
something new.

>  2. revising published commits / re-basing
>
>     This is what "stg" et al do.  The tools allow you to commit,
>     rewind, revise, recommit, fast forward, etc.

stg wants to have a link to the fork-point commit.  I do not
know if it is absolutely necessary (you might be able to figure
it out using merge-base, I dunno).

>     In this case, the "prior" link would point to the last revision of
>     a patch.  Tools would probably

Probably what...???

>  3. sub-projects
>
>     In this case, the commit on the "main" commit line would have a
>     "prior" link to the commit on the sub-project.  The sub-project
>     would effectively be its own head with copied commits objects on
>     the main head.

You say you can have only one "prior" per commit, which makes
this unsuitable to bind multiple subprojects into a larger
project (the earlier "bind" proposal allows zero or more).

When you, a human, see a "prior" link in "git cat-file commit"
output, what does that tell you?  Is it "the previous commit
this thing replaces?"  Or is it a commit in a different line of
development which is its subproject?  Or is it a commit that was
cherry-picked from a different line?  How would you tell?  And
assuming you _could_ somehow tell, how would it help you to know
it?

When the Plumbing and the Porcelain sees a "prior" link, what
should they do?  It hugely depends on what that link means.  You
have a patch to merge-base to include the prior commit of the
commit in question in the ancestry chain, but that is probably
valid only for case 1. and perhaps 2. If the link points at a
commit of otherwise unrelated subproject head, you would _never_
want to include that in the merge-base computation.  Neither the
"this commit was taken out of context from otherwise unrelated
branch" link you envision to use for 4.  I think including
"prior" to ancestry list for case 1. and 2. makes some sense in
the merge-base example only because (1) it does not have to be any
different from an ordinary "parent" to begin with for case 1.,
and (2) it points at fork-point which is sort of a merge-base
already.

There may be some narrower concrete use case for which you can
devise coherent semantics, and teach tools and humans how to
interpret such inter-commit relationship that are _not_
parent-child ancestry.  For example, if you have one special
link to point at a "cherry-picked" commit, rebasing _could_ take
advantage of it.  When your side branch tip is at D, and commit
D has "this was cherry-picked from commit E" note, and if you
are rebasing your work on top of F:

        A---B---C---D
       /
  o---o---E---F

the tool can notice that F can reach E and carry forward only A,
B, and C on top of F, omitting D.  So having such a link might
be useful.  But if that is what you are going to do, I do not
think you would want to conflate that with other inter-commit
relationships, such as "previous hydra cap".

Oh, and you would need an update to rev-list --objects and
fsck-objects if you are to add any new link to commit objects.
Otherwise fetch/push would not get the related commits prior
points at, and prune will happily discard them.  But before even
bothering it, you need to come up with a semantics first.

  parent reply	other threads:[~2006-04-25  5:16 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-25  3:54 [RFC] [PATCH 0/5] Implement 'prior' commit object links Sam Vilain
2006-04-25  4:31 ` [PATCH 2/5] git-merge-base: follow 'prior' links to find merge bases Sam Vilain
2006-04-25  5:19   ` Junio C Hamano
2006-04-25  4:31 ` [PATCH 1/5] add 'prior' link in commit structure Sam Vilain
2006-04-25  5:18   ` Junio C Hamano
2006-04-25  4:31 ` [PATCH 5/5] git-commit: add --prior to set prior link Sam Vilain
2006-04-25  4:31 ` [PATCH 3/5] commit.c: parse 'prior' link Sam Vilain
2006-04-25  4:31 ` [PATCH 4/5] git-commit-tree: add support for prior Sam Vilain
2006-04-25  4:34 ` [RFC] [PATCH 0/5] Implement 'prior' commit object links Sam Vilain
2006-04-25  5:16 ` Junio C Hamano [this message]
2006-04-25 23:19   ` Sam Vilain
2006-04-26  5:06     ` Jakub Narebski
2006-04-26  5:22       ` Jakub Narebski
2006-04-26  5:36         ` [OT] " Junio C Hamano
2006-04-26  6:35           ` Jakub Narebski
2006-04-26  6:50             ` Junio C Hamano
2006-04-26  7:22               ` Jakub Narebski
2006-04-26  7:50                 ` Junio C Hamano
2006-04-26  8:44                   ` Jakub Narebski
2006-04-26  9:21                     ` Junio C Hamano
2006-04-26  9:28                   ` Jakub Narebski
2006-04-26  6:51       ` Sam Vilain
2006-04-25  6:44 ` [RFC] [PATCH 0/5] Implement 'prior' commit object links (and other commit links ideas) Jakub Narebski
2006-04-25  7:29   ` Junio C Hamano
2006-04-25  7:43     ` Jakub Narebski
     [not found]       ` <20060425043436.2ff53318.seanlkml@sympatico.ca>
2006-04-25  8:34         ` sean
     [not found]         ` <20060425045752.0c6fbc21.seanlkml@sympatico.ca>
2006-04-25  8:57           ` sean
2006-04-25  9:10             ` Jakub Narebski
2006-04-25  9:58               ` Junio C Hamano
2006-04-25 10:08                 ` Jakub Narebski
2006-04-29 14:59                   ` Jakub Narebski
2006-04-25 15:21     ` Linus Torvalds
2006-04-25 15:40       ` Linus Torvalds
     [not found]         ` <20060425121700.2d1a0032.seanlkml@sympatico.ca>
2006-04-25 16:17           ` sean
2006-04-25 17:04             ` Linus Torvalds
2006-04-26 11:25             ` Andreas Ericsson
2006-04-26 12:01               ` Jakub Narebski
2006-04-25 16:27         ` Jakub Narebski
2006-04-25 17:11           ` Linus Torvalds
2006-04-25 17:36             ` Jakub Narebski
2006-04-25 17:57               ` Linus Torvalds
2006-04-25 18:06                 ` Linus Torvalds
2006-04-25 18:24                   ` Jakub Narebski
     [not found]             ` <20060425135250.5fd889f4.seanlkml@sympatico.ca>
2006-04-25 17:52               ` sean
2006-04-25 18:08                 ` Linus Torvalds
     [not found]                   ` <20060425141412.5c115f51.seanlkml@sympatico.ca>
2006-04-25 18:14                     ` sean
2006-04-25 18:26                       ` Linus Torvalds
2006-04-25 18:41                         ` Jakub Narebski
2006-04-25 18:52                           ` Linus Torvalds
2006-04-25 19:00                             ` Jakub Narebski
2006-04-25 22:17                               ` Jason Riedy
     [not found]                         ` <20060425144525.3ef957cf.seanlkml@sympatico.ca>
2006-04-25 18:45                           ` sean
2006-04-25 19:00                             ` Linus Torvalds
2006-04-25 19:18                               ` Junio C Hamano
2006-04-25 19:34                                 ` Linus Torvalds
2006-04-25 19:51                                   ` Junio C Hamano
2006-04-25 19:58                                     ` Linus Torvalds
2006-04-26 12:42                                 ` Jakub Narebski
2006-04-25 19:00                         ` Junio C Hamano
2006-04-25 19:09                           ` Linus Torvalds
2006-04-25 18:34                       ` Jakub Narebski
2006-04-25 23:18     ` Sam Vilain
2006-04-25 15:10 ` [RFC] [PATCH 0/5] Implement 'prior' commit object links Linus Torvalds

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=7vwtde2q1z.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=sam.vilain@catalyst.net.nz \
    /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).