[PATCH] Unify the use of standard set of exclude files

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Wednesday, November 14, 2007 - 11:38 pm

Junio C Hamano <gitster@pobox.com> writes:


So here it is.

This teaches "git ls-files" to read the standard set of exclude
files when no exclude patterns nor files is given from the
command line.  We used to error out in such a case.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 builtin-ls-files.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index e0b856f..50dcb89 100644
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
@@ -542,11 +542,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
 		ps_matched = xcalloc(1, num);
 	}
 
-	if (dir.show_ignored && !exc_given) {
-		fprintf(stderr, "%s: --ignored needs some exclude pattern\n",
-			argv[0]);
-		exit(1);
-	}
+	if (dir.show_ignored && !exc_given)
+		setup_standard_excludes(&dir);
 
 	/* With no flags, we default to showing the cached files */
 	if (!(show_stage | show_deleted | show_others | show_unmerged |
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git-clean won't read global ignore, shunichi fuji, (Tue Nov 13, 2:49 pm)
Re: git-clean won't read global ignore, Pierre Habouzit, (Tue Nov 13, 3:50 pm)
Re: git-clean won't read global ignore, Junio C Hamano, (Wed Nov 14, 1:05 am)
Re: git-clean won't read global ignore, Andreas Ericsson, (Wed Nov 14, 1:42 am)
Re: git-clean won't read global ignore, Junio C Hamano, (Wed Nov 14, 2:03 am)
Re: git-clean won't read global ignore, Johannes Schindelin, (Wed Nov 14, 10:46 am)
Re: git-clean won't read global ignore, Miles Bader, (Wed Nov 14, 9:21 pm)
Re: git-clean won't read global ignore, Miles Bader, (Wed Nov 14, 9:33 pm)
[PATCH] Unify the use of standard set of exclude files, Junio C Hamano, (Wed Nov 14, 11:38 pm)
Re: [PATCH] Unify the use of standard set of exclude files, Junio C Hamano, (Thu Nov 15, 12:41 am)
Re: [PATCH] Unify the use of standard set of exclude files, Junio C Hamano, (Thu Nov 15, 2:03 am)
Re: git-clean won't read global ignore, Matthieu Moy, (Thu Nov 15, 3:07 am)
Re: git-clean won't read global ignore, Junio C Hamano, (Thu Nov 15, 10:27 am)
Re: git-clean won't read global ignore, Matthieu Moy, (Thu Nov 15, 10:50 am)