bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] announce-gen: Support VPATH builds better.


From: Simon Josefsson
Subject: [PATCH] announce-gen: Support VPATH builds better.
Date: Sat, 28 Dec 2024 19:45:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi.

This error was triggered when running 'make release' in a VPATH build:

  (my $first_name = `git config user.name|cut -d' ' -f1`)
    =~ m{\S} or die "no name? set user.name in ~/.gitconfig\n";

Fortunately the script already know srcdir so passing it to git with -C
was simple.  I pushed this patch.

/Simon
From cb48b6cb3aef16d44495f9fbc287c769adb22086 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <simon@josefsson.org>
Date: Sat, 28 Dec 2024 19:42:43 +0100
Subject: [PATCH] announce-gen: Support VPATH builds better.

* build-aux/announce-gen: Pass -C$srcdir to git.
---
 ChangeLog              |  5 +++++
 build-aux/announce-gen | 16 ++++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b99da8b96a..2eed147ec8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-12-28  Simon Josefsson  <simon@josefsson.org>
+
+       announce-gen: Support VPATH builds better.
+       * build-aux/announce-gen: Pass -C$srcdir to git.
+
 2024-12-28  Bruno Haible  <bruno@clisp.org>
 
        endian: Fix link error on CentOS 5.
diff --git a/build-aux/announce-gen b/build-aux/announce-gen
index cc1d46039f..2bfa393a7d 100755
--- a/build-aux/announce-gen
+++ b/build-aux/announce-gen
@@ -35,7 +35,7 @@
 eval 'exec perl -wSx "$0" "$@"'
      if 0;
 
-my $VERSION = '2024-12-10 08:57'; # UTC
+my $VERSION = '2024-12-28 18:31'; # 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
@@ -566,19 +566,19 @@ EOF
   my $v0 = $prev_version;
   my $v1 = $curr_version;
 
-  (my $first_name = `git config user.name|cut -d' ' -f1`)
+  (my $first_name = `git -C "$srcdir" config user.name|cut -d' ' -f1`)
     =~ m{\S} or die "no name? set user.name in ~/.gitconfig\n";
 
-  chomp (my $n_ci = `git rev-list "v$v0..v$v1" | wc -l`);
-  chomp (my $n_p = `git shortlog "v$v0..v$v1" | grep -c '^[^ ]'`);
+  chomp (my $n_ci = `git -C "$srcdir" rev-list "v$v0..v$v1" | wc -l`);
+  chomp (my $n_p = `git -C "$srcdir" shortlog "v$v0..v$v1" | grep -c '^[^ ]'`);
 
-  my $this_commit_hash = `git log --pretty=%H -1 "v$v1"`;
+  my $this_commit_hash = `git -C "$srcdir" log --pretty=%H -1 "v$v1"`;
   chop $this_commit_hash;
-  my $prev_release_date = `git log --pretty=%ct -1 "v$v0"`;
-  my $this_release_date = `git log --pretty=%ct -1 "v$v1"`;
+  my $prev_release_date = `git -C "$srcdir" log --pretty=%ct -1 "v$v0"`;
+  my $this_release_date = `git -C "$srcdir" log --pretty=%ct -1 "v$v1"`;
   my $n_seconds = $this_release_date - $prev_release_date;
   my $time_since_prev = readable_interval $n_seconds;
-  my $names = `git shortlog "v$v0..v$v1"|perl -lne '/^(\\w.*):/ and print "  
".\$1'`;
+  my $names = `git -C "$srcdir" shortlog "v$v0..v$v1"|perl -lne '/^(\\w.*):/ 
and print "  ".\$1'`;
 
   print <<EOF;
 There have been $n_ci commits by $n_p people in the $time_since_prev since $v0.
-- 
2.47.1

Attachment: signature.asc
Description: PGP signature


reply via email to

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