On Tue, Oct 31, 2017 at 08:07:53PM -0700, Michael wrote:

[...]
> keybounceMBP:extractor michael$ git diff head^1 head^2 adobepass.py
[...]

…and while we're on it, can I heartily recommend you to unlearn this
habit of lowercasing the name of the ref "HEAD"?

The problem with it is that the fact it works for you is just a Git's
implementation detail combined with the semantics of the filesystems
native to Windows.  In a stock Git implementation, most of the refs
(those which are not "packed" due to age) are represented as plain files
under the ".git" subdirectory. Windows-native filesystems (at least with
default settings which no one ever touches anyway) are
case-insensitive¹.

This means when you tell Git you want it to access the "head" ref it
actually tries to find a file ".git/refs/tags/head" then
".git/refs/heads/head" then ".git/head", which succeeds because there's
a file named ".git/HEAD".

As soon as you'll happen to work with Git on a non-Windows OS with a
case-sensitive filesystem, your habit will promptly bite you in the
rear.


¹ NTFS is case-insensitive but case-preserving, so if you'll create a
file named "kAbOoM" on it, it will be stored as "kAbOoM" but you will be
able to access it by the name "kaboom" or "KABOOM" or via any other
combination of the cases of those letters.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to