git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Hari Lubovac <hlubovac@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Windows > git.exe > the result of "git branch" does not always highlight the current branch
Date: Tue, 10 Apr 2018 07:20:52 +0200	[thread overview]
Message-ID: <4de8574c-1b64-408c-ca7e-c6e3de2dfa4a@kdbg.org> (raw)
In-Reply-To: <CAFLu24=o0nQveRpMJV-6dhvft0H9PgdBahisBi4EEg=G0BwhpQ@mail.gmail.com>

Am 09.04.2018 um 21:26 schrieb Hari Lubovac:
> It appears to be just a reporting issue. Probably not a big deal, but
> I thought I should report this, if it hasn't been noticed: when a
> branch is switched to by being named with non-original
> character-casing, then it's not clear which branch is current.
> 
> Example:
> 
> C:\repo>git branch
> * bar
>    foo
> 
> C:\repo>git checkout Bar
> Switched to branch 'Bar'
> 
> C:\repo>git branch
>    bar
>    foo

The bug is not that the branch is not marked, but that you are permitted 
to check out a branch that does not exist. This is a side-effect of the 
fact that branch names are sometimes stored using file names, and, as we 
know, file names are case-insensitive on Windows. I don't know of any 
efforts to fix that (I assume that it is not just a simple fix). In the 
meantime, I can only recommend: if it hurts, don't do it.

If you call `git gc` before the checkout command, I would expect that 
you would not be able to check out branch 'Bar', because branches are 
represented unambiguously after 'gc' (not as file names).

-- Hannes

      parent reply	other threads:[~2018-04-10  5:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09 19:26 Windows > git.exe > the result of "git branch" does not always highlight the current branch Hari Lubovac
2018-04-09 19:32 ` Stefan Beller
2018-04-09 20:06   ` Hari Lubovac
2018-04-10  6:30     ` Johannes Schindelin
2018-04-10  6:15   ` Johannes Schindelin
2018-04-10  5:20 ` Johannes Sixt [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=4de8574c-1b64-408c-ca7e-c6e3de2dfa4a@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=hlubovac@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.
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).