* RFC: Renaming "git rebase --onto"
@ 2015-03-30 20:49 Jonathon Mah
2015-03-30 21:03 ` Jonathan Nieder
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jonathon Mah @ 2015-03-30 20:49 UTC (permalink / raw)
To: git, Junio C Hamano
During a few years of discussing git operations with colleagues, I’ve found the “git rebase --onto” operation particularly ambiguous. The reason is that I always describe a rebase operation as “onto” something else (because of the English phrase “A is based on B”). For example:
$ git rebase new-base # “Rebase HEAD onto new-base (from merge-base of HEAD and new-base)"
$ git rebase new-base my-branch # “Rebase my-branch onto new-base (from merge-base of my-branch and new-base)”
Personally, I understand “git-rebase --onto new-base old-base” as meaning “rebase from old-base to new-base”. Some prepositions that might make this clearer:
$ git rebase --from old-base new-base # “Rebase HEAD onto new-base, from old-base"
$ git rebase --after old-base new-base # “Rebase commits on HEAD after old-base HEAD onto new-base"
$ git rebase --excluding old-base new-base # “Rebase HEAD onto new-base, excluding commit old-base (and its parents)"
In all cases this would change the order of the arguments compared to --onto, making it more consistent with the no-option rebase.
What do others think? Is my view of “onto” common or unusual?
Jonathon Mah
me@JonathonMah.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: RFC: Renaming "git rebase --onto"
2015-03-30 20:49 RFC: Renaming "git rebase --onto" Jonathon Mah
@ 2015-03-30 21:03 ` Jonathan Nieder
2015-03-30 21:12 ` Junio C Hamano
2015-03-30 21:53 ` Max Kirillov
2 siblings, 0 replies; 5+ messages in thread
From: Jonathan Nieder @ 2015-03-30 21:03 UTC (permalink / raw)
To: Jonathon Mah; +Cc: git, Junio C Hamano
Jonathon Mah wrote:
> Personally, I understand “git-rebase --onto new-base old-base” as
> meaning “rebase from old-base to new-base”. Some prepositions that
> might make this clearer:
>
> $ git rebase --from old-base new-base # “Rebase HEAD onto new-base, from old-base"
Would having an option name for the old-base argument help?
For example:
git rebase --old-base=<old-base> --onto=<new-base> <branch>
?
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: RFC: Renaming "git rebase --onto"
2015-03-30 20:49 RFC: Renaming "git rebase --onto" Jonathon Mah
2015-03-30 21:03 ` Jonathan Nieder
@ 2015-03-30 21:12 ` Junio C Hamano
2015-04-02 16:40 ` Michael J Gruber
2015-03-30 21:53 ` Max Kirillov
2 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2015-03-30 21:12 UTC (permalink / raw)
To: Jonathon Mah; +Cc: git
Jonathon Mah <me@JonathonMah.com> writes:
> During a few years of discussing git operations with colleagues, I’ve
> found the “git rebase --onto” operation particularly ambiguous. The
> reason is that I always describe a rebase operation as “onto”
> something else (because of the English phrase “A is based on
> B”). For example:
>
> $ git rebase new-base # “Rebase HEAD onto new-base (from merge-base of HEAD and new-base)"
> $ git rebase new-base my-branch # “Rebase my-branch onto new-base
> (from merge-base of my-branch and new-base)”
>
> Personally, I understand “git-rebase --onto new-base old-base” as
> meaning “rebase from old-base to new-base”. Some prepositions that
> might make this clearer:
>
> $ git rebase --from old-base new-base # “Rebase HEAD onto new-base, from old-base"
> $ git rebase --after old-base new-base # “Rebase commits on HEAD
> after old-base HEAD onto new-base"
> $ git rebase --excluding old-base new-base # “Rebase HEAD onto
> new-base, excluding commit old-base (and its parents)"
>
> In all cases this would change the order of the arguments compared to
> --onto, making it more consistent with the no-option rebase.
The bog-standard rebase is
git rebase U
which rebases the current history that has diverged from the history
leading to U on to U.
Or
git rebase U BRANCH
which rebases BRANCH that has diverged from the history leading to U
on to U. In both of these invocations, these arguments define which
part of the local history is replayed.
Now,
git rebase [--onto O] $other_args
is just a way to say $other_args still define which part of the
local history is replayed, but you are replaying on something that
is different from the usual default case (which is U).
Which feels very consistent between the cases with and without the
extra --onto parameter, at least to me. Hence, if you change order
in any way, I would think you would break the existing consistency.
I suspect that this thread is a symptom of something unrelated,
though. There might be something wrong in your workflow if you find
yourself using --onto too often, for example, and that may be the
issue we should be focusing on, not on how "rebase --onto" is
spelled.
> What do others think? Is my view of “onto” common or unusual?
"common or unusual" is a question we cannot answer, I would say.
People who are used to "rebase" may be so used to it that it might
feel natural to them but cannot tell if that is only because they
already know how "rebase" spells its arguments, or they would still
find it natural if they did not know anything about "rebase".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: RFC: Renaming "git rebase --onto"
2015-03-30 20:49 RFC: Renaming "git rebase --onto" Jonathon Mah
2015-03-30 21:03 ` Jonathan Nieder
2015-03-30 21:12 ` Junio C Hamano
@ 2015-03-30 21:53 ` Max Kirillov
2 siblings, 0 replies; 5+ messages in thread
From: Max Kirillov @ 2015-03-30 21:53 UTC (permalink / raw)
To: Jonathon Mah; +Cc: git, Junio C Hamano
On Mon, Mar 30, 2015 at 01:49:34PM -0700, Jonathon Mah wrote:
> During a few years of discussing git operations with colleagues, I’ve found the “git rebase --onto” operation particularly ambiguous. The reason is that I always describe a rebase operation as “onto” something else (because of the English phrase “A is based on B”). For example:
>
> $ git rebase new-base # “Rebase HEAD onto new-base (from merge-base of HEAD and new-base)"
> $ git rebase new-base my-branch # “Rebase my-branch onto new-base (from merge-base of my-branch and new-base)”
>
> Personally, I understand “git-rebase --onto new-base old-base” as meaning “rebase from old-base to new-base”. Some prepositions that might make this clearer:
>
> $ git rebase --from old-base new-base # “Rebase HEAD onto new-base, from old-base"
> $ git rebase --after old-base new-base # “Rebase commits on HEAD after old-base HEAD onto new-base"
> $ git rebase --excluding old-base new-base # “Rebase HEAD onto new-base, excluding commit old-base (and its parents)"
>
> In all cases this would change the order of the arguments compared to --onto, making it more consistent with the no-option rebase.
>
> What do others think? Is my view of “onto” common or unusual?
I have never liked the --onto syntax also. It's not only
ugly but still fails to cover some needs. So in my, you know,
clone of rebase I have made completely different syntax.
You can take a look at it here:
https://github.com/max630/git-rebase2/#usage
I just copy the line here, without descriptions:
git rebase2 [options] <dest> [[<source_from>]..[<through1>..<through2>]..[<source_to>]] [<target>]
--
Max
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: RFC: Renaming "git rebase --onto"
2015-03-30 21:12 ` Junio C Hamano
@ 2015-04-02 16:40 ` Michael J Gruber
0 siblings, 0 replies; 5+ messages in thread
From: Michael J Gruber @ 2015-04-02 16:40 UTC (permalink / raw)
To: Junio C Hamano, Jonathon Mah; +Cc: git, Jonathan Nieder, Max Kirillov
Junio C Hamano venit, vidit, dixit 30.03.2015 23:12:
> Jonathon Mah <me@JonathonMah.com> writes:
>
>> During a few years of discussing git operations with colleagues, I’ve
>> found the “git rebase --onto” operation particularly ambiguous. The
>> reason is that I always describe a rebase operation as “onto”
>> something else (because of the English phrase “A is based on
>> B”). For example:
>>
>> $ git rebase new-base # “Rebase HEAD onto new-base (from merge-base of HEAD and new-base)"
>> $ git rebase new-base my-branch # “Rebase my-branch onto new-base
>> (from merge-base of my-branch and new-base)”
>>
>> Personally, I understand “git-rebase --onto new-base old-base” as
>> meaning “rebase from old-base to new-base”. Some prepositions that
>> might make this clearer:
>>
>> $ git rebase --from old-base new-base # “Rebase HEAD onto new-base, from old-base"
>> $ git rebase --after old-base new-base # “Rebase commits on HEAD
>> after old-base HEAD onto new-base"
>> $ git rebase --excluding old-base new-base # “Rebase HEAD onto
>> new-base, excluding commit old-base (and its parents)"
>>
>> In all cases this would change the order of the arguments compared to
>> --onto, making it more consistent with the no-option rebase.
>
> The bog-standard rebase is
>
> git rebase U
>
> which rebases the current history that has diverged from the history
> leading to U on to U.
>
> Or
>
> git rebase U BRANCH
>
> which rebases BRANCH that has diverged from the history leading to U
> on to U. In both of these invocations, these arguments define which
> part of the local history is replayed.
>
> Now,
>
> git rebase [--onto O] $other_args
>
> is just a way to say $other_args still define which part of the
> local history is replayed, but you are replaying on something that
> is different from the usual default case (which is U).
>
> Which feels very consistent between the cases with and without the
> extra --onto parameter, at least to me. Hence, if you change order
> in any way, I would think you would break the existing consistency.
>
> I suspect that this thread is a symptom of something unrelated,
> though. There might be something wrong in your workflow if you find
> yourself using --onto too often, for example, and that may be the
> issue we should be focusing on, not on how "rebase --onto" is
> spelled.
>
>> What do others think? Is my view of “onto” common or unusual?
>
> "common or unusual" is a question we cannot answer, I would say.
> People who are used to "rebase" may be so used to it that it might
> feel natural to them but cannot tell if that is only because they
> already know how "rebase" spells its arguments, or they would still
> find it natural if they did not know anything about "rebase".
>
The basic confusion comes from the natural desire to read a command as a
sentence, and the lack of the rebase UI in that respect:
"git rebase foo" does not "rebase foo"!
"git rebase foo bar" does not "rebase foo" either!
I think it's a UI design mistake that comes from making the common
use-case as short as possible.
In the invocations above, "foo" is neither the ref that is being rebased
nor a rev notation for the affected commits. That would have been foo..
or ^foo.
I seem to recall that we've talked about range notations for rebase.
Maybe we can start accepting them, and once we start teaching "git
rebase ^foo" or "git rebase foo.." it will become clearer that that
argument is not the ref being rebased, but a description of the commits
being rebased. And then it would be natural to talk about "onto foo" for
these cases, as well as leave the "--onto" argument named the way it is
(since it defaults to foo, or rather the fork-point).
Michael
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-04-02 16:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 20:49 RFC: Renaming "git rebase --onto" Jonathon Mah
2015-03-30 21:03 ` Jonathan Nieder
2015-03-30 21:12 ` Junio C Hamano
2015-04-02 16:40 ` Michael J Gruber
2015-03-30 21:53 ` Max Kirillov
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).