git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Price <price@MIT.EDU>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Fwd: [PATCH 0/6] rebase: command "ref" and options --rewrite-{refs,heads,tags}
Date: Tue, 28 Jun 2011 06:47:58 -0400	[thread overview]
Message-ID: <20110628104758.GS5771@dr-wily.mit.edu> (raw)
In-Reply-To: <7vhb7bxgt9.fsf@alter.siamese.dyndns.org>

On Mon, Jun 27, 2011 at 11:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Thanks for a re-roll.
> 
> I notice that this does not address the "side branch" issue raised during
> the original discussion. I do agree with Michael
> 
>  http://thread.gmane.org/gmane.comp.version-control.git/135601/focus=135617
> 
> that having some commits on these part$N side branches is far more common
> use case that would benefit from a "rewrite together" feature like this,
> than moving part$N side branches that just mark points in the topic
> without doing anything on their own and makes me doubt if doing only the
> parts that can sanely done within the limitation of the current rebase-i
> implementation like this series does adds much value to the system [*1*].

I would also like to support that use case.  In my personal
experience, the case where the part$N are ancestors of the topic has
actually been the more common case; typically it's that part1 is some
topic, and then part2 is a further topic that depends on the changes
in part1, so naturally it goes directly on top of it.  So I'd be
pleased to get the functionality of the present series in, even before
supporting the more general case.

I agree with your footnote -- the more general case will require a
more powerful sequencer to support properly.  And now I see that
Ramkumar Ramachandra is making progress on such a thing right now!
That's great news -- this is a project that has been attempted at
least four times, by five people (including me), in the last three
years.  I hope to see this round make it in -- I was actually thinking
about returning to the problem after seeing this series through, but I
would be glad to see Ram beat me to it.

When the more powerful sequencer comes along, it may be necessary to
rewrite some of this code in C (IIUC how the new sequencer will work),
but that shouldn't be hard, and is probably easier starting from a
shell version than from scratch.  Other than that, this code should go
in smoothly as the main ingredient, other than the sequencer itself,
needed for the general "rewrite side branches" feature.  With that and
because this series is independently useful, my suggestion would be to
merge it when it's ready in itself, without waiting for the sequencer.



> It would be nice to have a clear definition of what _should_ happen in
> this case, and a test that makes sure that that is the behaviour we get.
> 
> Starting from this topology
> 
>          1   2   topic
>  A---X---Y---Z---W
>   \
>    B
> 
> where the change going from A to B is an equilvalent to the change going
> from Y to Z, a rebase of A..W would reproduce this topology:
> 
> 
>          1   2   topic
>  A---X---Y---Z---W
>   \
>    B---X'--Y'--W'
>            1'  topic'
> 
> What should heppen to ref2? Should it be deleted? Should it point at Y'?

I would have it point at Y'.  That's what would happen if we just said
"git rebase B ref2" (or threw in --rewrite-heads to pull along ref1),
and I think it makes the most sense to be consistent.

This consistency also means we can think of the reset that rebase
performs when it finishes as equivalent to an implicit
"ref refs/heads/topic" command at the end of the TODO file, which I
wouldn't point out in explaining to a beginner but I think is a nice
property for "ref" to have.

I'll add a test for this scenario.

Greg

  parent reply	other threads:[~2011-06-28 11:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27  0:16 [PATCH 0/6] rebase: command "ref" and options --rewrite-{refs,heads,tags} Greg Price
2009-10-10  2:52 ` [PATCH 1/6] rebase -i: Add the "ref" command Greg Price
2011-06-27 18:46   ` Junio C Hamano
2011-06-28 11:15     ` Greg Price
2009-11-18 23:22 ` [PATCH 2/6] pretty: Add %D for script-friendly decoration Greg Price
2011-06-27 19:07   ` Junio C Hamano
2009-11-18 23:51 ` [PATCH 4/6] rebase: --rewrite-{refs,heads,tags} to pull refs along with branch Greg Price
2011-06-27 16:11   ` Phil Hord
2011-06-28 11:19     ` Greg Price
2010-01-07 23:08 ` [PATCH 3/6] for-each-ref: --stdin to match specified refs against pattern Greg Price
2010-01-25  2:26 ` [PATCH 5/6] t/lib-rebase.sh: pass through ref commands Greg Price
2010-01-25  2:28 ` [PATCH 6/6] rebase --rewrite-refs: tests Greg Price
2011-06-27 16:07   ` Phil Hord
2011-06-28 11:22     ` Greg Price
2011-06-27 21:02   ` Junio C Hamano
2011-06-28 11:20     ` Greg Price
2011-06-27 18:36 ` [PATCH 0/6] rebase: command "ref" and options --rewrite-{refs,heads,tags} Junio C Hamano
     [not found]   ` <BANLkTinDFYsw7-N=_Ex8i42So_0LzVAWvA@mail.gmail.com>
2011-06-28 10:47     ` Greg Price [this message]
2011-06-28 13:17       ` Greg Price
2011-06-30  4:25         ` Ramkumar Ramachandra
2011-08-03 13:32       ` Fwd: " Sverre Rabbelier
2011-08-03 22:31         ` Greg Price
2011-06-27 21:23 ` Junio C Hamano
     [not found]   ` <BANLkTi=Akib+7R7D2GEwV8dOTQ1vsqgfxA@mail.gmail.com>
2011-06-28 10:56     ` Fwd: " Greg Price

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=20110628104758.GS5771@dr-wily.mit.edu \
    --to=price@mit.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).