<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/path.c, branch v1.8.0.2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2012-09-04T20:34:46Z</updated>
<entry>
<title>path.c: Use vsnpath() in the implementation of git_path()</title>
<updated>2012-09-04T20:34:46Z</updated>
<author>
<name>Ramsay Jones</name>
<email>ramsay@ramsay1.demon.co.uk</email>
</author>
<published>2012-09-04T17:29:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=5c44252e13db2324d7c79d2b498886a925055111'/>
<id>urn:sha1:5c44252e13db2324d7c79d2b498886a925055111</id>
<content type='text'>
The current implementation of git_path() is essentially the same as
that of vsnpath(), with two minor differences. First, git_path()
currently insists that the git directory path is no longer than
PATH_MAX-100 characters in length. However, vsnpath() does not
attempt this arbitrary 100 character reservation for the remaining
path components. Second, vsnpath() uses the "is_dir_sep()" macro,
rather than comparing directly to '/', to determine if the git_dir
path component ends with a path separator.

In order to benefit from the above improvements, along with increased
compatability with git_snpath() and git_pathdup(), we reimplement the
git_path() function using vsnpath().

Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path.c: Don't discard the return value of vsnpath()</title>
<updated>2012-09-04T20:34:46Z</updated>
<author>
<name>Ramsay Jones</name>
<email>ramsay@ramsay1.demon.co.uk</email>
</author>
<published>2012-09-04T17:27:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=66a51a9aaec3f53250b1d515a1bd81044ebb354b'/>
<id>urn:sha1:66a51a9aaec3f53250b1d515a1bd81044ebb354b</id>
<content type='text'>
The git_snpath() and git_pathdup() functions both use the (static)
function vsnpath() in their implementation. Also, they both discard
the return value of vsnpath(), which has the effect of ignoring the
side effect of calling cleanup_path() in the non-error return path.

In order to ensure that the required cleanup happens, we use the
pointer returned by vsnpath(), rather than the buffer passed into
vsnpath(), to derive the return value from git_snpath() and
git_pathdup().

Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path.c: Remove the 'git_' prefix from a file scope function</title>
<updated>2012-09-04T20:34:46Z</updated>
<author>
<name>Ramsay Jones</name>
<email>ramsay@ramsay1.demon.co.uk</email>
</author>
<published>2012-09-04T17:26:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=5b3b8fa2ab188908332358d2c2576491969cd580'/>
<id>urn:sha1:5b3b8fa2ab188908332358d2c2576491969cd580</id>
<content type='text'>
In particular, the git_vsnpath() function, despite the 'git_' prefix
suggesting otherwise, is (correctly) declared with file scope.

Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>config: read (but not write) from $XDG_CONFIG_HOME/git/config file</title>
<updated>2012-06-25T16:05:55Z</updated>
<author>
<name>Huynh Khoi Nguyen Nguyen</name>
<email>Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr</email>
</author>
<published>2012-06-22T09:03:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=21cf32279120799a766d22416be7d82d9ecfbd04'/>
<id>urn:sha1:21cf32279120799a766d22416be7d82d9ecfbd04</id>
<content type='text'>
Teach git to read the "gitconfig" information from a new location,
$XDG_CONFIG_HOME/git/config; this allows the user to avoid
cluttering $HOME with many per-application configuration files.

In the order of reading, this file comes between the global
configuration file (typically $HOME/.gitconfig) and the system wide
configuration file (typically /etc/gitconfig).

We do not write to this new location (yet).

If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config/git/config
will be used. This is in line with XDG specification.

If the new file does not exist, the behavior is unchanged.

Signed-off-by: Huynh Khoi Nguyen Nguyen &lt;Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr&gt;
Signed-off-by: Valentin Duperray &lt;Valentin.Duperray@ensimag.imag.fr&gt;
Signed-off-by: Franck Jonas &lt;Franck.Jonas@ensimag.imag.fr&gt;
Signed-off-by: Lucien Kong &lt;Lucien.Kong@ensimag.imag.fr&gt;
Signed-off-by: Thomas Nguy &lt;Thomas.Nguy@ensimag.imag.fr&gt;
Signed-off-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>standardize and improve lookup rules for external local repos</title>
<updated>2012-02-03T00:41:55Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-02-02T21:59:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b3256eb8b35937192e85725d0c2bcb422295790c'/>
<id>urn:sha1:b3256eb8b35937192e85725d0c2bcb422295790c</id>
<content type='text'>
When you specify a local repository on the command line of
clone, ls-remote, upload-pack, receive-pack, or upload-archive,
or in a request to git-daemon, we perform a little bit of
lookup magic, doing things like looking in working trees for
.git directories and appending ".git" for bare repos.

For clone, this magic happens in get_repo_path. For
everything else, it happens in enter_repo. In both cases,
there are some ambiguous or confusing cases that aren't
handled well, and there is one case that is not handled the
same by both methods.

