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

Re: [PATCH] Add git-clean command

From
Sam Ravnborg <sam@ravnborg.org>
Date
Apr 4, 2006, 10:58 UTC
Message-ID
<20060404105818.GA17326@mars.ravnborg.org>
In-Reply-To
<7vzmj2b3w3.fsf@assigned-by-dhcp.cox.net>
On Mon, Apr 03, 2006 at 05:06:36PM -0700, Junio C Hamano wrote:
Show 5 quoted lines
> 
> I am not opposed to the command in the sense that I do not want
> to forbid people from doing what they want to do, but on the
> other hand I do not see why people (apparently many people) want
> to have something like this.  Are their "make clean" broken?

No reason to waste time on make clean. git ls-files -o | xargs rm Does the same job nicely.

Other typical usecases for me: Remove temporaries that I created while trying out stuff. Often I have a bunch of files named 'x', 'xx', 'fisk' etc. around for no use. An easy way to remove these without breaking my 'allmodconfig' build is nice. It anyway > 1 hour to build and I like to get rid of the untracked stuff in an easy way.

So use cases goes like this:
- Remove everything not tracked by git (including .gitignore files)
- Remove everything except tracked by git or ignored
- Remove ignored files (replacement of make clean) (seldom)
Above should work both from top-level dir and in subdirectories.

That is my minimal expectations to git clean. What Pavel came up with cover everything except the make clean replacement part.

	Sam
Previous: Junio C HamanoNext: Pavel Roskin
Message 3 of 11 in “Add git-clean command”
  1. Add git-clean commandPavel Roskin, Apr 3, 2006
  2. Junio C HamanoApr 4, 2006
  3. Sam RavnborgApr 4, 2006
  4. Pavel RoskinApr 4, 2006
  5. unchecked uses of strdupJim Meyering, Apr 5, 2006
  6. Alex RiesenApr 6, 2006
  7. Pavel RoskinApr 5, 2006
  8. Martin WaitzApr 4, 2006
  9. Junio C HamanoApr 4, 2006
  10. Alex RiesenApr 4, 2006
  11. Pavel RoskinApr 4, 2006

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.