<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/path.c, branch v2.4.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.4.9</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-06-05T19:00:04Z</updated>
<entry>
<title>Merge branch 'pt/xdg-config-path' into maint</title>
<updated>2015-06-05T19:00:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-05T19:00:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9c82fa7a75ae617718f195bb5f5ff5c904f2687'/>
<id>urn:sha1:d9c82fa7a75ae617718f195bb5f5ff5c904f2687</id>
<content type='text'>
Code clean-up for xdg configuration path support.

* pt/xdg-config-path:
  path.c: remove home_config_paths()
  git-config: replace use of home_config_paths()
  git-commit: replace use of home_config_paths()
  credential-store.c: replace home_config_paths() with xdg_config_home()
  dir.c: replace home_config_paths() with xdg_config_home()
  attr.c: replace home_config_paths() with xdg_config_home()
  path.c: implement xdg_config_home()
  t0302: "unreadable" test needs POSIXPERM
  t0302: test credential-store support for XDG_CONFIG_HOME
  git-credential-store: support XDG_CONFIG_HOME
  git-credential-store: support multiple credential files
</content>
</entry>
<entry>
<title>path.c: remove home_config_paths()</title>
<updated>2015-05-06T18:33:53Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-05-06T08:01:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=846e5dfbab5d5a0a85252c1400dc0371e02e75a8'/>
<id>urn:sha1:846e5dfbab5d5a0a85252c1400dc0371e02e75a8</id>
<content type='text'>
home_config_paths() combines distinct functionality already implemented
by expand_user_path() and xdg_config_home(), and it also hard-codes the
path ~/.gitconfig, which makes it unsuitable to use for other home
config file paths. Since its use will just add unnecessary complexity to
the code, remove it.

Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path.c: implement xdg_config_home()</title>
<updated>2015-05-06T18:21:04Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-04-21T04:06:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea19289bc82351b7ac20ea2fd877e2bdde97ae34'/>
<id>urn:sha1:ea19289bc82351b7ac20ea2fd877e2bdde97ae34</id>
<content type='text'>
The XDG base dir spec[1] specifies that configuration files be stored in
a subdirectory in $XDG_CONFIG_HOME. To construct such a configuration
file path, home_config_paths() can be used. However, home_config_paths()
combines distinct functionality:

1. Retrieve the home git config file path ~/.gitconfig

2. Construct the XDG config path of the file specified by `file`.

This function was introduced in commit 21cf3227 ("read (but not write)
from $XDG_CONFIG_HOME/git/config file").  While the intention of the
function was to allow the home directory configuration file path and the
xdg directory configuration file path to be retrieved with one function
call, the hard-coding of the path ~/.gitconfig prevents it from being
used for other configuration files. Furthermore, retrieving a file path
relative to the user's home directory can be done with
expand_user_path(). Hence, it can be seen that home_config_paths()
introduces unnecessary complexity, especially if a user just wants to
retrieve the xdg config file path.

As such, implement a simpler function xdg_config_home() for constructing
the XDG base dir spec configuration file path. This function, together
with expand_user_path(), can replace all uses of home_config_paths().

[1] http://standards.freedesktop.org/basedir-spec/basedir-spec-0.7.html

Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pt/enter-repo-comment-fix'</title>
<updated>2015-04-14T17:34:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-04-14T17:34:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bf2cfcaabf1f7497ff283c221af9d8b3058867af'/>
<id>urn:sha1:bf2cfcaabf1f7497ff283c221af9d8b3058867af</id>
<content type='text'>
* pt/enter-repo-comment-fix:
  enter_repo(): fix docs to match code
</content>
</entry>
<entry>
<title>enter_repo(): fix docs to match code</title>
<updated>2015-03-31T17:19:53Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-03-31T13:39:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c8c3f1d087f2195fd6ef61d6cca8241a808ac11a'/>
<id>urn:sha1:c8c3f1d087f2195fd6ef61d6cca8241a808ac11a</id>
<content type='text'>
In b3256eb (standardize and improve lookup rules for external local
repos), enter_repo() was modified to use a different precedence
ordering of suffixes for DWIM of the repository path, and to ensure
that the repository path is actually valid instead of just testing
for existence.

However, the documentation was not modified to reflect these
changes.  Fix the documentation to match the code.

Documentation contributed by Jeff King.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&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>path: add is_ntfs_dotgit() helper</title>
<updated>2014-12-17T19:04:45Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2014-12-16T22:31:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1d1d69bc52dcc7def5b2edbd165cc0a4e3911c8e'/>
<id>urn:sha1:1d1d69bc52dcc7def5b2edbd165cc0a4e3911c8e</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.

On NTFS (and FAT32), there exist so-called "short names" for
backwards-compatibility: 8.3 compliant names that refer to the same files
as their long names. As ".git" is not an 8.3 compliant name, a short name
is generated automatically, typically "git~1".

Depending on the Windows version, any combination of trailing spaces and
periods are ignored, too, so that both "git~1." and ".git." still refer
to the Git directory. The reason is that 8.3 stores file names shorter
than 8 characters with trailing spaces. So literally, it does not matter
for the short name whether it is padded with spaces or whether it is
shorter than 8 characters, it is considered to be the exact same.

The period is the separator between file name and file extension, and
again, an empty extension consists just of spaces in 8.3 format. So
technically, we would need only take care of the equivalent of this
regex:
        (\.git {0,4}|git~1 {0,3})\. {0,3}

However, there are indications that at least some Windows versions might
be more lenient and accept arbitrary combinations of trailing spaces and
periods and strip them out. So we're playing it real safe here. Besides,
there can be little doubt about the intention behind using file names
matching even the more lenient pattern specified above, therefore we
should be fine with disallowing such patterns.

Extra care is taken to catch names such as '.\\.git\\booh' because the
backslash is marked as a directory separator only on Windows, and we want
to use this new helper function also in fsck on other platforms.

A big thank you goes to Ed Thomson and an unnamed Microsoft engineer for
the detailed analysis performed to come up with the corresponding fixes
for libgit2.

This commit adds a function to detect whether a given file name can refer
to the Git directory by mistake.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
