git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] rebase: new convenient option to edit a single commit

From
Duy Nguyen <pclouds@gmail.com>
Date
Mar 3, 2014, 10:15 UTC
Message-ID
<CACsJy8DQz-74QJCOq8O7pZG3BwsyzoLhayxmALv6LjaFYWP4YQ@mail.gmail.com>
In-Reply-To
<53145523.7020900@alum.mit.edu>
On Mon, Mar 3, 2014 at 5:10 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 50 quoted lines
> 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.

Logically, yes. Practically, no. If you have to put multiple -e and some hashes in one line, wouldn't editing to-do list in your favorite editor be faster?

> OTOH there is no reason that v1 has to
> allow multiple "-e", as long as it properly rejects that usage.
-- 
Duy
Previous: Michael HaggertyNext: David Kastrup
Message 29 of 40 in “rebase: new convenient option to edit a single commit”
  1. rebase: new convenient option to edit a single commitNguyễn Thái Ngọc Duy, Feb 27, 2014
  2. Matthieu MoyFeb 27, 2014
  3. Jeff KingFeb 28, 2014
  4. Duy NguyenFeb 28, 2014
  5. Jeff KingFeb 28, 2014
  6. Philip OakleyFeb 28, 2014
  7. 0/3 rebase's convenient optionsNguyễn Thái Ngọc Duy, Mar 2, 2014
  8. 1/3 rev-parse: support OPT_NUMBER_CALLBACK in --parseoptNguyễn Thái Ngọc Duy, Mar 2, 2014
  9. Junio C HamanoMar 4, 2014
  10. 2/3 rebase: accept -<number> as another way of saying HEAD~<number>Nguyễn Thái Ngọc Duy, Mar 2, 2014
  11. Eric SunshineMar 2, 2014
  12. Duy NguyenMar 2, 2014
  13. Eric SunshineMar 2, 2014
  14. Eric SunshineMar 2, 2014
  15. Matthieu MoyMar 2, 2014
  16. Michael HaggertyMar 3, 2014
  17. Matthieu MoyMar 3, 2014
  18. Duy NguyenMar 3, 2014
  19. David KastrupMar 3, 2014
  20. Matthieu MoyMar 3, 2014
  21. Jeff KingMar 3, 2014
  22. Junio C HamanoMar 3, 2014
  23. Matthieu MoyMar 3, 2014
  24. Junio C HamanoMar 3, 2014
  25. 3/3 rebase: new convenient option to edit a single commitNguyễn Thái Ngọc Duy, Mar 2, 2014
  26. Eric SunshineMar 2, 2014
  27. Eric SunshineMar 2, 2014
  28. Michael HaggertyMar 3, 2014
  29. Duy NguyenMar 3, 2014
  30. David KastrupMar 3, 2014
  31. Eric SunshineMar 3, 2014
  32. Duy NguyenMar 4, 2014
  33. Michael HaggertyMar 4, 2014
  34. Duy NguyenMar 4, 2014
  35. Michael HaggertyMar 4, 2014
  36. Junio C HamanoMar 4, 2014
  37. rebase: new convenient option to edit/reword/delete a single commitNguyễn Thái Ngọc Duy, Mar 9, 2014
  38. Matthieu MoyMar 9, 2014
  39. Michael HaggertyMar 10, 2014
  40. Matthieu MoyMar 10, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.