<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/setup.c, branch v2.0.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.0.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.0.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-05-02T20:11:03Z</updated>
<entry>
<title>Merge branch 'mw/symlinks'</title>
<updated>2014-05-02T20:11:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-05-02T20:11:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=648d9c182723862228065686f2c32c4b6bdcdf5e'/>
<id>urn:sha1:648d9c182723862228065686f2c32c4b6bdcdf5e</id>
<content type='text'>
A finishing touch fix to a new change already in 'master'.

* mw/symlinks:
  setup: fix windows path buffer over-stepping
</content>
</entry>
<entry>
<title>setup: fix windows path buffer over-stepping</title>
<updated>2014-04-24T20:46:13Z</updated>
<author>
<name>Martin Erik Werner</name>
<email>martinerikwerner@gmail.com</email>
</author>
<published>2014-04-24T13:06:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6127ff63cf39471b2c7317c9861016424d3b884b'/>
<id>urn:sha1:6127ff63cf39471b2c7317c9861016424d3b884b</id>
<content type='text'>
Fix a buffer over-stepping issue triggered by providing an absolute path
that is similar to the work tree path.

abspath_part_inside_repo() may currently increment the path pointer by
offset_1st_component() + wtlen, which is too much, since
offset_1st_component() is a subset of wtlen.

For the *nix-style prefix '/', this does (by luck) not cause any issues,
since offset_1st_component() is 1 and there will always be a '/' or '\0'
that can "absorb" this.

In the case of DOS-style prefixes though, the offset_1st_component() is
3 and this can potentially over-step the string buffer. For example if

    work_tree = "c:/r"
    path      = "c:/rl"

Then wtlen is 4, and incrementing the path pointer by (3 + 4) would
end up 2 bytes outside a string buffer of length 6.

Similarly if

    work_tree = "c:/r"
    path      = "c:/rl/d/a"

Then (since the loop starts by also incrementing the pointer one step),
this would mean that the function would miss checking if "c:/rl/d" could
be the work_tree, arguably this is unlikely though, since it would only
be possible with symlinks on windows.

Fix this by simply avoiding to increment by offset_1st_component() and
wtlen at the same time.

Signed-off-by: Martin Erik Werner &lt;martinerikwerner@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/daemonize-gc'</title>
<updated>2014-03-05T23:06:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-05T23:06:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c4ac4db2c933fbae1c6e6bcf90d9bee5f823fc7'/>
<id>urn:sha1:4c4ac4db2c933fbae1c6e6bcf90d9bee5f823fc7</id>
<content type='text'>
Allow running "gc --auto" in the background.

* nd/daemonize-gc:
  gc: config option for running --auto in background
  daemon: move daemonize() to libgit.a
</content>
</entry>
<entry>
<title>Merge branch 'mw/symlinks'</title>
<updated>2014-02-27T22:01:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-02-27T22:01:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8a342058f62d24d6ff62a0f6e81d3e60291eae94'/>
<id>urn:sha1:8a342058f62d24d6ff62a0f6e81d3e60291eae94</id>
<content type='text'>
All subcommands that take pathspecs mishandled an in-tree symbolic
link when given it as a full path from the root (which arguably is
a sick way to use pathspecs).  "git ls-files -s $(pwd)/RelNotes" in
our tree is an easy reproduction recipe.

* mw/symlinks:
  setup: don't dereference in-tree symlinks for absolute paths
  setup: add abspath_part_inside_repo() function
  t0060: add tests for prefix_path when path begins with work tree
  t0060: add test for prefix_path when path == work tree
  t0060: add test for prefix_path on symlinks via absolute paths
  t3004: add test for ls-files on symlinks via absolute paths
</content>
</entry>
<entry>
<title>daemon: move daemonize() to libgit.a</title>
<updated>2014-02-10T18:46:35Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-02-08T07:08:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de0957ce2e88b8ad639f1e4a7197eb556e114a1c'/>
<id>urn:sha1:de0957ce2e88b8ad639f1e4a7197eb556e114a1c</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: don't dereference in-tree symlinks for absolute paths</title>
<updated>2014-02-04T20:08:49Z</updated>
<author>
<name>Martin Erik Werner</name>
<email>martinerikwerner@gmail.com</email>
</author>
<published>2014-02-04T14:25:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=655ee9ea3e6c0af57d320e84723ec3bf656cdbf7'/>
<id>urn:sha1:655ee9ea3e6c0af57d320e84723ec3bf656cdbf7</id>
<content type='text'>
The prefix_path_gently() function currently applies real_path to
everything if given an absolute path, dereferencing symlinks both
outside and inside the work tree.

