<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/utf8.c, branch v2.3.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.8</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-01-07T21:28:10Z</updated>
<entry>
<title>Merge branch 'maint-2.1' into maint</title>
<updated>2015-01-07T21:28:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-07T21:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7ba46269a04de20032bd2dd614be6290cd65caab'/>
<id>urn:sha1:7ba46269a04de20032bd2dd614be6290cd65caab</id>
<content type='text'>
* maint-2.1:
  is_hfs_dotgit: loosen over-eager match of \u{..47}
</content>
</entry>
<entry>
<title>Merge branch 'maint-2.0' into maint-2.1</title>
<updated>2015-01-07T21:27:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-07T21:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3c84ac86fc896c108b789b8eb26b169cc0e8088a'/>
<id>urn:sha1:3c84ac86fc896c108b789b8eb26b169cc0e8088a</id>
<content type='text'>
* maint-2.0:
  is_hfs_dotgit: loosen over-eager match of \u{..47}
</content>
</entry>
<entry>
<title>Merge branch 'maint-1.9' into maint-2.0</title>
<updated>2015-01-07T21:27:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-07T21:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=282616c72d1d08a77ca4fe1186cb708c38408d87'/>
<id>urn:sha1:282616c72d1d08a77ca4fe1186cb708c38408d87</id>
<content type='text'>
* maint-1.9:
  is_hfs_dotgit: loosen over-eager match of \u{..47}
</content>
</entry>
<entry>
<title>Merge branch 'maint-1.8.5' into maint-1.9</title>
<updated>2015-01-07T21:27:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-07T21:27:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64a03e970ab3ef0ce45d6bd3c1de1bff1de2beee'/>
<id>urn:sha1:64a03e970ab3ef0ce45d6bd3c1de1bff1de2beee</id>
<content type='text'>
* maint-1.8.5:
  is_hfs_dotgit: loosen over-eager match of \u{..47}
</content>
</entry>
<entry>
<title>is_hfs_dotgit: loosen over-eager match of \u{..47}</title>
<updated>2014-12-29T20:06:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-23T08:45:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6aaf956b08cfab2dcaa1a1afe4192390d0ef14fd'/>
<id>urn:sha1:6aaf956b08cfab2dcaa1a1afe4192390d0ef14fd</id>
<content type='text'>
Our is_hfs_dotgit function relies on the hackily-implemented
next_hfs_char to give us the next character that an HFS+
filename comparison would look at. It's hacky because it
doesn't implement the full case-folding table of HFS+; it
gives us just enough to see if the path matches ".git".

At the end of next_hfs_char, we use tolower() to convert our
32-bit code point to lowercase. Our tolower() implementation
only takes an 8-bit char, though; it throws away the upper
24 bits. This means we can't have any false negatives for
is_hfs_dotgit. We only care about matching 7-bit ASCII
characters in ".git", and we will correctly process 'G' or
'g'.

However, we _can_ have false positives. Because we throw
away the upper bits, code point \u{0147} (for example) will
look like 'G' and get downcased to 'g'. It's not known
whether a sequence of code points whose truncation ends up
as ".git" is meaningful in any language, but it does not
hurt to be more accurate here. We can just pass out the full
32-bit code point, and compare it manually to the upper and
lowercase characters we care about.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Sync with v2.1.4</title>
<updated>2014-12-17T19:46:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-17T19:46:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77933f4449b8d6aa7529d627f3c7b55336f491db'/>
<id>urn:sha1:77933f4449b8d6aa7529d627f3c7b55336f491db</id>
<content type='text'>
* maint-2.1:
  Git 2.1.4
  Git 2.0.5
  Git 1.9.5
  Git 1.8.5.6
  fsck: complain about NTFS ".git" aliases in trees
  read-cache: optionally disallow NTFS .git variants
  path: add is_ntfs_dotgit() helper
  fsck: complain about HFS+ ".git" aliases in trees
  read-cache: optionally disallow HFS+ .git variants
  utf8: add is_hfs_dotgit() helper
  fsck: notice .git case-insensitively
  t1450: refactor ".", "..", and ".git" fsck tests
  verify_dotfile(): reject .git case-insensitively
  read-tree: add tests for confusing paths like ".." and ".git"
  unpack-trees: propagate errors adding entries to the index
