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