summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a777e9c)
raw | patch | inline | side by side (parent: a777e9c)
author | Jeff King <peff@peff.net> | |
Thu, 15 Nov 2007 07:04:30 +0000 (02:04 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 16 Nov 2007 06:24:10 +0000 (22:24 -0800) |
This provides a way for scripts to get at the new standard exclude
function.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
function.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-ls-files.txt | patch | blob | history | |
builtin-ls-files.c | patch | blob | history | |
git-add--interactive.perl | patch | blob | history |
index 9e454f0a4da465606afbed1720b7bd10cca8b241..2ec0c0d270edde03adff3f56531e4cee5fe05a57 100644 (file)
[-x <pattern>|--exclude=<pattern>]
[-X <file>|--exclude-from=<file>]
[--exclude-per-directory=<file>]
+ [--exclude-standard]
[--error-unmatch] [--with-tree=<tree-ish>]
[--full-name] [--abbrev] [--] [<file>]\*
read additional exclude patterns that apply only to the
directory and its subdirectories in <file>.
+--exclude-standard::
+ Add the standard git exclusions: .git/info/exclude, .gitignore
+ in each directory, and the user's global exclusion file.
+
--error-unmatch::
If any <file> does not appear in the index, treat this as an
error (return 1).
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index e0b856f4328a4df945f3dd0c3f0e1dc14020238f..7f607098305fcf14c3e2a7634b6a5dc118445306 100644 (file)
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
static const char ls_files_usage[] =
"git-ls-files [-z] [-t] [-v] (--[cached|deleted|others|stage|unmerged|killed|modified])* "
"[ --ignored ] [--exclude=<pattern>] [--exclude-from=<file>] "
- "[ --exclude-per-directory=<filename> ] [--full-name] [--abbrev] "
- "[--] [<file>]*";
+ "[ --exclude-per-directory=<filename> ] [--exclude-standard] "
+ "[--full-name] [--abbrev] [--] [<file>]*";
int cmd_ls_files(int argc, const char **argv, const char *prefix)
{
dir.exclude_per_dir = arg + 24;
continue;
}
+ if (!strcmp(arg, "--exclude-standard")) {
+ exc_given = 1;
+ setup_standard_excludes(&dir);
+ continue;
+ }
if (!strcmp(arg, "--full-name")) {
prefix_offset = 0;
continue;
index ac598f88e62fc8f48aaaac8376ccde63cb3e2643..0317ad9127b374a9ded536e6fb2c825a3b13828c 100755 (executable)
chomp $_;
$_;
}
- run_cmd_pipe(qw(git ls-files --others
- --exclude-per-directory=.gitignore),
- "--exclude-from=$GIT_DIR/info/exclude",
- '--', @_);
+ run_cmd_pipe(qw(git ls-files --others --exclude-standard --), @_);
}
my $status_fmt = '%12s %12s %s';