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

Re: [PATCH v2] bisect: fix "reset" when branch is checked out elsewhere

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 8, 2023, 05:16 UTC
Message-ID
<xmqqo7q4vir8.fsf@gitster.g>
In-Reply-To
<eb086063-9e47-9fdb-3644-77a843733dcf@gmail.com>
Rubén Justo <rjusto@gmail.com> writes:
Show 21 quoted lines
> No problem.  I am sorry because I don't understand what's worrying you.
>
>> that the phrasing of this paragraph is misleading), but isn't it a
>> good thing if in this sequence:
>> 
>>  - I checkout 'main' and start bisecting (BISECT_HEAD says 'main');
>> 
>>  - I then checkout 'main' in another worktree; I may even make a
>>    commit or two, or even rename 'main' to 'master'.
>> 
>>  - I finish bisection and "bisect reset" tries to take me back to
>>    'main', which may notice that 'main' is checked out in the other
>>    worktree, and fail.
>> 
>> the last one failed?  After the above sequence, I now have two
>> worktrees, both checking out 'main', and it is exactly the situation
>> the safety valve tries to prevent from occuring, no?
>
> We are considering the initial branch (BISECT_START) as a branch checked
> out _implicitly_ in the worktree that is bisecting.  Doesn't that
> provide us and the user enough safety?

If that is a question, then the answer is no. If that is rhetorical, then I just do not see how it gives us any safety.

In the end, if you allow "bisect reset" to check out 'main' in the worktree you used to run bisection, the 'main' branch is checked out twice, once there, and another checkout in the other worktree. That is exactly what "git checkout 'main'" in one worktree while 'main' is already checked out in another would prevent from happening, no?

Previous: Rubén JustoNext: Rubén Justo
Message 11 of 15 in “bisect: fix "reset" when branch is checked out elsewhere”
  1. bisect: fix "reset" when branch is checked out elsewhereRubén Justo, Jan 22, 2023
  2. Junio C HamanoJan 23, 2023
  3. Rubén JustoJan 26, 2023
  4. Junio C HamanoJan 26, 2023
  5. Junio C HamanoJan 26, 2023
  6. Rubén JustoFeb 4, 2023
  7. Junio C HamanoFeb 6, 2023
  8. bisect: fix "reset" when branch is checked out elsewhereRubén Justo, Feb 4, 2023
  9. Junio C HamanoFeb 6, 2023
  10. Rubén JustoFeb 8, 2023
  11. Junio C HamanoFeb 8, 2023
  12. Rubén JustoFeb 8, 2023
  13. Eric SunshineFeb 15, 2023
  14. Rubén JustoFeb 15, 2023
  15. bisect: fix "reset" when branch is checked out elsewhereRubén Justo, Feb 20, 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.