git/list[1] front-page[2] threads[3] people[4] search[5] about
 

help: the question about relative path in the objects/info/alternates

From
JWJason Wang <jason77.wang@gmail.com>
Date
Aug 1, 2011, 09:16 UTC
Message-ID
<4E366F08.2060808@gmail.com>
Hi git experts,
 From the objects/info/alternates part of this URL 
http://www.kernel.org/pub/software/scm/git/docs/gitrepository-layout.html, 
it says it will work if alternates has relative path in it. But i found 
it will always fail under below situation, i don't know whether the 
failure is due to the git nature or it is a git potential bug.

The failure situation is like that: On my machine, i have a git bare base repository, e.g. /home/jason/source/base-bare. On the same machine, i have a git bare incremental (it need to refer to base repository) repository, e.g. /home/jason/source/incremental-bare. In the incremental-bare/objects/info/alternates, i set a relative path to point to the objects of base-bare like this "../../base-bare/objects". Then i want to clone a new repository from the incremental-bare on the same machine, if i use this command "git clone /home/jason/source/incremental-bare new-project", it will fail; but if i use this command "git clone file:///home/jason/source/incremental-bare new-project", it will work successfully, Why the first one can't work, it is a bug for git?

In addtion, if i write an absolute path in the incremental-bare/objects/info/alternates like this "/home/jason/source/base-bare/objects", it will always work well no matter i add or don't add "file://".

Thanks Jason Wang.

Next: Junio C Hamano
Message 1 of 3 in “help: the question about relative path in the objects/info/alternates”
  1. Jason WangAug 1, 2011
  2. Junio C HamanoAug 1, 2011
  3. Jason WangAug 2, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.