git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/1] git-am: provide configuration to enable signoff by default

From
SNSekhar Nori <nsekhar@ti.com>
Date
Jun 1, 2011, 08:42 UTC
Message-ID
<1306917751-27999-1-git-send-email-nsekhar@ti.com>

Provide a git config option to enable --signoff a default when using git-am. This should be handy for maintainers who regularly apply patches from mailing lists to send them upstream and want to be on the sign-off path.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 Documentation/config.txt |    7 +++++++
 Documentation/git-am.txt |    3 ++-
 git-am.sh                |    5 +++++
 3 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 6b93777..5da7ca8 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -597,6 +597,13 @@ am.keepcr::
 	by giving '--no-keep-cr' from the command line.
 	See linkgit:git-am[1], linkgit:git-mailsplit[1].
 
+am.signoff::
+	A boolean value which lets you enable the `-s/--signoff` option of
+	am by default. *Note:* Adding the Signed-off-by: line to a patch
+	should be a conscious act and means that you certify you have
+	the rights to submit this work under the same open source license.
+	Please see the 'SubmittingPatches' document for further discussion.
+
 apply.ignorewhitespace::
 	When set to 'change', tells 'git apply' to ignore changes in
 	whitespace, in the same way as the '--ignore-space-change'
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 6b1b5af..6b2c51a 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -33,7 +33,8 @@ OPTIONS
 -s::
 --signoff::
 	Add a `Signed-off-by:` line to the commit message, using
-	the committer identity of yourself.
+	the committer identity of yourself. `am.signoff` configuration
+	variable can be used to make this the defaut.
 
 -k::
 --keep::
diff --git a/git-am.sh b/git-am.sh
index 6cdd591..8e2a693 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -328,6 +328,11 @@ then
     keepcr=t
 fi
 
+if test "$(git config --bool --get am.signoff)" = true
+then
+    sign=t
+fi
+
 while test $# != 0
 do
 	case "$1" in
-- 
1.7.3.2
Next: Sverre Rabbelier
Message 1 of 9 in “git-am: provide configuration to enable signoff by default”
  1. 1/1 git-am: provide configuration to enable signoff by defaultSekhar Nori, Jun 1, 2011
  2. Sverre RabbelierJun 1, 2011
  3. Nori, SekharJun 2, 2011
  4. Thiago FarinaJun 2, 2011
  5. Jeff KingJun 1, 2011
  6. Junio C HamanoJun 1, 2011
  7. Nori, SekharJun 1, 2011
  8. Jonathan NiederJun 1, 2011
  9. Nori, SekharJun 2, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.