summaryrefslogtreecommitdiff
path: root/git-clean.sh
AgeCommit message (Collapse)Author
2007-11-14git-clean: honor core.excludesfileJunio C Hamano
git-clean did not honor core.excludesfile configuration variable, although some other commands such as git-add and git-status did. Fix this inconsistency. Original report and patch from Shun'ichi Fuji. Rewritten by me and bugs and tests are mine. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-23Supplant the "while case ... break ;; esac" idiomDavid Kastrup
A lot of shell scripts contained stuff starting with while case "$#" in 0) break ;; esac and similar. I consider breaking out of the condition instead of the body od the loop ugly, and the implied "true" value of the non-matching case is not really obvious to humans at first glance. It happens not to be obvious to some BSD shells, either, but that's because they are not POSIX-compliant. In most cases, this has been replaced by a straight condition using "test". "case" has the advantage of being faster than "test" on vintage shells where "test" is not a builtin. Since none of them is likely to run the git scripts, anyway, the added readability should be worth the change. A few loops have had their termination condition expressed differently. Signed-off-by: David Kastrup <dak@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03Rewrite "git-frotz" to "git frotz"Junio C Hamano
This uses the remove-dashes target to replace "git-frotz" to "git frotz". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-04-24Add clean.requireForce option, and add -f option to git-clean to override itJosh Triplett
Add a new configuration option clean.requireForce. If set, git-clean will refuse to run, unless forced with the new -f option, or not acting due to -n. Signed-off-by: Josh Triplett <josh@freedesktop.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-10Disallow working directory commands in a bare repository.Shawn O. Pearce
If the user tries to run a porcelainish command which requires a working directory in a bare repository they may get unexpected results which are difficult to predict and may differ from command to command. Instead we should detect that the current repository is a bare repository and refuse to run the command there, as there is no working directory associated with it. [jc: updated Shawn's original somewhat -- bugs are mine.] Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-06git-clean: Fix the -q option.Alexandre Julliard
The 'quiet' flag is set by -q, but it's not used anywhere. Remove it and set the 'echo1' variable instead. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-30git-clean fails on files beginning with a dashDennis Stosberg
Reproducible with: $ git init-db $ echo "some text" >-file $ git clean Removing -file rm: invalid option -- l Try `rm --help' for more information. Signed-off-by: Dennis Stosberg <dennis@stosberg.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-08Teach git-clean optional <paths>... parameters.Junio C Hamano
When optional paths arguments are given, git-clean passes them to underlying git-ls-files; with this, you can say: git clean 'temp-*' to clean only the garbage files whose names begin with 'temp-'. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Pavel Roskin <proski@gnu.org>
2006-04-05Add git-clean commandPavel Roskin
This command removes untracked files from the working tree. This implementation is based on cg-clean with some simplifications. The documentation is included. [jc: with trivial documentation fix, noticed by Jakub Narebski] Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>