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

Re: [PATCH v2] status: fix branch shown when not only bisecting

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 16, 2023, 22:08 UTC
Message-ID
<xmqqil76kyov.fsf@gitster.g>
In-Reply-To
<2e24ca9b-9c5f-f4df-b9f8-6574a714dfb2@gmail.com>
Rubén Justo <rjusto@gmail.com> writes:
Show 46 quoted lines
> In 83c750acde (wt-status.*: better advice for git status added,
> 2012-06-05), git-status received new informative messages to describe
> the ongoing work in a worktree.
>
> These messages were enhanced in 0722c805d6 (status: show the branch name
> if possible in in-progress info, 2013-02-03), to show, if possible, the
> branch where the operation was initiated.
>
> Since then, we show incorrect information when several operations are in
> progress and one of them is bisect:
>
>    $ git checkout -b foo
>    $ GIT_SEQUENCE_EDITOR='echo break >' git rebase -i HEAD~
>    $ git checkout -b bar
>    $ git bisect start
>    $ git status
>    ...
>
>    You are currently editing a commit while rebasing branch 'bar' on '...'.
>
>    You are currently bisecting, started from branch 'bar'.
>
>    ...
>
> Note that we erroneously say "while rebasing branch 'bar'" when we
> should be referring to "foo".
>
> This must have gone unnoticed for so long because it must be unusual to
> start a bisection while another operation is in progress.  And even less
> usual to involve different branches.
>
> It caught my attention reviewing a leak introduced in 8b87cfd000
> (wt-status: move strbuf into read_and_strip_branch(), 2013-03-16).
>
> A simple change to deal with this situation can be to record in struct
> wt_status_state, the branch where the bisect starts separately from the
> branch related to other operations.
>
> Let's do it and so we'll be able to display correct information and
> we'll avoid the leak as well.
>
> Signed-off-by: Rubén Justo <rjusto@gmail.com>
>
> ---
>
> Let's try again.

Sigh... nobody seems to be interested in making sure this correctly improves the system X-<.

After a quick re-read, I didn't find anything glaringly wrong, so let's see if anybody complains after the patch gets merged to 'next'.

Thanks.
Previous: Rubén Justo
Message 7 of 7 in “status: fix branch shown when not only bisecting”
  1. status: fix branch shown when not only bisectingRubén Justo, Jul 30, 2023
  2. Junio C HamanoJul 31, 2023
  3. Rubén JustoAug 1, 2023
  4. Junio C HamanoAug 1, 2023
  5. Junio C HamanoAug 16, 2023
  6. status: fix branch shown when not only bisectingRubén Justo, Sep 9, 2023
  7. Junio C HamanoOct 16, 2023

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.