diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-09-25 16:15:16 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-09-25 16:15:16 -0400 |
commit | 650c20f1ca4e07591a727e1cfcc74b3363d15985 (patch) | |
tree | 85d11f6437cde22f410c25e0e5f71a3131ebd07d /build-aux/gitlog-to-changelog | |
parent | 8869332684c2302b5ba1ead4568bbc7ba1c0183e (diff) | |
parent | 4b85ae6a24380fb67a3315eaec9233f17a872473 (diff) | |
download | emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.gz emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.bz2 emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.zip |
Merge 'master' into noverlay
Diffstat (limited to 'build-aux/gitlog-to-changelog')
-rwxr-xr-x | build-aux/gitlog-to-changelog | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index 3c94bd56a0b..82d9f973366 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. - -my $VERSION = '2017-09-13 06:45'; # 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. +#!/bin/sh +#! -*-perl-*- -# Copyright (C) 2008-2017 Free Software Foundation, Inc. +# Convert git log output to ChangeLog format. +# Copyright (C) 2008-2022 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 = '2022-01-27 18:49'; # 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 ); } @@ -440,7 +455,8 @@ sub git_dir_option($) # If there were any lines if (@line == 0) { - warn "$ME: warning: empty commit message:\n $date_line\n"; + warn "$ME: warning: empty commit message:\n" + . " commit $sha\n $date_line\n"; } else { @@ -491,7 +507,8 @@ sub git_dir_option($) # Local Variables: # mode: perl # indent-tabs-mode: nil -# eval: (add-hook 'write-file-hooks 'time-stamp) +# 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" |