</content>
</entry>
<entry>
<title>Sync with v2.0.5</title>
<updated>2014-12-17T19:42:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-17T19:42:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=58f1d950e373afe35ed8661045914d23e973d067'/>
<id>urn:sha1:58f1d950e373afe35ed8661045914d23e973d067</id>
<content type='text'>
* maint-2.0:
  Git 2.0.5
  Git 1.9.5
  Git 1.8.5.6
  fsck: complain about NTFS ".git" aliases in trees
  read-cache: optionally disallow NTFS .git variants
  path: add is_ntfs_dotgit() helper
  fsck: complain about HFS+ ".git" aliases in trees
  read-cache: optionally disallow HFS+ .git variants
  utf8: add is_hfs_dotgit() helper
  fsck: notice .git case-insensitively
  t1450: refactor ".", "..", and ".git" fsck tests
  verify_dotfile(): reject .git case-insensitively
  read-tree: add tests for confusing paths like ".." and ".git"
  unpack-trees: propagate errors adding entries to the index
</content>
</entry>
<entry>
<title>Sync with v1.9.5</title>
<updated>2014-12-17T19:28:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-17T19:28:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5e519fb8b09378342e23bd8c075cfb4b8e7b0e4f'/>
<id>urn:sha1:5e519fb8b09378342e23bd8c075cfb4b8e7b0e4f</id>
<content type='text'>
* maint-1.9:
  Git 1.9.5
  Git 1.8.5.6
  fsck: complain about NTFS ".git" aliases in trees
  read-cache: optionally disallow NTFS .git variants
  path: add is_ntfs_dotgit() helper
  fsck: complain about HFS+ ".git" aliases in trees
  read-cache: optionally disallow HFS+ .git variants
  utf8: add is_hfs_dotgit() helper
  fsck: notice .git case-insensitively
  t1450: refactor ".", "..", and ".git" fsck tests
  verify_dotfile(): reject .git case-insensitively
  read-tree: add tests for confusing paths like ".." and ".git"
  unpack-trees: propagate errors adding entries to the index
</content>
</entry>
<entry>
<title>Sync with v1.8.5.6</title>
<updated>2014-12-17T19:20:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-17T19:20:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6898b797218ca1f25818d813318b387d965dc1bb'/>
<id>urn:sha1:6898b797218ca1f25818d813318b387d965dc1bb</id>
<content type='text'>
* maint-1.8.5:
  Git 1.8.5.6
  fsck: complain about NTFS ".git" aliases in trees
  read-cache: optionally disallow NTFS .git variants
  path: add is_ntfs_dotgit() helper
  fsck: complain about HFS+ ".git" aliases in trees
  read-cache: optionally disallow HFS+ .git variants
  utf8: add is_hfs_dotgit() helper
  fsck: notice .git case-insensitively
  t1450: refactor ".", "..", and ".git" fsck tests
  verify_dotfile(): reject .git case-insensitively
  read-tree: add tests for confusing paths like ".." and ".git"
  unpack-trees: propagate errors adding entries to the index
</content>
</entry>
<entry>
<title>utf8: add is_hfs_dotgit() helper</title>
<updated>2014-12-17T19:04:39Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-15T22:56:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6162a1d323d24fd8cbbb1a6145a91fb849b2568f'/>
<id>urn:sha1:6162a1d323d24fd8cbbb1a6145a91fb849b2568f</id>
<content type='text'>
We do not allow paths with a ".git" component to be added to
the index, as that would mean repository contents could
overwrite our repository files. However, asking "is this
path the same as .git" is not as simple as strcmp() on some
filesystems.

HFS+'s case-folding does more than just fold uppercase into
lowercase (which we already handle with strcasecmp). It may
also skip past certain "ignored" Unicode code points, so
that (for example) ".gi\u200ct" is mapped ot ".git".

The full list of folds can be found in the tables at:

  https://www.opensource.apple.com/source/xnu/xnu-1504.15.3/bsd/hfs/hfscommon/Unicode/UCStringCompareData.h

Implementing a full "is this path the same as that path"
comparison would require us importing the whole set of
tables.  However, what we want to do is much simpler: we
only care about checking ".git". We know that 'G' is the
only thing that folds to 'g', and so on, so we really only
need to deal with the set of ignored code points, which is
much smaller.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
