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

Re: Alternates corruption issue

From
Jeff King <peff@peff.net>
Date
Jan 31, 2012, 21:47 UTC
Message-ID
<20120131214740.GA2465@sigill.intra.peff.net>
In-Reply-To
<20120131214047.GA13547@burratino>
On Tue, Jan 31, 2012 at 03:40:47PM -0600, Jonathan Nieder wrote:
Show 15 quoted lines
> Jeff King wrote:
> 
> > No, it does not match. While the sequence I outlined above makes the
> > most sense to me, it does not match what setup_git_directory does, which
> > prefers "foo/.git" to using "foo" as a bare repo. I think being
> > consistent between all of the lookup points makes sense. The patch took
> > the least-invasive approach and aligned clone and enter_repo with
> > setup_git_directory.
> >
> > However, we could also tweak setup_git_directory to prefer bare repos
> > over ".git" to keep things consistent. While it makes me feel good from
> > a theoretical standpoint (because the rules above seem simple and
> > intuitive to me), I'm not sure it's a good idea in practice.
> 
> Wait, don't these two functions serve two completely different purposes?
Yes, but I would expect the lookup to be the same.
Show 8 quoted lines
> One is the implementation of (A):
> 
> 	cd foo
> 	git rev-parse --git-dir
> 
> The other implements (B):
> 
> 	git ls-remote foo
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
?

Maybe I am crazy, but I see all of them as ways of specifying "I am interested in repository foo", and any lookup magic should be the same in all cases.

Show 5 quoted lines
> If "foo" is actually a bare repository that moonlights as a worktree for
> a non-bare repository, then:
> 
>  1) Whoever set up these directories is completely insane[*].  Maybe we
>     should emit a warning.
Yes, I think we are dealing with an insane corner case.
>  2) As a naive user, I would expect (A) to give a different result
>     from (B).
Why?
-Peff
Previous: Jonathan NiederNext: Jonathan Nieder
Message 6 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.