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
Marcus Kida <marcus.kida@gmail.com>
Date
Mar 10, 2016, 22:43 UTC
Message-ID
<02FB9587-5849-4B3A-A199-6483377C3EED@gmail.com>
In-Reply-To
<20160310224158.GA2772@sigill.intra.peff.net>
Fair enough,

thank you. I’m going to take a look at the previous threads. I’d also be keen to help working on those issues.

Show 27 quoted lines
> On 11 Mar 2016, at 9:41 AM, Jeff King <peff@peff.net> wrote:
> 
> 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: Jeff KingNext: Marcus Kida
Message 5 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.