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

[PATCH] Allow git-svnimport to take "" as the trunk directory.

From
ABAlberto Bertogli <albertito@gmail.com>
Date
Aug 14, 2007, 04:03 UTC
Message-ID
<11870641981207-git-send-email-albertito@gmail.com>

Some repositories started with the trunk in "/" and then moved it to the standard "trunk/" location.

On these repositories, the correct thing would be to call git-svnimport -T "", but because of the way the options are handled, it uses the default "trunk" instead of the given empty string. This patch fixes that behaviour.

Reported by Leandro Lucarella <llucax@gmail.com>.
Signed-off-by: Alberto Bertogli <albertito@gmail.com>
---

While the same could be done for tags and branches, I don't think it makes much sense.

git-svnimport.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-svnimport.perl b/git-svnimport.perl
index b73d649..8c17fb5 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -49,7 +49,7 @@ getopts("A:b:C:dDFhiI:l:mM:o:rs:t:T:SP:R:uv") or usage();
 usage if $opt_h;
 
 my $tag_name = $opt_t || "tags";
-my $trunk_name = $opt_T || "trunk";
+my $trunk_name = defined $opt_T ? $opt_T : "trunk";
 my $branch_name = $opt_b || "branches";
 my $project_name = $opt_P || "";
 $project_name = "/" . $project_name if ($project_name);
-- 
1.5.3.rc4.67.gf9286-dirty
Next: David Kastrup
Message 1 of 4 in “Allow git-svnimport to take "" as the trunk directory.”
  1. Allow git-svnimport to take "" as the trunk directory.Alberto Bertogli, Aug 14, 2007
  2. David KastrupAug 14, 2007
  3. Leandro LucarellaAug 14, 2007
  4. David KastrupAug 14, 2007

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.