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

Re: [PATCH] git-bisect.sh: don't accidentally override existing branch "bisect"

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 3, 2008, 12:48 UTC
Message-ID
<alpine.DEB.1.00.0805031347460.30431@racer>
In-Reply-To
<7v8wysy5bz.fsf@gitster.siamese.dyndns.org>
Hi,
On Fri, 2 May 2008, Junio C Hamano wrote:
Show 21 quoted lines
> Karl Hasselström <kha@treskal.com> writes:
> 
> > On 2008-04-30 16:46:13 +0000, Gerrit Pape wrote:
> >
> >> If a branch named "bisect" or "new-bisect" already was created in the 
> >> repo by other means than git bisect, doing a git bisect used to 
> >> override the branch without a warning. Now if the branch "bisect" or 
> >> "new-bisect" already exists, and it was not created by git bisect 
> >> itself, git bisect start fails with an appropriate error message. 
> >> Additionally, if checking out a new bisect state fails due to a merge 
> >> problem, git bisect cleans up the temporary branch "new-bisect".
> >
> > Makes me wonder why bisect has to use a branch at all, and not just a 
> > detached HEAD ... I seem to recall this having been discussed before, 
> > but I can't find it now.
> 
> Only because the mechanism predates detached HEAD and no other reason. 
> Whoever wants to update it to use detached HEAD needs to design what 
> should happen when the bisection was started while the HEAD is detached 
> (should we come back to the same HEAD?  how? ...), but other than that I 
> do not offhand see fundamental difficulties.

IMO it should behave as the rebase machinery does: record $(git rev-parse HEAD) in the case of a detached HEAD, and go back to that. It is dead easy.

Ciao, Dscho

Previous: Junio C Hamano
Message 11 of 11 in “git-bisect.sh: don't accidentally override existing branch "bisect"”
  1. git-bisect.sh: don't accidentally override existing branch "bisect"Gerrit Pape, Apr 30, 2008
  2. Christian CouderApr 30, 2008
  3. Richard QuirkMay 1, 2008
  4. Christian CouderMay 1, 2008
  5. git-bisect.sh: don't accidentally override existing branch "bisect"Gerrit Pape, May 2, 2008
  6. Christian CouderMay 3, 2008
  7. git-bisect.sh: don't accidentally override existing branch "bisect"Gerrit Pape, May 5, 2008
  8. Christian CouderMay 6, 2008
  9. Karl HasselströmMay 2, 2008
  10. Junio C HamanoMay 2, 2008
  11. Johannes SchindelinMay 3, 2008

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.