summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 45f75a0)
raw | patch | inline | side by side (parent: 45f75a0)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 8 May 2006 19:02:44 +0000 (12:02 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 8 May 2006 23:40:45 +0000 (16:40 -0700) |
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>
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>
Documentation/git-clean.txt | patch | blob | history | |
git-clean.sh | patch | blob | history |
index 36890c543d1eac30167b3c267c10db9b0f5b2fa2..c61afbcdbac49ccbb7ee755e3fdb19d7d77225d0 100644 (file)
SYNOPSIS
--------
[verse]
-'git-clean' [-d] [-n] [-q] [-x | -X]
+'git-clean' [-d] [-n] [-q] [-x | -X] [--] <paths>...
DESCRIPTION
-----------
from files that are not under version control. If the '-x' option is
specified, ignored files are also removed, allowing to remove all
build products.
+When optional `<paths>...` arguments are given, the paths
+affected are further limited to those that match them.
+
OPTIONS
-------
diff --git a/git-clean.sh b/git-clean.sh
index b200868e605f27c22252de5bc14a62dfef60ea18..bb56264e046c906c529c712b36db239dd7ba99e9 100755 (executable)
--- a/git-clean.sh
+++ b/git-clean.sh
# Copyright (c) 2005-2006 Pavel Roskin
#
-USAGE="[-d] [-n] [-q] [-x | -X]"
+USAGE="[-d] [-n] [-q] [-x | -X] [--] <paths>..."
LONG_USAGE='Clean untracked files from the working directory
-d remove directories as well
-n don'\''t remove anything, just show what would be done
-q be quiet, only report errors
-x remove ignored files as well
- -X remove only ignored files as well'
+ -X remove only ignored files
+When optional <paths>... arguments are given, the paths
+affected are further limited to those that match them.'
SUBDIRECTORY_OK=Yes
. git-sh-setup
-X)
ignoredonly=1
;;
- *)
+ --)
+ shift
+ break
+ ;;
+ -*)
usage
+ ;;
+ *)
+ break
esac
shift
done
fi
fi
-git-ls-files --others --directory $excl ${excl_info:+"$excl_info"} |
+git-ls-files --others --directory $excl ${excl_info:+"$excl_info"} -- "$@" |
while read -r file; do
if [ -d "$file" -a ! -L "$file" ]; then
if [ -z "$cleandir" ]; then