git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Adeodato Simó" <dato@net.com.org.es>
To: git@vger.kernel.org, gitster@pobox.com
Subject: [PATCH] Add a commit.signoff configuration variable to always use --signoff.
Date: Fri, 26 Dec 2008 13:56:59 +0100	[thread overview]
Message-ID: <1230296219-16408-1-git-send-email-dato@net.com.org.es> (raw)

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

             reply	other threads:[~2008-12-26 12:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-26 12:56 Adeodato Simó [this message]
2008-12-26 22:02 ` [PATCH] Add a commit.signoff configuration variable to always use --signoff Nanako Shiraishi
2008-12-26 22:10   ` Adeodato Simó
2008-12-27  0:36     ` Junio C Hamano
2008-12-27  8:26       ` Adeodato Simó
2008-12-27  8:44         ` Junio C Hamano
2008-12-27  9:03           ` Adeodato Simó
2008-12-27 11:04             ` Thomas Rast
2008-12-27 11:05               ` Adeodato Simó
2008-12-27 11:53             ` Junio C Hamano
2008-12-27 12:01               ` Adeodato Simó
2008-12-29 11:16                 ` [PATCH v3] Add a commit.signoff configuration option to always use --signoff in commit Adeodato Simó
2008-12-29 11:18                   ` Adeodato Simó
2008-12-30 21:04                   ` Junio C Hamano
2009-01-01 22:18                     ` Adeodato Simó
2009-01-02 12:46                       ` Adeodato Simó
2008-12-27 18:08 ` [PATCH] Add a commit.signoff configuration variable to always use --signoff Jan Krüger
2008-12-27 18:40   ` Adeodato Simó
2008-12-27 19:15     ` Jan Krüger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1230296219-16408-1-git-send-email-dato@net.com.org.es \
    --to=dato@net.com.org.es \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).