git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Git List" <git@vger.kernel.org>,
	"Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>,
	"Jeff King" <peff@peff.net>,
	"Philip Oakley" <philipoakley@iee.org>
Subject: Re: [PATCH 3/3] rebase: new convenient option to edit a single commit
Date: Mon, 03 Mar 2014 11:10:43 +0100	[thread overview]
Message-ID: <53145523.7020900@alum.mit.edu> (raw)
In-Reply-To: <CAPig+cS8XRf8LzajSJL7LVxVKb_cqLviwSimYyYXRWL46dh9QA@mail.gmail.com>

On 03/02/2014 10:09 AM, Eric Sunshine wrote:
> On Sun, Mar 2, 2014 at 4:04 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> On Sat, Mar 1, 2014 at 9:53 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
>>> "git rebase -e XYZ" is basically the same as
>>>
>>> EDITOR="sed -i '1s/pick XYZ/edit XYZ/' $@" \
>>> git rebase -i XYZ^
>>>
>>> In English, it prepares the todo list for you to edit only commit XYZ
>>> to save your time. The time saving is only significant when you edit a
>>> lot of commits separately.
>>
>> Should this accept multiple -e arguments? Based upon the above
>> justification, it sounds like it should, and I think that would be the
>> intuitive expectation (at least for me).
>>
>> The current implementation, however, is broken with multiple -e arguments. With:
>>
>>     git rebase -i -e older -e newer
>>
>> 'newer' is ignored entirely. However, with:
>>
>>     git rebase -i -e newer -e older
>>
>> it errors out when rewriting the todo list:
>>
>>     "expected to find 'edit older' line but did not"
>>
>> An implementation supporting multiple -e arguments would need to
>> ensure that the todo list extends to the "oldest" rev specified by any
>> -e argument.
> 
> Of course, I'm misreading and abusing the intention of -e as if it is
> "-e <arg>".

I think that your misreading is more consistent than the feature as
implemented.

    git rebase -e OLDER

does not mean "do 'git rebase -i OLDER' and oh, by the way, also set up
commit OLDER to be edited".  It means "do 'git rebase -i OLDER^' ..."
(note: "OLDER^" and not "OLDER").  So it is confusing to think as "-e"
as a modifier on an otherwise normal "git rebase -i" invocation.
Rather, it seems to me that "-e" and "-i" should be mutually exclusive
(and consider it an implementation detail that the former is implemented
using the latter).

And if that is our point of view, then is perfectly logical to allow it
to be specified multiple times.  OTOH there is no reason that v1 has to
allow multiple "-e", as long as it properly rejects that usage.

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/

  reply	other threads:[~2014-03-03 10:10 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
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 [this message]
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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53145523.7020900@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=philipoakley@iee.org \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).