From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: Richard Carlsson <carlsson.richard@gmail.com>, git@vger.kernel.org
Subject: Re: git may delete current branch on case insensitive file system (Mac)
Date: Tue, 19 Aug 2025 10:15:07 +0200 [thread overview]
Message-ID: <aKQyi7uO-6Ikyviw@pks.im> (raw)
In-Reply-To: <xmqqfrdstwwb.fsf@gitster.g>
On Fri, Aug 15, 2025 at 08:41:40AM -0700, Junio C Hamano wrote:
> Richard Carlsson <carlsson.richard@gmail.com> writes:
>
> > This was a fun one. I accidentally upcased the first letter of a
> > branch beginning with "d" instead of
> > upcasing the -d option as I had intended, with a surprising result
> > (Mac OS). Easily reproduced:
> >
> > % git checkout -b dummy
> > Switched to a new branch 'dummy'
> > % git branch -d dummy
> > error: cannot delete branch 'dummy' used by worktree at '/Users/riccar/...'
> > % git branch -D dummy
> > error: cannot delete branch 'dummy' used by worktree at '/Users/riccar/...'
> > % git branch -d Dummy
> > Deleted branch Dummy (was c32dfb2).
> > % git log
> > fatal: your current branch 'dummy' does not have any commits yet
> >
> > On Linux, you instead get
> >
> > % git branch -d Dummy
> > error: branch 'Dummy' not found
>
> Perhaps you want to opt into the reftable backend before everybody
> else does? Because it does not store each reference (branches, tags
> and their friends) as a file on the filesystem, it would sidestep
> the above issue case-challenged filesystems has.
Yup. The above issue is indeed one more limitation of the "files"
backend and isn't really something we can fix. But the reftable backend
should indeed solve the issue.
You can create repositories with that backend by using `git init
--ref-format=reftable`, and you can migrate an existing repository to
the reftable backend by saying `git refs migrate --ref-format=reftable`.
But note: you do need to have a recent version of Git (at least 2.45,
but most recent is recommended). And other tools that use for example
libgit2 may not be able to access the repository. There is a fully
working backend for libgit2, but it still needs to get merged.
Patrick
prev parent reply other threads:[~2025-08-19 8:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 9:50 git may delete current branch on case insensitive file system (Mac) Richard Carlsson
2025-08-15 15:41 ` Junio C Hamano
2025-08-19 8:15 ` Patrick Steinhardt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aKQyi7uO-6Ikyviw@pks.im \
--to=ps@pks.im \
--cc=carlsson.richard@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).