RFC: Renaming "git rebase --onto"

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

RFC: Renaming "git rebase --onto"

From: Jonathon Mah <hidden>
Date: 2016-06-15 23:04:19

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

Re: RFC: Renaming "git rebase --onto"

From: Jonathan Nieder <hidden>
Date: 2016-06-15 23:04:19

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

Re: RFC: Renaming "git rebase --onto"

From: Max Kirillov <hidden>
Date: 2016-06-15 23:04:19

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help