]> git.ipfire.org Git - thirdparty/git.git/commit
status: improve rebase todo list parsing
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Fri, 1 May 2026 15:16:39 +0000 (16:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 May 2026 22:00:51 +0000 (07:00 +0900)
commit07596ce695ba88d7845463b47f2019a3bee7749d
treefbadd99bdaa7abb2b14271c8c0413a8d83d91ed1
parentbe1fd7de6291a86dab983210e55e70dd6fb48579
status: improve rebase todo list parsing

When there is rebase in progress "git status" displays the last couple
of completed and the next couple of pending commands from the todo
list. When it does this it tries to abbreviate the object ids of
the commits to be picked. Unfortunately it does not abbreviate the
object ids when the line starts with "fixup -C" or "merge -C". It
also mistakenly replaces the refname in "reset main" and "update-ref
refs/heads/main" with the object id that the ref points to. Use
the function added in the last commit to parse the command name and
only try to abbreviate the argument for commands that take an object
id. When trying to abbreviate an object id, only replace the object
name if it starts with the abbreviated object id so that labels or
branch names that contain only hex digits are left unchanged.

Comments are now processed after stripping any leading
whitespace from the line. This matches what the sequencer does in
parse_insn_line(). The existing test cases are updated to test a
wider variety of commands. Only the pending commands in the tests
are changed to avoid removing existing coverage.

Helped-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7512-status-help.sh
wt-status.c