From c04318e46aae79b8b8df059e2118519d83dfee12 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Sun, 6 Jan 2013 16:58:04 +0000 Subject: dir.c: keep track of where patterns came from For exclude patterns read in from files, the filename is stored in the exclude list, and the originating line number is stored in the individual exclude (counting starting at 1). For exclude patterns provided on the command line, a string describing the source of the patterns is stored in the exclude list, and the sequence number assigned to each exclude pattern is negative, with counting starting at -1. So for example the 2nd pattern provided via --exclude would be numbered -2. This allows any future consumers of that data to easily distinguish between exclude patterns from files vs. from the CLI. Signed-off-by: Adam Spiers Signed-off-by: Junio C Hamano --- builtin/clean.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin/clean.c') diff --git a/builtin/clean.c b/builtin/clean.c index dd8973700a..b098288ad1 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -97,10 +97,10 @@ int cmd_clean(int argc, const char **argv, const char *prefix) if (!ignored) setup_standard_excludes(&dir); - add_exclude_list(&dir, EXC_CMDL); + add_exclude_list(&dir, EXC_CMDL, "--exclude option"); for (i = 0; i < exclude_list.nr; i++) add_exclude(exclude_list.items[i].string, "", 0, - &dir.exclude_list_group[EXC_CMDL].el[0]); + &dir.exclude_list_group[EXC_CMDL].el[0], -(i+1)); pathspec = get_pathspec(prefix, argv); -- cgit v1.2.3