On Sun, Jan 06, 2013 at 10:53:11PM +0000, Adam Spiers wrote:
That's a valid point. However, the ary[0] part which assumes external
knowledge of the internal implementation can trivially be avoided by
squashing this patch onto the commit we are discussing:
[snipped]
quoted hunk ↗ jump to hunk
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index 0ca9d8e..0406adc 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -420,10 +420,11 @@ static int option_parse_z(const struct option *opt,
static int option_parse_exclude(const struct option *opt,
const char *arg, int unset)
{
- struct exclude_list_group *group = opt->value;
+ struct string_list *exclude_list = opt->value;
exc_given = 1;
- add_exclude(arg, "", 0, &group->el[0]);
+ string_list_append(exclude_list, arg);
+ fprintf(stderr, "append %s\n", arg);
Whoops :-)
[snipped]
quoted hunk ↗ jump to hunk
@@ -524,9 +527,13 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
if (read_cache() < 0)
die("index file corrupt");
- add_exclude_list(&dir, EXC_CMDL);
argc = parse_options(argc, argv, prefix, builtin_ls_files_options,
ls_files_usage, 0);
+ el = add_exclude_list(&dir, EXC_CMDL);
+ for (i = 0; i < exclude_list.nr; i++) {
+ fprintf(stderr, "adding exclude: %s\n", exclude_list.items[i].string);
Excluding those two fprintf() calls, of course :-)
I've removed them, and pushed to my github fork a new version of v4
with the fixed version of this patch inserted in the appropriate place
(and labelled with a "[SQUASH]" prefix):
git://github.com/aspiers/git.git
https://github.com/aspiers/git/commits/check-ignore
Since I sent v4 earlier today, to avoid spamming this list, I won't
resend the whole series yet - not until we have made some progress in
reviewing v4.