John Keeping <j...@keeping.me.uk> writes:

> Last time this came up [1], there was some discussion about moving the
> added block of code to affect upstreams given on the command line as
> well as when the upstream is discovered from the config.  Having tried
> that, it has some more fallout on the test suite than I like; this
> pattern ends up dropping the tip commit of "side" because it's in the
> reflog of "master":
>
>       # start on "master"
>       git branch side &&
>       git reset --hard HEAD^ &&
>       git checkout side &&
>       git rebase master

We shouldn't do anything funky using the reflog when an explicit
commit object name was given like in the last step above, I think.
Automation to help human end-users is good, but at some level there
must be a mechanism to reliably reproduce the same result given the
same precondition for those who implement such automation, and I do
not think it is a good idea to force scripts to say

        git rebase --do-not-look-at-reflog master

in order to do so.

> I wonder if it would be better to add a --fork-point argument to
> git-rebase and default it to true when no upstream is given on the
> command line.

I am not sure what you exactly mean by "when no upstream is given",
though.  Do you mean

        git rebase <no other arguments>

which we interpret as "rebase the current branch on @{u}", and it
should behave as if the command was run like so:

        git rebase --fork-point @{u}

If that is what you suggest, I certainly can buy that.  Those who
want to disable the automation can explicitly say

        git rebase @{u}

and rebase the current exactly on top of the named commit (e.g. the
current value of refs/remotes/origin/master or whatever remote-tracking
branch you forked from).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to