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

[PATCH] Add a commit.signoff configuration variable to always use --signoff.

From
Adeodato Simó <dato@net.com.org.es>
Date
Dec 26, 2008, 12:56 UTC
Message-ID
<1230296219-16408-1-git-send-email-dato@net.com.org.es>
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
I wrote:
> Has there even been talk of a commit.signoff configuration variable
> to always add a S-o-b line? This could allow to enable it on a
> per-project basis, which would be cool.

Well, it seemed easy enough to do, so I went ahead. Comments would be welcome.

 Documentation/config.txt     |    6 ++++++
 Documentation/git-commit.txt |    3 ++-
 builtin-commit.c             |    5 +++++
 3 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 52786c7..6d195a3 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -591,6 +591,12 @@ color.ui::
 commit.template::
 	Specify a file to use as the template for new commit messages.
 
+commit.signoff::
+	If set, 'git-commit' will always add a Signed-off-by line. If
+	you don't want it always active, you can still set it in the
+	repository specific configuration file for projects that require
+	a Signed-off-by line for all commits.
+
 diff.autorefreshindex::
 	When using 'git-diff' to compare with work tree
 	files, do not consider stat-only change as changed.
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index b5d81be..abab839 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -96,7 +96,8 @@ OPTIONS
 -s::
 --signoff::
 	Add Signed-off-by line by the committer at the end of the commit
-	log message.
+	log message. This overrides the `commit.signoff` configuration
+	variable.
 
 -n::
 --no-verify::
diff --git a/builtin-commit.c b/builtin-commit.c
index e88b78f..fc09539 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -929,6 +929,11 @@ static int git_commit_config(const char *k, const char *v, void *cb)
 	if (!strcmp(k, "commit.template"))
 		return git_config_string(&template_file, k, v);
 
+	if (!strcmp(k, "commit.signoff")) {
+		signoff = git_config_bool(k, v);
+		return 0;
+	}
+
 	return git_status_config(k, v, cb);
 }
 
-- 
1.6.1.307.g07803
Next: Nanako Shiraishi
Message 1 of 19 in “Add a commit.signoff configuration variable to always use --signoff.”
  1. Add a commit.signoff configuration variable to always use --signoff.Adeodato Simó, Dec 26, 2008
  2. Nanako ShiraishiDec 26, 2008
  3. Adeodato SimóDec 26, 2008
  4. Junio C HamanoDec 27, 2008
  5. Adeodato SimóDec 27, 2008
  6. Junio C HamanoDec 27, 2008
  7. Add a commit.signoff configuration variable to always use --signoffAdeodato Simó, Dec 27, 2008
  8. Thomas RastDec 27, 2008
  9. Adeodato SimóDec 27, 2008
  10. Junio C HamanoDec 27, 2008
  11. Adeodato SimóDec 27, 2008
  12. Add a commit.signoff configuration option to always use --signoff in commitAdeodato Simó, Dec 29, 2008
  13. Adeodato SimóDec 29, 2008
  14. Junio C HamanoDec 30, 2008
  15. Adeodato SimóJan 1, 2009
  16. Adeodato SimóJan 2, 2009
  17. Jan KrügerDec 27, 2008
  18. Adeodato SimóDec 27, 2008
  19. Jan KrügerDec 27, 2008

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.