From: Phillip Wood Date: Tue, 23 Jun 2026 15:53:55 GMT Subject: [PATCH v4 0/2] status: improve rebase todo list parsing Message-ID: In-Reply-To: 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 is 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. This series fixes that. The first patch factors out the sequencer code that parses the command names in the todo list. The second patch uses that function in "git status" to parse the command names so that it knows whether the line may contain "-C" and whether there is an object id that should be abbreviated. Thanks to Junio for his comments on V3. Changes since V3: Patch 2 - Style fix for cast. Changes since V2: Patch 2 - Check if the object name is a label before trying to abbreviate it. Note that a number of the CI jobs fail[1] due to the rather old base, but a test merge of this branch with "master" passes[2] [1] https://github.com/phillipwood/git/actions/runs/27906115900 [2] https://github.com/phillipwood/git/actions/runs/27908204055 Changes since V1: Patch 1 - Expanded commit message and added a code comment. Patch 2 - Fixed some typos, added a code comment and clarified that -Wswitch is included by -Wall. Base-Commit: 8c9303b1ffae5b745d1b0a1f98330cf7944d8db0 Published-As: https://github.com/phillipwood/git/releases/tag/pw%2Fimprove-status-todo-list-parsing%2Fv4 View-Changes-At: https://github.com/phillipwood/git/compare/8c9303b1f...90c4659b8 Fetch-It-Via: git fetch https://github.com/phillipwood/git pw/improve-status-todo-list-parsing/v4 Phillip Wood (2): sequencer: factor out parsing of todo commands status: improve rebase todo list parsing sequencer.c | 45 ++++++++---- sequencer.h | 8 +++ t/t7512-status-help.sh | 74 +++++++++++++------- wt-status.c | 154 +++++++++++++++++++++++++++++++++-------- 4 files changed, 213 insertions(+), 68 deletions(-) Range-diff against v3: 1: d27dddff931 = 1: d27dddff931 sequencer: factor out parsing of todo commands 2: b3514e9b1c9 ! 2: 90c4659b87e status: improve rebase todo list parsing @@ wt-status.c: static int split_commit_in_progress(struct wt_status *s) + struct strbuf scratch = STRBUF_INIT; + char *p = line->buf; + -+ if (!sequencer_parse_todo_command((const char**)&p, &cmd)) ++ if (!sequencer_parse_todo_command((const char **)&p, &cmd)) + return true; /* keep invalid lines */ + + switch (cmd) { -- 2.54.0.200.gfd8d68259e3