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

2 messages from 2006-08-04 to 2006-08-04. Participants: Ramsay Jones, Johannes Schindelin.
Thread: https://gitlist.dev/t/5129

## Ramsay Jones, 2006-08-04 21:01

Subject: [PATCH] Allow config file to specify Signed-off-by identity in format-patch.
Message-ID: <000001c6b809$2919a200$c47eedc1@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/000001c6b809%242919a200%24c47eedc1%40ramsay1.demon.co.uk

```

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


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, 2006-08-04 22:56

Subject: Re: [PATCH] Allow config file to specify Signed-off-by identity in format-patch.
Message-ID: <Pine.LNX.4.63.0608050055090.1800@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0608050055090.1800%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <000001c6b809$2919a200$c47eedc1@ramsay1.demon.co.uk>

```


On Fri, 4 Aug 2006, Ramsay Jones wrote:

> 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

```
