<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/path.c, branch v1.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v1.6.2</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.6.2'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2009-02-20T06:45:48Z</updated>
<entry>
<title>Introduce the function strip_path_suffix()</title>
<updated>2009-02-20T06:45:48Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2009-02-19T19:10:49Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4fcc86b07db26da17f17af0fd777cab78fcaaf4c'/>
<id>urn:sha1:4fcc86b07db26da17f17af0fd777cab78fcaaf4c</id>
<content type='text'>
The function strip_path_suffix() will try to strip a given suffix from
a given path.  The suffix must start at a directory boundary (i.e. "core"
is not a path suffix of "libexec/git-core", but "git-core" is).

Arbitrary runs of directory separators ("slashes") are assumed identical.

Example:

	strip_path_suffix("C:\\msysgit/\\libexec\\git-core",
		"libexec///git-core", &amp;prefix)

will set prefix to "C:\\msysgit" and return 0.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Acked-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Revert "validate_headref: tighten ref-matching to just branches"</title>
<updated>2009-02-12T21:02:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-02-12T21:02:09Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=222b1673860bba6c75895ce3e2d1467fb878fa2a'/>
<id>urn:sha1:222b1673860bba6c75895ce3e2d1467fb878fa2a</id>
<content type='text'>
This reverts commit b229d18a809c169314b7f0d048dc5a7632e8f916, at least
until we figure out how to work better with TopGit that points HEAD to
refs/top-bases/ hierarchy.
</content>
</entry>
<entry>
<title>Merge branch 'js/maint-1.6.0-path-normalize'</title>
<updated>2009-02-11T05:30:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-02-11T05:30:52Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6e5d7ddc490fc7fdf46a5d0af35aa6fd64ae4a96'/>
<id>urn:sha1:6e5d7ddc490fc7fdf46a5d0af35aa6fd64ae4a96</id>
<content type='text'>
* js/maint-1.6.0-path-normalize:
  Remove unused normalize_absolute_path()
  Test and fix normalize_path_copy()
  Fix GIT_CEILING_DIRECTORIES on Windows
  Move sanitary_path_copy() to path.c and rename it to normalize_path_copy()
  Make test-path-utils more robust against incorrect use
</content>
</entry>
<entry>
<title>Remove unused normalize_absolute_path()</title>
<updated>2009-02-07T20:23:30Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2009-02-07T15:08:31Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f2a782b8ba189b5ed51d18aa3eb93a670c220018'/>
<id>urn:sha1:f2a782b8ba189b5ed51d18aa3eb93a670c220018</id>
<content type='text'>
This function is now superseded by normalize_path_copy().

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Test and fix normalize_path_copy()</title>
<updated>2009-02-07T20:23:30Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2009-02-07T15:08:30Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f42302b49333d035a323f5d80fb9562d375b17f1'/>
<id>urn:sha1:f42302b49333d035a323f5d80fb9562d375b17f1</id>
<content type='text'>
This changes the test-path-utils utility to invoke normalize_path_copy()
instead of normalize_absolute_path() because the latter is about to be
removed.

The test cases in t0060 are adjusted in two regards:

- normalize_path_copy() more often leaves a trailing slash in the result.
  This has no negative side effects because the new user of this function,
  longest_ancester_length(), already accounts for this behavior.

- The function can fail.

The tests uncover a flaw in normalize_path_copy(): If there are
sufficiently many '..' path components so that the root is reached, such as
in "/d1/s1/../../d2", then the leading slash was lost. This manifested
itself that (assuming there is a repository at /tmp/foo)

  $ git add /d1/../tmp/foo/some-file

reported 'pathspec is outside repository'. This is now fixed.

Moreover, the test case descriptions of t0060 now include the test data and
expected outcome.

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix GIT_CEILING_DIRECTORIES on Windows</title>
<updated>2009-02-07T20:23:29Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-02-07T15:08:29Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=43a7ddb55d82d5c6f0c4d2cbe408a1df71d58ef3'/>
<id>urn:sha1:43a7ddb55d82d5c6f0c4d2cbe408a1df71d58ef3</id>
<content type='text'>
Using git with GIT_CEILING_DIRECTORIES crashed on Windows due to a failed
assertion in normalize_absolute_path(): This function expects absolute
paths to start with a slash, while on Windows they can start with a drive
letter or a backslash.

This fixes it by using the alternative, normalize_path_copy() instead,
which can handle Windows-style paths just fine.

Secondly, the portability macro PATH_SEP is used instead of expecting
colons to be used as path list delimiter.

The test script t1504 is also changed to help MSYS's bash recognize some
program arguments as path list. (MSYS's bash must translate POSIX-style
path lists to Windows-style path lists, and the heuristic did not catch
some cases.)

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Move sanitary_path_copy() to path.c and rename it to normalize_path_copy()</title>
<updated>2009-02-07T20:23:29Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2009-02-07T15:08:28Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f3cad0ad82e24966bf7bcc8a47670c54c30e4b18'/>
<id>urn:sha1:f3cad0ad82e24966bf7bcc8a47670c54c30e4b18</id>
<content type='text'>
This function and normalize_absolute_path() do almost the same thing. The
former already works on Windows, but the latter crashes.

In subsequent changes we will remove normalize_absolute_path(). Here we
make the replacement function reusable. On the way we rename it to reflect
that it does some path normalization. Apart from that this is only moving
around code.

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>validate_headref: tighten ref-matching to just branches</title>
<updated>2009-01-29T09:00:43Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2009-01-29T08:30:16Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=b229d18a809c169314b7f0d048dc5a7632e8f916'/>
<id>urn:sha1:b229d18a809c169314b7f0d048dc5a7632e8f916</id>
<content type='text'>
When we are trying to determine whether a directory contains
a git repository, one of the tests we do is to check whether
HEAD is either a symlink or a symref into the "refs/"
hierarchy, or a detached HEAD.

We can tighten this a little more, though: a non-detached
HEAD should always point to a branch (since checking out
anything else should result in detachment), so it is safe to
check for "refs/heads/".

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>Fix non-literal format in printf-style calls</title>
<updated>2008-11-11T22:43:59Z</updated>
<author>
<name>Daniel Lowe</name>
<email>dlowe@bitmuse.com</email>
</author>
<published>2008-11-10T21:07:52Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=9db56f71b91153f4076a796c80c61f00edd8b700'/>
<id>urn:sha1:9db56f71b91153f4076a796c80c61f00edd8b700</id>
<content type='text'>
These were found using gcc 4.3.2-1ubuntu11 with the warning:

    warning: format not a string literal and no format arguments

Incorporated suggestions from Brandon Casey &lt;casey@nrlssc.navy.mil&gt;.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ar/maint-mksnpath' into maint</title>
<updated>2008-11-09T00:13:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-11-09T00:13:19Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=8b1981d32b41f1b4e26d8d96a3c6e63b9bc746b0'/>
<id>urn:sha1:8b1981d32b41f1b4e26d8d96a3c6e63b9bc746b0</id>
<content type='text'>
* ar/maint-mksnpath:
  Use git_pathdup instead of xstrdup(git_path(...))
  git_pathdup: returns xstrdup-ed copy of the formatted path
  Fix potentially dangerous use of git_path in ref.c
  Add git_snpath: a .git path formatting routine with output buffer
  Fix potentially dangerous uses of mkpath and git_path
  Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c
  Add mksnpath which allows you to specify the output buffer

Conflicts:
	builtin-revert.c
	rerere.c
</content>
</entry>
</feed>
