<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/path.c, branch v1.7.9.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.7.9.2</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.7.9.2'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2012-02-03T00:41:55Z</updated>
<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://www.git.shady.money/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://www.git.shady.money/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://www.git.shady.money/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://www.git.shady.money/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://www.git.shady.money/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://www.git.shady.money/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>
<entry>
<title>Merge branch 'hv/submodule-find-ff-merge'</title>
<updated>2010-08-22T06:27:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-08-22T06:27:59Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=2d984464c6be7ced6772a8dcf95d6a461a659a78'/>
<id>urn:sha1:2d984464c6be7ced6772a8dcf95d6a461a659a78</id>
<content type='text'>
* hv/submodule-find-ff-merge:
  Implement automatic fast-forward merge for submodules
  setup_revisions(): Allow walking history in a submodule
  Teach ref iteration module about submodules

Conflicts:
	submodule.c
</content>
</entry>
<entry>
<title>Sync with 1.7.0 series</title>
<updated>2010-07-27T22:01:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-07-27T22:01:36Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=e5498e8a9f9a596ecff78426bbf904626cd7863a'/>
<id>urn:sha1:e5498e8a9f9a596ecff78426bbf904626cd7863a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>config --get --path: check for unset $HOME</title>
<updated>2010-07-27T17:58:46Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2010-07-26T15:06:51Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=79bf149061fa29482512d903192a0d929e82872b'/>
<id>urn:sha1:79bf149061fa29482512d903192a0d929e82872b</id>
<content type='text'>
If $HOME is unset (as in some automated build situations),
currently

	git config --path path.home "~"
	git config --path --get path.home

segfaults.  Error out with

	Failed to expand user dir in: '~/'

instead.

Reported-by: Julien Cristau &lt;jcristau@debian.org&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Teach ref iteration module about submodules</title>
<updated>2010-07-07T16:48:21Z</updated>
<author>
<name>Heiko Voigt</name>
<email>hvoigt@hvoigt.net</email>
</author>
<published>2010-07-07T13:39:11Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=0bad611b1ebacf170976a10690bd0169f8d372bf'/>
<id>urn:sha1:0bad611b1ebacf170976a10690bd0169f8d372bf</id>
<content type='text'>
We will use this in a later patch to extend setup_revisions() to
load revisions directly from a submodule.

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