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

[RFC] Second attempt at making git-clean a builtin

From
Shawn Bohrer <shawn.bohrer@gmail.com>
Date
Nov 4, 2007, 19:02 UTC
Message-ID
<1194202941253-git-send-email-shawn.bohrer@gmail.com>
I've taken all of the comments I received from my previous attempt see:
http://marc.info/?l=git&m=119181975419521&w=2

With these new changes in place my new git-clean passes all of the original tests as well as the new tests I've added. While looking at how git-ls-files walks the tree there were some things that didn't quite understand, or thought might be unnecessary so there may be some things I missed. For example I'm still not quite sure what verify_pathspec() does.

I did however notice what I would call a bug in the behavior of git-ls-files and therefore the current git-clean.sh. With the current git-clean if you have two directories that contain only untracked files, for example docs/ and examples/ running:

git clean docs/ examples/

will not remove either directory. Instead you must use the -d parameter. To me this makes sense, however if you run:

git clean docs/

it will remove the docs directory without using the -d parameter. My patch is at least consistent in that it requires the -d in both cases.

Next: Shawn Bohrer
Message 1 of 15 in “[RFC] Second attempt at making git-clean a builtin”
  1. Shawn BohrerNov 4, 2007
  2. Add more tests for git-cleanShawn Bohrer, Nov 4, 2007
  3. Make git-clean a builtinShawn Bohrer, Nov 4, 2007
  4. Pierre HabouzitNov 4, 2007
  5. 3/2 Use parse-options in builtin-cleanJohannes Schindelin, Nov 4, 2007
  6. Pierre HabouzitNov 4, 2007
  7. Junio C HamanoNov 5, 2007
  8. Carlos RicaNov 5, 2007
  9. Junio C HamanoNov 5, 2007
  10. Shawn BohrerNov 6, 2007
  11. Junio C HamanoNov 6, 2007
  12. Junio C HamanoNov 4, 2007
  13. Pierre HabouzitNov 4, 2007
  14. Junio C HamanoNov 5, 2007
  15. Johannes SchindelinNov 4, 2007

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.