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

Re: [PATCH/RFC 3/3] ls-files/dir: use is_git_repo to detect submodules

From
Andreas Krey <a.krey@gmx.de>
Date
Dec 6, 2015, 16:59 UTC
Message-ID
<20151206165926.GI22288@inner.h.apk.li>
In-Reply-To
<20151205073744.GC21639@sigill.intra.peff.net>

On Sat, 05 Dec 2015 02:37:44 +0000, Jeff King wrote: ...

> Hrm. Weird. You'd think it would break with the existing code if I do
> this, then:
> 
...
> -		(cd a/b/c; git init) &&
> +		(cd a/b/c; git init && git commit --allow-empty -m foo) &&
>  		git config remote.origin.url ../foo/bar.git &&
>  		git submodule add ../bar/a/b/c ./a/b/c &&
I tried a -f here instead; did not work either.

I guess I will first wade through the other failures my 'fix' causes to see the total damage.

...
Show 5 quoted lines
> We know it is a git dir, but there is no sha1 for us to actually add as
> the gitlink entry.
> 
> If that is the case, then there is either some very tricky refactoring
> required,

Yes, it looks like the return code delivered need to be slightly different dependent on the user.

> or what we are trying to do here is simply wrong. Maybe it
> would be simpler to just speed up resolve_gitlink_ref with a better data
> structure.

Which is what I did on square one, but now we already have a real fix for git clean, and now it's even less advantageous the fix the consequence (the submodule cache blowing up) instead of the cause (asking for it in the first place).

I don't think we should let is_git_repository look for a valid(ish) HEAD.
Andreas
PS: I seem to not quite have send-email under control, the envelope from
    seems to made the patches not reach the mailing list (nor me in the CC).
-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800
Previous: Jeff KingNext: Jeff King
Message 4 of 5 in “Re: [PATCH 1/3] externalize is_git_repository”
  1. Jeff KingDec 5, 2015
  2. Jeff KingDec 5, 2015
  3. Jeff KingDec 5, 2015
  4. Andreas KreyDec 6, 2015
  5. Jeff KingDec 7, 2015

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.