texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * README-hacking: add .git/hooks/post-commit scri


From: Gavin D. Smith
Subject: branch master updated: * README-hacking: add .git/hooks/post-commit script
Date: Tue, 15 Oct 2024 16:48:49 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 2d4fb38476 * README-hacking: add .git/hooks/post-commit script
2d4fb38476 is described below

commit 2d4fb38476a16eb7834c548969981c47b3a6b8df
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Oct 15 21:48:42 2024 +0100

    * README-hacking: add .git/hooks/post-commit script
---
 ChangeLog      |  4 ++++
 README-hacking | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 0b325dc537..c93ff390a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-10-15  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * README-hacking: add .git/hooks/post-commit script
+
 2024-10-15  Vitezslav Crhonek  <vcrhonek@redhat.com>
 
        * info/util.c: add missing "va_end"
diff --git a/README-hacking b/README-hacking
index 6206df24ec..2cd60c1fac 100644
--- a/README-hacking
+++ b/README-hacking
@@ -89,6 +89,40 @@ case $2 in
 esac
 ------------------------------------
 
+If you are frequently applying patches sent by other people, the following
+may be useful to have in .git/hooks/post-commit to get the --author
+information from the ChangeLog:
+
+------------------------------------
+#!/bin/sh
+
+# post-commit
+
+# avoid recursion
+test $IN_GIT_HOOK_POST_COMMIT && exit 0
+export IN_GIT_HOOK_POST_COMMIT=1
+
+# Get author from latest ChangeLog entry.  Remove date, leading and trailing
+# spaces, and condense multiple spaces to 1.
+CL_author=$(head -n 1 ChangeLog | sed -e 's/^[[:digit:]-]*//' -e 's/^ *//' -e 
's/ *$//' -e 's/  \+/ /')
+
+# Get author from last commit
+HEAD_author=$(git log -1 --pretty=format:'%an <%ae>')
+
+if test "$CL_author" != "$HEAD_author" ; then
+    git commit --amend --author="$CL_author" --reuse-message=HEAD
+
+    echo "post-commit: changed author from '$HEAD_author'"
+    echo "post-commit: to '$CL_author'."
+    echo "post-commit: to override, run:"
+    echo "post-commit: IN_GIT_HOOK_POST_COMMIT=1 git commit --amend -C HEAD 
--author=\"$HEAD_author\""
+fi
+------------------------------------
+
+Please ensure they have appropriate copyright assignments in place with
+the FSF before committing other people's changes, and check with a
+maintainer if unsure.
+
 When unable to push commits due to other commits being made, please
 use "git pull --rebase" (the default for "git pull" complicates the
 git history).  To deal with conflicts in the ChangeLog, you should



reply via email to

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