grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v2.19-6-g7585d81


From: Paul Eggert
Subject: grep branch, master, updated. v2.19-6-g7585d81
Date: Sat, 24 May 2014 21:07:38 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  7585d81dcc262613aead279c22b56c7cffeeef3f (commit)
      from  085f98bba131b708bf68e7162f19324629e3263a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=7585d81dcc262613aead279c22b56c7cffeeef3f


commit 7585d81dcc262613aead279c22b56c7cffeeef3f
Author: Paul Eggert <address@hidden>
Date:   Sat May 24 14:06:29 2014 -0700

    grep: --exclude-dir=FOO/ now ignores the trailing slash
    
    Problem reported by Khaled Ziyaeen; see: http://bugs.gnu.org/17481
    * NEWS, doc/grep.texi (File and Directory Selection): Document this.
    * src/grep.c (main): Implement this.
    * tests/include-exclude: Test this.

diff --git a/NEWS b/NEWS
index bf31940..10b2d19 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,11 @@ GNU grep NEWS                                    -*- outline 
-*-
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** Changes in behavior
+
+  grep --exclude-dir='FOO/' now excludes the directory FOO.
+  Previously, the trailing slash meant the option was ineffective.
+
 
 * Noteworthy changes in release 2.19 (2014-05-22) [stable]
 
diff --git a/doc/grep.texi b/doc/grep.texi
index feee0d8..c9417e5 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -668,8 +668,8 @@ under @option{--exclude}).
 @item address@hidden
 @opindex --exclude-dir
 @cindex exclude directories
-Exclude directories matching the pattern @var{dir} from recursive
-directory searches.
+Skip any directory whose name matches the pattern @var{dir}, ignoring
+any redundant trailing slashes in @var{dir}.
 
 @item -I
 Process a binary file as if it did not contain matching data;
diff --git a/src/grep.c b/src/grep.c
index ec955d8..6a2a029 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -2234,6 +2234,7 @@ main (int argc, char **argv)
       case EXCLUDE_DIRECTORY_OPTION:
         if (!excluded_directory_patterns)
           excluded_directory_patterns = new_exclude ();
+        strip_trailing_slashes (optarg);
         add_exclude (excluded_directory_patterns, optarg, EXCLUDE_WILDCARDS);
         break;
 
diff --git a/tests/include-exclude b/tests/include-exclude
index 28465cb..9c07139 100755
--- a/tests/include-exclude
+++ b/tests/include-exclude
@@ -36,6 +36,10 @@ grep -r --exclude-dir=dir . x > out || fail=1
 sort out > k && mv k out
 compare exp-not-dir out || fail=1
 
+grep -r --exclude-dir=dir/ . x > out || fail=1
+sort out > k && mv k out
+compare exp-not-dir out || fail=1
+
 # Test with a non-glob.
 grep -r --include=a    . x > out || fail=1
 # no need to sort

-----------------------------------------------------------------------

Summary of changes:
 NEWS                  |    5 +++++
 doc/grep.texi         |    4 ++--
 src/grep.c            |    1 +
 tests/include-exclude |    4 ++++
 4 files changed, 12 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]