Re: [PATCH 2/3] rebase: accept -<number> as another way of saying HEAD~<number>
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Mar 3, 2014, 22:39 UTC
- Message-ID
- <vpqlhwqc3g0.fsf@anie.imag.fr>
- In-Reply-To
- <xmqqha7fnebn.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> Michael Haggerty <mhagger@alum.mit.edu> writes:
>>
>>> Or perhaps "-NUM" should fail with an error message if any of the last
>>> NUM commits are merges. In that restricted scenario (which probably
>>> accounts for 99% of rebases), "-NUM" is equivalent to "HEAD~NUM".
>>
>> Makes sense to me. So, -NUM would actually mean "rebase the last NUM
>> commits" (as well as being an alias for HEAD~NUM), but would fail when
>> it does not make sense (with an error message explaining the situation
>> and pointing the user to HEAD~N if this is what he wanted).
>>
>> This would actually be a feature for me: I often want to rebase "recent
>> enough" history, and when my @{upstream} isn't well positionned,...
>
> Could you elaborate on this a bit? What does "isn't well
> positioned" mean?The most common case is when @{upstream} is not positionned at all, because I'm on a temporary branch on which I did not configure it. The other case is when I did a manual merge of a branch other than upstream.
As I said in another message, there would probably be cleaner solutions, but the trial and error one does not work that bad.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/