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

[PATCH] git-svn: make it play nicely with submodules

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jan 10, 2015, 14:55 UTC
Message-ID
<1420901711-81679-1-git-send-email-artagnon@gmail.com>
It's a simple matter of opening the directory specified in the gitfile.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 git-svn.perl | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/git-svn.perl b/git-svn.perl
index 6aa156c..8642783 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -337,6 +337,10 @@ for (my $i = 0; $i < @ARGV; $i++) {
 # make sure we're always running at the top-level working directory
 if ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) {
 	$ENV{GIT_DIR} ||= ".git";
+	# catch the submodule case
+	if (open(my $fh, '<', $ENV{GIT_DIR})) {
+		$ENV{GIT_DIR} = $1 if <$fh> =~ /^gitdir: (.+)$/;
+	}
 } else {
 	my ($git_dir, $cdup);
 	git_cmd_try {
-- 
2.2.1
Next: Eric Wong
Message 1 of 3 in “git-svn: make it play nicely with submodules”
  1. git-svn: make it play nicely with submodulesRamkumar Ramachandra, Jan 10, 2015
  2. Eric WongJan 10, 2015
  3. Ramkumar RamachandraJan 10, 2015

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.