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

Re: [PATCH] git svn: read global+system config for clone+init

From
EWEric Wong <normalperson@yhbt.net>
Date
Nov 14, 2009, 22:50 UTC
Message-ID
<20091114225040.GA5165@dcvr.yhbt.net>
In-Reply-To
<20091114223930.GA10176@dcvr.yhbt.net>
Eric Wong <normalperson@yhbt.net> wrote:
> Hi Curt,
> 
> Thanks for the bug report, the following patch should fix
> the bug.  Also pullable from git://git.bogomips.org/git-svn

It took me a while (possibly due to low caffeine levels) to make a failing (automated) test case, but I've also pushed this out as well.

>From e2f8617b266e320fd58ab584cae2ebe9906daaac Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net>
Date: Sat, 14 Nov 2009 14:43:20 -0800
Subject: [PATCH] git svn: add authorsfile test case for ~/.gitconfig
The commit for:
    git svn: read global+system config for clone+init

Initially lacked a test case because the author was unable to reproduce it under his test environment, this adds it.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 t/t9130-git-svn-authors-file.sh |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh
index f5abdb3..134411e 100755
--- a/t/t9130-git-svn-authors-file.sh
+++ b/t/t9130-git-svn-authors-file.sh
@@ -91,4 +91,27 @@ test_expect_success 'fetch continues after authors-file is fixed' '
 	)
 	'
 
+test_expect_success 'fresh clone with svn.authors-file in config' '
+	(
+		rm -r "$GIT_DIR" &&
+		test x = x"$(git config svn.authorsfile)" &&
+		HOME="`pwd`" &&
+		export HOME &&
+		test_config="$HOME"/.gitconfig &&
+		unset GIT_CONFIG_NOGLOBAL &&
+		unset GIT_DIR &&
+		unset GIT_CONFIG &&
+		git config --global \
+		  svn.authorsfile "$HOME"/svn-authors &&
+		test x"$HOME"/svn-authors = x"$(git config svn.authorsfile)" &&
+		git svn clone "$svnrepo" gitconfig.clone &&
+		cd gitconfig.clone &&
+		nr_ex=$(git log | grep "^Author:.*example.com" | wc -l) &&
+		nr_rev=$(git rev-list HEAD | wc -l) &&
+		test $nr_rev -eq $nr_ex
+	)
+'
+
+test_debug 'GIT_DIR=gitconfig.clone/.git git log'
+
 test_done
-- 
Eric Wong
Previous: Eric Wong
Message 8 of 8 in “Bug: "git svn clone" does not honor svn.authorsfile setting”
  1. Curt SampsonNov 10, 2009
  2. Sverre RabbelierNov 10, 2009
  3. Junio C HamanoNov 10, 2009
  4. Curt SampsonNov 13, 2009
  5. Sam VilainNov 11, 2009
  6. Curt SampsonNov 13, 2009
  7. git svn: read global+system config for clone+initEric Wong, Nov 14, 2009
  8. Eric WongNov 14, 2009

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.