threads / patch / 5129

patchAllow config file to specify Signed-off-by identity in format-patch.

Subject: [PATCH] Allow config file to specify Signed-off-by identity in format-patch.

## tl;dr

2 messages between Aug 4, 2006 and Aug 4, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Ramsay Jones· Aug 4, 2006, 21:01 UTC · lore

Unlike git-commit, git-format-patch was not picking up and using the user.email config variable for the email part of the committer info. I was forced to use the GIT_COMMITTER_EMAIL environment variable to override the default <user@localhost.localdomain>. The fix was to simply move the call to setup_ident() to come before the git_config() call.

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
---
 builtin-log.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to builtin-log.c +1 −1
diff --git a/builtin-log.c b/builtin-log.c
index f9515a8..dcee141 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -243,6 +243,7 @@ int cmd_format_patch(int argc, const cha
 	rev.ignore_merges = 1;
 	rev.diffopt.output_format = DIFF_FORMAT_PATCH;
 
+	setup_ident();
 	git_config(git_format_config);
 	rev.extra_headers = extra_headers;
 
@@ -283,7 +284,6 @@ int cmd_format_patch(int argc, const cha
 			 !strcmp(argv[i], "-s")) {
 			const char *committer;
 			const char *endpos;
-			setup_ident();
 			committer = git_committer_info(1);
 			endpos = strchr(committer, '>');
 			if (!endpos)
-- 
1.4.1


From 2bc01f2ceb042192827d05e941ca81c1a7dc30fe Mon Sep 17 00:00:00 2001
From: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Date: Fri, 4 Aug 2006 17:18:15 +0100
Subject: [PATCH] Allow config file to specify Signed-off-by identity in format-patch.

Unlike git-commit, git-format-patch was not picking up and using the
user.email config variable for the email part of the committer info.
I was forced to use the GIT_COMMITTER_EMAIL environment variable to
override the default <user@localhost.localdomain>. The fix was to
simply move the call to setup_ident() to come before the git_config()
call.

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
---
 builtin-log.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index f9515a8..dcee141 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -243,6 +243,7 @@ int cmd_format_patch(int argc, const cha
 	rev.ignore_merges = 1;
 	rev.diffopt.output_format = DIFF_FORMAT_PATCH;
 
+	setup_ident();
 	git_config(git_format_config);
 	rev.extra_headers = extra_headers;
 
@@ -283,7 +284,6 @@ int cmd_format_patch(int argc, const cha
 			 !strcmp(argv[i], "-s")) {
 			const char *committer;
 			const char *endpos;
-			setup_ident();
 			committer = git_committer_info(1);
 			endpos = strchr(committer, '>');
 			if (!endpos)
-- 
1.4.1
Johannes Schindelin· Aug 4, 2006, 22:56 UTC · re: Ramsay Jones · lore

Re: [PATCH] Allow config file to specify Signed-off-by identity in format-patch.

On Fri, 4 Aug 2006, Ramsay Jones wrote:
Show 6 quoted lines
> Unlike git-commit, git-format-patch was not picking up and using the
> user.email config variable for the email part of the committer info.
> I was forced to use the GIT_COMMITTER_EMAIL environment variable to
> override the default <user@localhost.localdomain>. The fix was to
> simply move the call to setup_ident() to come before the git_config()
> call.
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>

I _always_ use environment variables, since the $HOME/.gitconfig is a pretty recent addition. Therefore, I completely missed that one.

Ciao, Dscho

← back to recent threads