From: David Kastrup <dak@gnu•org>
To: Duy Nguyen <pclouds@gmail•com>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>,
Michael Haggerty <mhagger@alum•mit.edu>,
Eric Sunshine <sunshine@sunshineco•com>,
Git List <git@vger•kernel.org>, Jeff King <peff@peff•net>,
Philip Oakley <philipoakley@iee•org>
Subject: Re: [PATCH 2/3] rebase: accept -<number> as another way of saying HEAD~<number>
Date: Mon, 03 Mar 2014 11:11:30 +0100 [thread overview]
Message-ID: <87y50rlhgt.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <CACsJy8CPhTQxpnY70PxD9zFSipaJCTQPBsmReD8E9tmEgsvTRg@mail.gmail.com> (Duy Nguyen's message of "Mon, 3 Mar 2014 17:04:27 +0700")
Duy Nguyen <pclouds@gmail•com> writes:
> On Mon, Mar 3, 2014 at 4:37 PM, Matthieu Moy
> <Matthieu.Moy@grenoble-inp•fr> wrote:
>> 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).
>
> Agreed, but..
>
>> This would actually be a feature for me: I often want to rebase "recent
>> enough" history, and when my @{upstream} isn't well positionned, I
>> randomly type HEAD~N without remembering what N should be. When N is too
>> small, the rebase doesn't reach the interesting commit, and when N is
>> too big, it reaches a merge commit and I get a bunch of commits I'm not
>> allowed to edit in my todo-list. Then I have to abort the commit
>> manually. With -N failing on merge commits, the rebase would abort
>> itself automatically.
>
> would "git rebase -i --fork-point" be what you need instead? It's a
> new thing, but may be what we actually should use, not this -NUM..
-0 might be a good mnemonic for --fork-point, though.
Of course, when using --preserve-merges explicitly it would appear that
-NUM should not error out.
--
David Kastrup
next prev parent reply other threads:[~2014-03-03 10:35 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-27 13:01 [PATCH/RFC] rebase: new convenient option to edit a single commit Nguyễn Thái Ngọc Duy
2014-02-27 13:52 ` Matthieu Moy
2014-02-28 6:58 ` Jeff King
2014-02-28 7:34 ` Duy Nguyen
2014-02-28 7:38 ` Jeff King
2014-02-28 17:14 ` Philip Oakley
2014-03-02 2:53 ` [PATCH 0/3] rebase's convenient options Nguyễn Thái Ngọc Duy
2014-03-02 2:53 ` [PATCH 1/3] rev-parse: support OPT_NUMBER_CALLBACK in --parseopt Nguyễn Thái Ngọc Duy
2014-03-04 18:28 ` Junio C Hamano
2014-03-02 2:53 ` [PATCH 2/3] rebase: accept -<number> as another way of saying HEAD~<number> Nguyễn Thái Ngọc Duy
2014-03-02 8:37 ` Eric Sunshine
2014-03-02 8:45 ` Duy Nguyen
2014-03-02 8:53 ` Eric Sunshine
2014-03-02 8:55 ` Eric Sunshine
2014-03-02 15:55 ` Matthieu Moy
2014-03-03 9:16 ` Michael Haggerty
2014-03-03 9:37 ` Matthieu Moy
2014-03-03 10:04 ` Duy Nguyen
2014-03-03 10:11 ` David Kastrup [this message]
2014-03-03 10:12 ` Matthieu Moy
2014-03-03 10:13 ` Jeff King
2014-03-03 21:48 ` Junio C Hamano
2014-03-03 22:39 ` Matthieu Moy
2014-03-03 21:44 ` Junio C Hamano
2014-03-02 2:53 ` [PATCH 3/3] rebase: new convenient option to edit a single commit Nguyễn Thái Ngọc Duy
2014-03-02 9:04 ` Eric Sunshine
2014-03-02 9:09 ` Eric Sunshine
2014-03-03 10:10 ` Michael Haggerty
2014-03-03 10:15 ` Duy Nguyen
2014-03-03 10:37 ` David Kastrup
2014-03-03 20:28 ` Eric Sunshine
2014-03-04 2:08 ` Duy Nguyen
2014-03-04 8:59 ` Michael Haggerty
2014-03-04 10:24 ` Duy Nguyen
2014-03-04 13:11 ` Michael Haggerty
2014-03-04 18:37 ` Junio C Hamano
2014-03-09 2:49 ` [PATCH/RFC] rebase: new convenient option to edit/reword/delete " Nguyễn Thái Ngọc Duy
2014-03-09 16:30 ` Matthieu Moy
2014-03-10 8:30 ` Michael Haggerty
2014-03-10 8:41 ` Matthieu Moy
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=87y50rlhgt.fsf@fencepost.gnu.org \
--to=dak@gnu$(echo .)org \
--cc=Matthieu.Moy@grenoble-inp$(echo .)fr \
--cc=git@vger$(echo .)kernel.org \
--cc=mhagger@alum$(echo .)mit.edu \
--cc=pclouds@gmail$(echo .)com \
--cc=peff@peff$(echo .)net \
--cc=philipoakley@iee$(echo .)org \
--cc=sunshine@sunshineco$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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