This patch tries to provide (and test!) standard, sensible
lookup rules for both code paths. The intended changes are:

  1. When looking up "foo", we have always preferred
     a working tree "foo" (containing "foo/.git" over the
     bare "foo.git". But we did not prefer a bare "foo" over
     "foo.git". With this patch, we do so.

  2. We would select directories that existed but didn't
     actually look like git repositories. With this patch,
     we make sure a selected directory looks like a git
     repo. Not only is this more sensible in general, but it
     will help anybody who is negatively affected by change
     (1) negatively (e.g., if they had "foo.git" next to its
     separate work tree "foo", and expect to keep finding
     "foo.git" when they reference "foo").

  3. The enter_repo code path would, given "foo", look for
     "foo.git/.git" (i.e., do the ".git" append magic even
     for a repo with working tree). The clone code path did
     not; with this patch, they now behave the same.

In the unlikely case of a working tree overlaying a bare
repo (i.e., a ".git" directory _inside_ a bare repo), we
continue to treat it as a working tree (prefering the
"inner" .git over the bare repo). This is mainly because the
combination seems nonsensical, and I'd rather stick with
existing behavior on the off chance that somebody is relying
on it.

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>Learn to handle gitfiles in enter_repo</title>
<updated>2011-10-04T20:30:38Z</updated>
<author>
<name>Phil Hord</name>
<email>phil.hord@gmail.com</email>
</author>
<published>2011-10-04T20:05:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=03106768afa0be60346bb335f9fd11063622c91d'/>
<id>urn:sha1:03106768afa0be60346bb335f9fd11063622c91d</id>
<content type='text'>
The enter_repo() function is used to navigate into a .git
directory.  It knows how to find standard alternatives (DWIM) but
it doesn't handle gitfiles created by git init --separate-git-dir.
This means that git-fetch and others do not work with repositories
using the separate-git-dir mechanism.

Teach enter_repo() to deal with the gitfile mechanism by resolving
the path to the redirected path and continuing tests on that path
instead of the found file.

Signed-off-by: Phil Hord &lt;hordp@cisco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>enter_repo: do not modify input</title>
<updated>2011-10-04T20:30:38Z</updated>
<author>
<name>Erik Faye-Lund</name>
<email>kusmabite@gmail.com</email>
</author>
<published>2011-10-04T20:02:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=1c64b48e67c2c83508c45817002468a9a633c991'/>
<id>urn:sha1:1c64b48e67c2c83508c45817002468a9a633c991</id>
<content type='text'>
entr_repo(..., 0) currently modifies the input to strip away
trailing slashes. This means that we some times need to copy the
input to keep the original.

Change it to unconditionally copy it into the used_path buffer so
we can safely use the input without having to copy it. Also store
a working copy in validated_path up-front before we start
resolving anything.

Signed-off-by: Erik Faye-Lund &lt;kusmabite@gmail.com&gt;
Signed-off-by: Phil Hord &lt;hordp@cisco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>read_gitfile_gently(): rename misnamed function to read_gitfile()</title>
<updated>2011-08-22T21:04:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-08-22T21:04:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=13d6ec913330ba90fb1a67ec5789e437f8ac4193'/>
<id>urn:sha1:13d6ec913330ba90fb1a67ec5789e437f8ac4193</id>
<content type='text'>
The function was not gentle at all to the callers and died without giving
them a chance to deal with possible errors. Rename it to read_gitfile(),
and update all the callers.

As no existing caller needs a true "gently" variant, we do not bother
adding one at this point.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Name make_*_path functions more accurately</title>
<updated>2011-03-17T23:08:30Z</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@elego.de</email>
</author>
<published>2011-03-17T11:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e2a57aac8a8a2b786739a5a93ea9dcfd2f0fd0e2'/>
<id>urn:sha1:e2a57aac8a8a2b786739a5a93ea9dcfd2f0fd0e2</id>
<content type='text'>
Rename the make_*_path functions so it's clearer what they do, in
particlar make clear what the differnce between make_absolute_path and
make_nonrelative_path is by renaming them real_path and absolute_path
respectively. make_relative_path has an understandable name and is
renamed to relative_path to maintain the name convention.

The function calls have been replaced 1-to-1 in their usage.

Signed-off-by: Carlos Martín Nieto &lt;cmn@elego.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path helpers: move git_mkstemp* to wrapper.c</title>
<updated>2010-11-10T19:04:26Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2010-11-06T11:46:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=33f239365cce2682a1faac0d5670d684aa1981ad'/>
<id>urn:sha1:33f239365cce2682a1faac0d5670d684aa1981ad</id>
<content type='text'>
git_mkstemp_mode and related functions do not require access to
specialized git machinery, unlike some other functions from
path.c (like set_shared_perm()).  Move them to wrapper.c where
the wrapper xmkstemp_mode is defined.

This eliminates a dependency of wrapper.o on environment.o via
path.o.  With typical linkers (e.g., gcc), that dependency makes
programs that use functions from wrapper.o and not environment.o
or path.o larger than they need to be.

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
