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

Re: [PATCH] Use nonrelative paths instead of absolute paths for cloned repositories

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 6, 2008, 18:07 UTC
Message-ID
<7v7id2v3mw.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.1.00.0806061832330.1783@racer>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 15 quoted lines
>> In the longer term, we would inevitably face "when should one use 
>> nonrelative and when should one use absolute?" and we would eventually 
>> have to answer it.  It may turn out that many current users of 
>> "absolute" are better off using "nonrelative", but I suspect we won't 
>> get rid of "absolute" completely, because one of the reasons it avoids 
>> symlinks at great lengths is so that it can check the containment 
>> relationships between paths reliably (e.g. "is this path outside the 
>> repository, in which case we should refuse to add it to the index, and 
>> we use --no-index without being asked when running "diff"").
>> 
>> But using "absolute" for containment comparison is one thing.  Storing 
>> the result of "absolute" is quite another.
>
> The easy way would be to add an option to make_absolute_path(), say 
> "resolve_symlinks".
I am afraid that it does not solve anything.

Be they two separate functions, or a one function that has two different semantics depending on an option, the API documentation needs to answer the "when should I use one and when should I use the other" question.

And the hard part is figuring out which of the current "absolute" callers need to be fixed in a way similar to how Daniel fixed git-clone, and which of them stay the same. Perhaps all of the "chdir then getpwd" patterns need to be looked at and some of them need to be restructured to honor $PWD better. I dunno.

Previous: Johannes Schindelin
Message 6 of 6 in “Use nonrelative paths instead of absolute paths for cloned repositories”
  1. Use nonrelative paths instead of absolute paths for cloned repositoriesDaniel Barkalow, Jun 6, 2008
  2. Johannes SchindelinJun 6, 2008
  3. Daniel BarkalowJun 6, 2008
  4. Junio C HamanoJun 6, 2008
  5. Johannes SchindelinJun 6, 2008
  6. Junio C HamanoJun 6, 2008

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.