git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Marcus Kida <marcus.kida@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Bug: git branch -D can be used to delete branch which is currently checked out
Date: Thu, 10 Mar 2016 09:40:10 -0800	[thread overview]
Message-ID: <xmqqvb4udyf9.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CE5AE06C-0909-414E-B901-7CCF3A259465@gmail.com> (Marcus Kida's message of "Thu, 10 Mar 2016 19:20:21 +1100")

Marcus Kida <marcus.kida@gmail.com> writes:

> Testes on: 
>
> Mac OS X 10.11.3 (El Capitan) using Git 2.6.4
>
> Issue:
>
> git branch -D can be used to delete branch which is currently checked out

There are other limitations a filesystem that is incapable of
differentiating two files with names that are only different in case
imposes on your use of Git, e.g.

 - "git fetch origin", when the origin repository has two tags 'v1'
   and 'V1', may not let you have both of these tags locally;

 - "git checkout Another", when the branch you have is 'another',
   may check it out instead of complaining (replace "checkout" with
   any other command that let you use a refname to specify an object).

It is a possibility to teach the files backend of refs API that some
filesystems are case insensitive and do something special about them,
but I think in the longer term a more productive solution would be
to use the upcoming "pluggable ref backend" subsystem and either

 - use a backend that is not the "files" backend (e.g. lmdb backend,
   or the tree-object based backend);

 - add a variant of "files" backend but encodes the refnames in a
   way that is safe on case insensitive filesystems.

That way, those on platforms with case insensitive filesystems do
not have to be artificially limited.  Git is about working together
with people potentially on other systems, and "on this system you
cannot have 'master' and 'Master' at the same time, because we have
a patch to case-fold the refnames" would not be a good longer term
solution.

  reply	other threads:[~2016-03-10 17:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10  8:20 Bug: git branch -D can be used to delete branch which is currently checked out Marcus Kida
2016-03-10 17:40 ` Junio C Hamano [this message]
2016-03-10 18:23   ` Junio C Hamano
2016-03-10 18:38     ` Marcus Kida

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqvb4udyf9.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=marcus.kida@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).