git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Kenneth Hsu <kennethhsu@gmail.com>
To: Konstantin Khomoutov <kostix+git@007spb.ru>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Git ML" <git@vger.kernel.org>
Subject: Re: Should "head" also work for "HEAD" on case-insensitive FS?
Date: Wed, 5 Jul 2017 20:35:54 -0700	[thread overview]
Message-ID: <20170706033554.GA9195@lenny.localdomain> (raw)
In-Reply-To: <20170704071909.phs4bf5ybdord2lv@tigra>

On Tue, Jul 04, 2017 at 10:19:09AM +0300, Konstantin Khomoutov wrote:
> On Tue, Jul 04, 2017 at 12:00:49AM +0200, Ævar Arnfjörð Bjarmason wrote:
> 
> > I don't have a OSX box, but was helping a co-worker over Jabber the
> > other day, and he pasted something like:
> > 
> >     $ git merge-base github/master head
> > 
> > Which didn't work for me, and I thought he had a local "head" branch
> > until realizing that of course we were just resolving HEAD on the FS.
> > 
> > Has this come up before? I think it makes sense to warn/error about
> > these magic /HEAD/ revisions if they're not upper-case.
> > 
> > This is likely unintentional and purely some emergent effect of how it's
> > implemented, and leads to unportable git invocations.
> 
> JFTR this is one common case of confusion on Windows as well.
> To the point that I saw people purposedly using "head" on StackOverflow
> questions.  That is, they appear to think (for some reason) that
> branches in Git have case-insensitive names and prefer to spell "head"
> since it (supposedly) easier to type.

The use of "head" also appears to be leading to some strange behavior
when resolving refs on Windows.  See the following issue in the
git-for-windows project:

https://github.com/git-for-windows/git/issues/1225

In summary, it seems that head and HEAD can resolve to different
revisions when in a worktree.

      parent reply	other threads:[~2017-07-06  3:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03 22:00 Should "head" also work for "HEAD" on case-insensitive FS? Ævar Arnfjörð Bjarmason
2017-07-04  7:19 ` Konstantin Khomoutov
2017-07-04  8:24   ` Ævar Arnfjörð Bjarmason
2017-07-05  8:36     ` Jeff King
2017-07-05 17:07       ` Junio C Hamano
2017-07-06 22:34         ` Junio C Hamano
     [not found]           ` <CAMy9T_FmE=8xzjRJJRxLwQjoMStJx5sYO_xtODv2OEZm54DurA@mail.gmail.com>
2017-07-27  0:23             ` Fwd: " Michael Haggerty
     [not found]             ` <xmqqa84c6v41.fsf@gitster.mtv.corp.google.com>
2017-07-27  0:49               ` Junio C Hamano
2017-07-27 14:35                 ` Jeff King
2017-07-27 15:26                   ` Junio C Hamano
2017-07-06  3:35   ` Kenneth Hsu [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

  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=20170706033554.GA9195@lenny.localdomain \
    --to=kennethhsu@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kostix+git@007spb.ru \
    /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).