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

[PATCH 3/3] rebase -i: Export GIT_AUTHOR_* variables explicitly

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Jan 22, 2010, 09:22 UTC
Message-ID
<c6efda03848abc00cf8bf8d84fc34ef0d652b64c.1264151435.git.mhagger@alum.mit.edu>
In-Reply-To
<cover.1264151435.git.mhagger@alum.mit.edu>

As pointed out on the mailing list, one-shot shell variable exports do not necessarily work with shell functions. So export the GIT_AUTHOR_* variables explicitly using "export".

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
 git-rebase--interactive.sh |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index c2f6089..c8603f0 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -215,9 +215,7 @@ has_action () {
 # Run command with GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, and
 # GIT_AUTHOR_DATE exported from the current environment.
 do_with_author () {
-	GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
-	GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
-	GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
+	export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE &&
 	"$@"
 }
 
-- 
1.6.6
Previous: Michael HaggertyNext: Johannes Schindelin
Message 4 of 7 in “Fixes to mh/rebase-fixup”
  1. 0/3 Fixes to mh/rebase-fixupMichael Haggerty, Jan 22, 2010
  2. 1/3 rebase -i: Avoid non-portable "test X -a Y"Michael Haggerty, Jan 22, 2010
  3. 2/3 rebase -i: Enclose sed command substitution in quotesMichael Haggerty, Jan 22, 2010
  4. 3/3 rebase -i: Export GIT_AUTHOR_* variables explicitlyMichael Haggerty, Jan 22, 2010
  5. Johannes SchindelinJan 22, 2010
  6. Junio C HamanoJan 22, 2010
  7. Michael HaggertyJan 24, 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.