Git development
 help / color / mirror / Atom feed
From: Marco Costalba <mcostalba@yahoo.it>
To: git@vger.kernel.org
Subject: [PATCH] Extend git-ls-files --exclude option to match against directories
Date: Sun, 24 Jul 2005 01:12:25 -0700 (PDT)	[thread overview]
Message-ID: <20050724081225.81671.qmail@web26304.mail.ukl.yahoo.com> (raw)

Pattern in git-ls-files --exclude=<pattern> can include directories
as example git-ls-files --exclude=Documentation/* will do what you expect
---

 ls-files.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

c8fdfc1f8280a753baf13c293db573c4e50f0a99
diff --git a/ls-files.c b/ls-files.c
--- a/ls-files.c
+++ b/ls-files.c
@@ -80,10 +80,8 @@ static int excluded(const char *pathname
 {
 	int i;
 	if (nr_excludes) {
-		const char *basename = strrchr(pathname, '/');
-		basename = (basename) ? basename+1 : pathname;
 		for (i = 0; i < nr_excludes; i++)
-			if (fnmatch(excludes[i], basename, 0) == 0)
+			if (fnmatch(excludes[i], pathname, FNM_PATHNAME) == 0)
 				return 1;
 	}
 	return 0;


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

                 reply	other threads:[~2005-07-24  8:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050724081225.81671.qmail@web26304.mail.ukl.yahoo.com \
    --to=mcostalba@yahoo.it \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox