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

[PATCH] Add 'git commit --no-signoff' option.

From
SDSteven Drake <sdrake@xnet.co.nz>
Date
Jan 13, 2010, 03:36 UTC
Message-ID
<alpine.LNX.2.00.1001131636460.16395@vqena.qenxr.bet.am>

Do not add a signed-off-by line. This overrides both the `--signoff` option and the `commit.signoff` configuration variable.

Signed-off-by: Steven Drake <sdrake@xnet.co.nz>
---
 Documentation/git-commit.txt |    4 ++++
 builtin-commit.c             |    5 ++++-
 2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 5a977b6..2dfc989 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -116,6 +116,10 @@ OPTIONS
 	Add Signed-off-by line by the committer at the end of the commit
 	log message. This overrides the `commit.signoff` configuration variable.
 
+--no-signoff::
+	Do not add igned-off-by line. This overrides both the `--signoff`
+	option and the `commit.signoff` configuration variable.
+
 -n::
 --no-verify::
 	This option bypasses the pre-commit and commit-msg hooks.
diff --git a/builtin-commit.c b/builtin-commit.c
index db90e7a..f236068 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -51,7 +51,7 @@ static const char *logfile, *force_author;
 static const char *template_file;
 static char *edit_message, *use_message;
 static char *author_name, *author_email, *author_date;
-static int all, edit_flag, also, interactive, only, amend, signoff;
+static int all, edit_flag, also, interactive, only, amend, signoff, no_signoff;
 static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship;
 static char *untracked_files_arg;
 /*
@@ -103,6 +103,7 @@ static struct option builtin_commit_options[] = {
 	OPT_STRING('C', "reuse-message", &use_message, "COMMIT", "reuse message from specified commit"),
 	OPT_BOOLEAN(0, "reset-author", &renew_authorship, "the commit is authored by me now (used with -C-c/--amend)"),
 	OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"),
+	OPT_BOOLEAN(0, "no-signoff", &no_signoff, "Do not add Signed-off-by:"),
 	OPT_FILENAME('t', "template", &template_file, "use specified template file"),
 	OPT_BOOLEAN('e', "edit", &edit_flag, "force edit of commit"),
 	OPT_STRING(0, "cleanup", &cleanup_arg, "default", "how to strip spaces and #comments from message"),
@@ -797,6 +798,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	if (force_author && renew_authorship)
 		die("Using both --reset-author and --author does not make sense");
 
+	signoff = no_signoff ? 0 : signoff;
+
 	if (logfile || message.len || use_message)
 		use_editor = 0;
 	if (edit_flag)
-- 
1.6.4
Message 1 of 1 in “Add 'git commit --no-signoff' option.”
  1. Add 'git commit --no-signoff' option.Steven Drake, Jan 13, 2010

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.