git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Liam Beguin <liambeguin@gmail.com>
To: git@vger.kernel.org
Cc: Liam Beguin <liambeguin@gmail.com>
Subject: [PATCH 1/1] commit: add signoff config variable
Date: Sat,  3 Aug 2019 15:34:36 -0400	[thread overview]
Message-ID: <20190803193436.13158-1-liambeguin@gmail.com> (raw)

Add a configuration variable, based on format.signoff, to automatically
signoff commit messages.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
---
 Documentation/config/commit.txt | 7 +++++++
 builtin/commit.c                | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/Documentation/config/commit.txt b/Documentation/config/commit.txt
index 2c95573930be..62aaacb0dc74 100644
--- a/Documentation/config/commit.txt
+++ b/Documentation/config/commit.txt
@@ -27,3 +27,10 @@ commit.template::
 commit.verbose::
 	A boolean or int to specify the level of verbose with `git commit`.
 	See linkgit:git-commit[1].
+
+commit.signOff::
+	A boolean value which lets you enable the `-s/--signoff` option of
+	`git commit` 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.
diff --git a/builtin/commit.c b/builtin/commit.c
index ae7aaf6dc683..36d70396ace7 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1456,6 +1456,10 @@ static int git_commit_config(const char *k, const char *v, void *cb)
 		config_commit_verbose = git_config_bool_or_int(k, v, &is_bool);
 		return 0;
 	}
+	if (!strcmp(k, "commit.signoff")) {
+		signoff = git_config_bool(k, v);
+		return 0;
+	}
 
 	status = git_gpg_config(k, v, NULL);
 	if (status)
-- 
2.21.0.777.g83232e38648b


             reply	other threads:[~2019-08-03 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-03 19:34 Liam Beguin [this message]
2019-08-03 21:11 ` [PATCH 1/1] commit: add signoff config variable brian m. carlson
2019-08-03 21:23   ` Liam Beguin

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=20190803193436.13158-1-liambeguin@gmail.com \
    --to=liambeguin@gmail.com \
    --cc=git@vger.kernel.org \
    /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).