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

Re: [PATCH] Documentation/git-clean.txt: don't mention deletion of .git/modules/*

From
Mikko Rapeli <mikko.rapeli@iki.fi>
Date
Feb 8, 2016, 22:47 UTC
Message-ID
<20160208224739.GH6104@lakka.kapsi.fi>
In-Reply-To
<1454971010.2511.89.camel@mattmccutchen.net>
On Mon, Feb 08, 2016 at 05:36:50PM -0500, Matt McCutchen wrote:
Show 25 quoted lines
> On Mon, 2016-02-08 at 14:22 -0800, Junio C Hamano wrote:
> > Matt McCutchen <matt@mattmccutchen.net> writes:
> > 
> > > I found no evidence of such behavior in the source code.
> > > 
> > > Signed-off-by: Matt McCutchen <matt@mattmccutchen.net>
> > > ---
> > 
> > That was added last year at bcd57cb9 (Documentation/git-clean.txt:
> > document that -f may need to be given twice, 2015-02-26).  It would
> > be better to know what got changed since then--that is, was the
> > additional text unnecessary even back then, or we made changes to
> > the system since then and forgot to remove the added text.
> > 
> > Mikko, is this need to give -f twice still the case?
> 
> I know you probably want confirmation from Mikko, but I'll offer my
> understanding.  There were two statements added in bcd57cb9:
> 
> 1. -f may need to be given twice to delete nested worktrees and
> embedded repositories.  This is still true.
>
> 2. Deletion of submodule repositories under .git/modules is conditional
> on -f being given twice.  AFAICT, this was wrong even back then: "git
> clean" has never deleted such repositories under any conditions.

This is the use case which I've used double -f at work with several build jobs but with older 1:1.7.9.5-1ubuntu0.2 (Ubuntu 12.04) and 1:1.9.1-1ubuntu0.2 (Ubuntu 14.04) versions of git.

But I can confirm that git version 1:2.7.0~rc3-1 (Debian unstable) is no longer removing the git submodule trees from .git/modules with double -f.

At work, we really want to remove the .git/modules subtrees since we want to test changes to .git/modules structure via normal commits to the git trees. Thus we need a way removing all non-tracked files from the git tree which includes obsolete (or for test only) git submodule trees.

I will test the old versions tomorrow again. Maybe in older git versions the code path from 1) deletes also the git modules from 2).

-Mikko
Previous: Matt McCutchenNext: Mikko Rapeli
Message 5 of 9 in “Documentation/git-clean.txt: don't mention deletion of .git/modules/*”
  1. Documentation/git-clean.txt: don't mention deletion of .git/modules/*Matt McCutchen, Feb 6, 2016
  2. Documentation/git-clean.txt: don't mention deletion of .git/modules/*Matt McCutchen, Feb 6, 2016
  3. Junio C HamanoFeb 8, 2016
  4. Matt McCutchenFeb 8, 2016
  5. Mikko RapeliFeb 8, 2016
  6. Mikko RapeliFeb 9, 2016
  7. Junio C HamanoFeb 9, 2016
  8. Matt McCutchenFeb 9, 2016
  9. Junio C HamanoFeb 8, 2016

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.