X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/463f5630a5e7cbe7f042bc1175d1fa1c4e98860f..c530e1c2a3a036d71942c354ba11b30a06341fd7:/lib-src/grep-changelog
diff --git a/lib-src/grep-changelog b/lib-src/grep-changelog
index 82a14efb38..0c7c42dc7c 100755
--- a/lib-src/grep-changelog
+++ b/lib-src/grep-changelog
@@ -1,23 +1,21 @@
#! /usr/bin/perl
-# Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1999-2011 Free Software Foundation, Inc.
#
# This file is part of GNU Emacs.
-#
-# GNU Emacs is free software; you can redistribute it and/or modify
+
+# GNU Emacs is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
# GNU Emacs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+
# You should have received a copy of the GNU General Public License
-# along with GNU Emacs; see the file COPYING. If not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
+# along with GNU Emacs. If not, see .
# Extract entries from ChangeLogs matching specified criteria.
@@ -35,55 +33,68 @@ use vars qw($author $regexp $exclude $from_date $to_date
@entries);
use Getopt::Long;
-my $result = GetOptions ("author=s" => \$author,
- "text=s" => \$regexp,
- "exclude=s" => \$exclude,
- "from-date=s" => \$from_date,
- "to-date=s" => \$to_date,
- "rcs-log" => \$rcs_log,
- "with-date" => \$with_date,
- "reverse!" => \$reverse,
- "version" => \$version,
- "help" => \$help);
-
-# If date options are specified, check that they have the format
-# YYYY-MM-DD.
-
-$result = 0 if $from_date && $from_date !~ /^\d\d\d\d-\d\d-\d\d$/;
-$result = 0 if $to_date && $to_date !~ /^\d\d\d\d-\d\d-\d\d$/;
+
+my $result;
+
+if (@ARGV == 0) {
+
+ # No arguments cannot possibly mean "show everything"!!
+ $result = 0;
+
+} else {
+
+ $result = GetOptions ("author=s" => \$author,
+ "text=s" => \$regexp,
+ "exclude=s" => \$exclude,
+ "from-date=s" => \$from_date,
+ "to-date=s" => \$to_date,
+ "rcs-log" => \$rcs_log,
+ "with-date" => \$with_date,
+ "reverse!" => \$reverse,
+ "version" => \$version,
+ "help" => \$help);
+
+ # If date options are specified, check that they have the format
+ # YYYY-MM-DD.
+
+ $result = 0 if $from_date && $from_date !~ /^\d\d\d\d-\d\d-\d\d$/;
+ $result = 0 if $to_date && $to_date !~ /^\d\d\d\d-\d\d-\d\d$/;
+}
# Print usage information and exit when necessary.
if ($result == 0 || $help) {
print < 0) {
- @ARGV = ("ChangeLog", map {"ChangeLog.$_"} reverse 1..9);
+ @ARGV = ("ChangeLog");
+
+ push @ARGV,
+ map {"ChangeLog.$_"}
+ sort {$b <=> $a}
+ map {/\.(\d+)$/; $1}
+ do {
+ opendir D, '.';
+ grep /^ChangeLog\.\d+$/, readdir D;
+ };
+
@ARGV = reverse @ARGV if $reverse;
}