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

Re: [PATCH] bisect reset: Allow resetting to any commit, not just a branch

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 13, 2009, 08:33 UTC
Message-ID
<7vtyy3zo9m.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4AD43002.5080003@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
Show 11 quoted lines
> Junio C Hamano schrieb:
>> Half of the time, the commit you test in your "git bisect" section would
>> be a "good" one, and immediately after you tell it "bisect good", it tells
>> you that some _other_ commit you marked "bad" is the first bad commit.  In
>> such a case, you won't be on the commit that the bisect has found.
>
> Oh, yes, very true; but it is very close. But the commit that git bisect
> reset warps me to is perhaps 1000 steps in history away. I certainly do
> not want to go there, ever, because I want to go back near the bad commit
> right away. (Think of fewer files changed means less build time.) If git
> bisect reset would check out the bad commit, this would be *very* convenient.

I agree that "git bisect reset-and-detach-at-the-first-bad-one" would make a lot of sense.

In my workflow, after I chased a bug in frotz, I often do
    $ git name-rev $the_bad_one_that_was_found
    
to learn what was the first tagged release that has the bug, and create a
topic from there:
    $ git checkout -b jc/maint-X.Y.Z-fix-frotz $the_bad_one_that_was_found

so that the fix I'd build on the commit can be merged initially to 'pu', then 'next', then 'maint-X.Y.Z' and upwards to 'master', but all of that is done after "git bisect reset" to switch back to the 'master' branch. It is cumbersome to have to type (actually, I use the cut buffer in screen) the commit object name of the first bad one twice.

It certainly sounds attractive if we can do:
    $ git bisect reset-and-detach-at-the-first-bad-one
    $ git name-rev HEAD
    $ git checkout -b jc/maint-X.Y.Z-fix-frotz
    $ hack hack hack
    $ git commit

But at that point we are not talking about switching to arbitrary commit anymore.

Previous: Johannes SixtNext: Anders Kaseorg
Message 17 of 18 in “bisect reset: Allow resetting to any commit, not just a branch”
  1. bisect reset: Allow resetting to any commit, not just a branchAnders Kaseorg, Oct 12, 2009
  2. Junio C HamanoOct 12, 2009
  3. Anders KaseorgOct 12, 2009
  4. Junio C HamanoOct 12, 2009
  5. Johannes SixtOct 13, 2009
  6. Junio C HamanoOct 13, 2009
  7. Anders KaseorgOct 13, 2009
  8. bisect reset: Allow resetting to any commit, not just a branchAnders Kaseorg, Oct 13, 2009
  9. Christian CouderOct 13, 2009
  10. Anders KaseorgOct 13, 2009
  11. Christian CouderOct 13, 2009
  12. bisect reset: Allow resetting to any commit, not just a branchAnders Kaseorg, Oct 13, 2009
  13. Junio C HamanoOct 14, 2009
  14. Johannes SixtOct 13, 2009
  15. Junio C HamanoOct 13, 2009
  16. Johannes SixtOct 13, 2009
  17. Junio C HamanoOct 13, 2009
  18. Anders KaseorgOct 13, 2009

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.