Thread (28 messages) flat view 28 messages, 6 authors, 2016-06-15

Re: Dokumenting api-paths.txt

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:58:28

Possibly related (same subject, not in this thread)

Stefan Beller wrote:
quoted
quoted
On 08/20/2013 03:31 PM, Johannes Sixt wrote:
quoted
Stefan Beller wrote:
quoted
quoted
quoted
quoted
+    packdir = mkpathdup("%s/pack", get_object_directory());
+    packtmp = mkpathdup("%s/.tmp-%d-pack", packdir, getpid());
Should this not be

    packdir = xstrdup(git_path("pack"));
    packtmp = xstrdup(git_path("pack/.tmp-%d-pack", getpid()));
[...]
So if I have 
	packdir = xstrdup(git_path("pack"));
	...
	path = git_path("%s/%s", packdir, filename)

This produces something as:
.git/.git/objects/pack/.tmp-13199-pack-c59c5758ef159b272f6ab10cb9fadee443966e71.idx
definitely having one .git too much.
The version with get_object_directory() was right.  The object
directory is not even necessarily under .git/, since it can be
overridden using the GIT_OBJECT_DIRECTORY envvar.
Also interesting to add would be that git_path operates in the
.git/objects directory?
git_path is for resolving paths within GIT_DIR, such as
git_path("config") and git_path("COMMIT_EDITMSG").

Jonathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help