This causes most high-level functions to misbehave when acting on
symlinks given via absolute paths. For example

	$ git add /dir/repo/symlink

attempts to add the target of the symlink rather than the symlink
itself, which is usually not what the user intends to do.

In order to manipulate symlinks in the work tree using absolute paths,
symlinks should only be dereferenced outside the work tree.

Modify the prefix_path_gently() to first normalize the path in order to
make sure path levels are separated by '/', then pass the result to
'abspath_part_inside_repo' to find the part inside the work tree
(without dereferencing any symlinks inside the work tree).

For absolute paths, prefix_path_gently() did not, nor does now do, any
actual prefixing, hence the result from abspath_part_in_repo() is
returned as-is.

Fixes t0060-82 and t3004-5.

Signed-off-by: Martin Erik Werner &lt;martinerikwerner@gmail.com&gt;
Reviewed-by: Duy Nguyen &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: add abspath_part_inside_repo() function</title>
<updated>2014-02-04T20:08:49Z</updated>
<author>
<name>Martin Erik Werner</name>
<email>martinerikwerner@gmail.com</email>
</author>
<published>2014-02-04T14:25:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ddc2a6281595fd24ea01497c496f88c40a59562f'/>
<id>urn:sha1:ddc2a6281595fd24ea01497c496f88c40a59562f</id>
<content type='text'>
In order to extract the part of an absolute path which lies inside the
repo, it is not possible to directly use real_path, since that would
dereference symlinks both outside and inside the work tree.

Add an abspath_part_inside_repo() function which first checks if the
work tree is already the prefix, then incrementally checks each path
level by temporarily NUL-terminating at each '/' and comparing against
the work tree path. If a match is found, it overwrites the input path
with the remainder past the work tree (which will be the part inside the
work tree).

This function is currently only intended for use in
'prefix_path_gently'.

Signed-off-by: Martin Erik Werner &lt;martinerikwerner@gmail.com&gt;
Reviewed-by: Duy Nguyen &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>replace {pre,suf}fixcmp() with {starts,ends}_with()</title>
<updated>2013-12-05T22:13:21Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2013-11-30T20:55:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=59556548230e617b837343c2c07e357e688e2ca4'/>
<id>urn:sha1:59556548230e617b837343c2c07e357e688e2ca4</id>
<content type='text'>
Leaving only the function definitions and declarations so that any
new topic in flight can still make use of the old functions, replace
existing uses of the prefixcmp() and suffixcmp() with new API
functions.

The change can be recreated by mechanically applying this:

    $ git grep -l -e prefixcmp -e suffixcmp -- \*.c |
      grep -v strbuf\\.c |
      xargs perl -pi -e '
        s|!prefixcmp\(|starts_with\(|g;
        s|prefixcmp\(|!starts_with\(|g;
        s|!suffixcmp\(|ends_with\(|g;
        s|suffixcmp\(|!ends_with\(|g;
      '

on the result of preparatory changes in this series.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: trivial style fixes</title>
<updated>2013-10-31T20:48:32Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2013-10-31T09:25:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=abf03eeb8e99538cd31806d5f252214b9fe695a6'/>
<id>urn:sha1:abf03eeb8e99538cd31806d5f252214b9fe695a6</id>
<content type='text'>
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jx/relative-path-regression-fix'</title>
<updated>2013-10-28T17:42:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-10-28T17:42:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e22c1c7f19914aa0dc1b6fe65bbfafed265d6e7f'/>
<id>urn:sha1:e22c1c7f19914aa0dc1b6fe65bbfafed265d6e7f</id>
<content type='text'>
* jx/relative-path-regression-fix:
  Use simpler relative_path when set_git_dir
  relative_path should honor dos-drive-prefix
  test: use unambigous leading path (/foo) for MSYS
</content>
</entry>
</feed>
