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

Re: Bug: git branch -D can be used to delete branch which is currently checked out - Part 2

From
Jeff King <peff@peff.net>
Date
Mar 10, 2016, 22:41 UTC
Message-ID
<20160310224158.GA2772@sigill.intra.peff.net>
In-Reply-To
<9EFA8642-FA02-4ADB-B37B-530E611C9C1F@gmail.com>
On Fri, Mar 11, 2016 at 05:30:00AM +1100, Marcus Kida wrote:
> thank you for the feedback.
> I will fix this, test it and send a patch.
Unfortunately, I think this issue is a little more complicated.
There's some prior discussion in
  http://thread.gmane.org/gmane.comp.version-control.git/284022
and
  http://thread.gmane.org/gmane.comp.version-control.git/276456/focus=276506

The latter, in particular, shows a case where this approach will do the wrong thing. The fundamental issue is that refs are potentially stored in _two_ places: the filesystem, and the packed-refs file. And the latter is always case-sensitive, while the former sometimes is and sometimes isn't. But because the storage all happens behind the scenes, the user has no way of reliably disambiguating (e.g., does "foo" refer to your checked-out "FOO", or are you intentionally trying to delete an extraneous "FOO" that ended up in the packed-refs file?).

-Peff
Previous: Marcus KidaNext: Marcus Kida
Message 4 of 6 in “Bug: git branch -D can be used to delete branch which is currently checked out - Part 2”
  1. Marcus KidaMar 10, 2016
  2. Johannes SchindelinMar 10, 2016
  3. Marcus KidaMar 10, 2016
  4. Jeff KingMar 10, 2016
  5. Marcus KidaMar 10, 2016
  6. Marcus KidaMar 10, 2016

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.