threads / discuss / 63197

error: could not parse 'Drop' when rebasing

Subject: error: could not parse 'Drop' when rebasing

## tl;dr

3 messages between Mar 26, 2025 and Mar 26, 2025.

replies: 2people: 2as markdown or json

Jarno Suni· Mar 26, 2025, 07:17 UTC · lore
git version 2.43.0

$ git rebase --edit-todo error: could not parse 'Drop' error: invalid line 1: r Drop option --figure-soname-bumps error: could not parse 'Drop' error: invalid line 1: p Drop option --figure-soname-bumps You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'. Or you can abort the rebase with 'git rebase --abort'.

"Drop option --figure-soname-bumps" is the commit message. Git doesn't seem to accept any command for the commit. First I tried command d.

Workaround: I did `git rebase --abort`. Started new rebase, used r command for the commit to rename it to not have "Drop" as first word. After that I can rebase again and use d command for the commit.

-- 
Jarno Suni
Phillip Wood· Mar 26, 2025, 10:20 UTC · re: Jarno Suni · lore

Re: error: could not parse 'Drop' when rebasing

Hi Jarno
On 26/03/2025 07:17, Jarno Suni wrote:
Show 5 quoted lines
> git version 2.43.0
> 
> $ git rebase --edit-todo
> error: could not parse 'Drop'
> error: invalid line 1: r Drop option --figure-soname-bumps

It appears that the object id for the commit got deleted when the command was changed from "pick" to "reword" and so git does not know which commit this line is referring to. The commit subject is there for the benefit of the user not for git - after all many commits could share the same subject.

Best Wishes
Phillip
  > error: could not parse 'Drop'
Show 13 quoted lines
> error: invalid line 1: p Drop option --figure-soname-bumps
> You can fix this with 'git rebase --edit-todo' and then run 'git
> rebase --continue'.
> Or you can abort the rebase with 'git rebase --abort'.
> 
> "Drop option --figure-soname-bumps" is the commit message.
> Git doesn't seem to accept any command for the commit. First I tried command d.
> 
> Workaround:
> I did `git rebase --abort`. Started new rebase, used r command for the
> commit to rename it to not have "Drop" as first word. After that I can
> rebase again and use d command for the commit.
> 
Phillip Wood· Mar 26, 2025, 15:12 UTC · lore

Re: error: could not parse 'Drop' when rebasing

Hi Jarno
On 26/03/2025 10:43, Jarno Suni wrote:
Show 13 quoted lines
> On Wed, Mar 26, 2025 at 12:20 PM Phillip Wood <phillip.wood123@gmail.com> wrote:
> 
>> It appears that the object id for the commit got deleted when the
>> command was changed from "pick" to "reword" and so git does not know
>> which commit this line is referring to. The commit subject is there for
>> the benefit of the user not for git - after all many commits could share
>> the same subject.
> 
> The error appeared first time in the rebase after I changed the command
> from pick to drop (or d for short.) I had never used d  before but I have
> used e many times without an issue. Even the d command worked after I
> edited the commit message title (in new rebase). So I suspect that there
> is something in wrong in parsing d command.

I'm not sure that explains why the commit object id is missing. If you are able to reproduce this bug and show the edited todo-list with the drop commands and the errors produced by that todo-list that would be very helpful. Without that it is hard to tell what's happening here.

Thanks
Phillip

← back to recent threads