summaryrefslogtreecommitdiff
path: root/build-aux/gitlog-to-changelog
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/gitlog-to-changelog')
-rwxr-xr-xbuild-aux/gitlog-to-changelog50
1 files changed, 33 insertions, 17 deletions
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 1e73f42..5112767 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -1,31 +1,46 @@
-eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
- & eval 'exec perl -wS "$0" $argv:q'
- if 0;
-# Convert git log output to ChangeLog format.
+#!/bin/sh
+#! -*-perl-*-
-my $VERSION = '2018-03-07 03:47'; # UTC
-# The definition above must lie within the first 8 lines in order
-# for the Emacs time-stamp write hook (at end) to update it.
-# If you change this file with Emacs, please let the write hook
-# do its job. Otherwise, update this string manually.
-
-# Copyright (C) 2008-2018 Free Software Foundation, Inc.
+# Convert git log output to ChangeLog format.
+# Copyright (C) 2008-2020 Free Software Foundation, Inc.
+#
# This program 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 3 of the License, or
# (at your option) any later version.
-
+#
# This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
-
+#
# Written by Jim Meyering
+# This is a prologue that allows to run a perl script as an executable
+# on systems that are compliant to a POSIX version before POSIX:2017.
+# On such systems, the usual invocation of an executable through execlp()
+# or execvp() fails with ENOEXEC if it is a script that does not start
+# with a #! line. The script interpreter mentioned in the #! line has
+# to be /bin/sh, because on GuixSD systems that is the only program that
+# has a fixed file name. The second line is essential for perl and is
+# also useful for editing this file in Emacs. The next two lines below
+# are valid code in both sh and perl. When executed by sh, they re-execute
+# the script through the perl program found in $PATH. The '-x' option
+# is essential as well; without it, perl would re-execute the script
+# through /bin/sh. When executed by perl, the next two lines are a no-op.
+eval 'exec perl -wSx "$0" "$@"'
+ if 0;
+
+my $VERSION = '2018-03-07 03:47'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+
use strict;
use warnings;
use Getopt::Long;
@@ -174,7 +189,7 @@ sub parse_amend_file($)
if (!$in_code)
{
- $line =~ /^([0-9a-fA-F]{40})$/
+ $line =~ /^([[:xdigit:]]{40})$/
or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
$fail = 1, next;
$sha = lc $1;
@@ -288,7 +303,7 @@ sub git_dir_option($)
my ($sha, $rest) = split ':', $log, 2;
defined $sha
or die "$ME:$.: malformed log entry\n";
- $sha =~ /^[0-9a-fA-F]{40}$/
+ $sha =~ /^[[:xdigit:]]{40}$/
or die "$ME:$.: invalid SHA1: $sha\n";
my $skipflag = 0;
@@ -376,7 +391,7 @@ sub git_dir_option($)
@skipshas = ();
next;
}
- if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/)
+ if ($found && $_ =~ /^([[:xdigit:]]{7,}) [^ ]/)
{
push ( @skipshas, $1 );
}
@@ -492,6 +507,7 @@ sub git_dir_option($)
# mode: perl
# indent-tabs-mode: nil
# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-line-limit: 50
# time-stamp-start: "my $VERSION = '"
# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
# time-stamp-time-zone: "UTC0"