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

Re: Alternates corruption issue

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 31, 2012, 21:55 UTC
Message-ID
<20120131215501.GF13252@burratino>
In-Reply-To
<20120131214740.GA2465@sigill.intra.peff.net>
Jeff King wrote:
Show 15 quoted lines
> Right. But would you expect:
>
>   git ls-remote foo
>
> to behave the same as:
>
>   cd foo
>   git ls-remote .
>
> and would you furthermore expect that to behave the same as:
>
>   cd foo
>   git rev-parse --git-dir
>
> ?
Nah.  I never run "git ls-remote .". ;-)
[...]
>>  2) As a naive user, I would expect (A) to give a different result
>>     from (B).
>
> Why?

Normally git commands expect me to be in (possibly a deeply nested subdirectory) of the worktree. The typical case is a non-bare repository. I have been taught that it walks to the toplevel and finds a ".git" directory.

By contrast, the path passed to git transport commands like "git fetch otherhost:/foo/bar/baz.git" is a path to the git repository metadata. I am not allowed to pass a path to a subdirectory, for example.

As a user, when would the distinction ever come up? One is a fuzzy "which repository am I working in", and the other is a precise "point me to the metadata directory, but I allow you to abbreviate a little by leaving out the trailing .git".

Previous: Jeff KingNext: Jeff King
Message 7 of 19 in “Alternates corruption issue”
  1. Richard PurdieJan 31, 2012
  2. Jeff KingJan 31, 2012
  3. Junio C HamanoJan 31, 2012
  4. Jeff KingJan 31, 2012
  5. Jonathan NiederJan 31, 2012
  6. Jeff KingJan 31, 2012
  7. Jonathan NiederJan 31, 2012
  8. Jeff KingJan 31, 2012
  9. Jonathan NiederJan 31, 2012
  10. Jeff KingJan 31, 2012
  11. Jonathan NiederJan 31, 2012
  12. Jeff KingFeb 2, 2012
  13. Junio C HamanoFeb 3, 2012
  14. Jeff KingFeb 3, 2012
  15. Junio C HamanoFeb 3, 2012
  16. Jeff KingFeb 3, 2012
  17. Junio C HamanoFeb 3, 2012
  18. Jeff KingFeb 3, 2012
  19. Richard PurdieFeb 3, 2012

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.