X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/ab5796a9f97180707734a81320e3eb81937281fe..71e1f69d929e32425c732e8734ce9c943d8d179d:/lib-src/grep-changelog diff --git a/lib-src/grep-changelog b/lib-src/grep-changelog index 9baf0213db..c4de805db0 100755 --- a/lib-src/grep-changelog +++ b/lib-src/grep-changelog @@ -1,12 +1,13 @@ #! /usr/bin/perl -# Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is part of GNU Emacs. # # 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) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Emacs is distributed in the hope that it will be useful, @@ -16,8 +17,8 @@ # # 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. +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. # Extract entries from ChangeLogs matching specified criteria. @@ -35,55 +36,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 posibly 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; }