{"thread":{"id":"6280","subject":"[PATCH 2/2] git-svn: pass an unambiguous ref to rev-list when grafting-branches","startedAt":"2007-01-08T03:35:40Z","lastAt":"2007-01-08T03:35:41Z","messageCount":2,"participants":["Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"31116","messageId":"11682273413995-git-send-email-normalperson@yhbt.net","threadId":"6280","inReplyTo":null,"subject":"[PATCH 1/2] git-svn: add --prefix= option to multi-init","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-01-08T03:35:40Z","receivedAt":"2007-01-08T03:35:40Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Also, document --{trunk,branches,tags} options while we're\ndocumenting multi-init options.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n Documentation/git-svn.txt |   18 ++++++++++++++++++\n git-svn.perl              |    8 +++++---\n 2 files changed, 23 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex ce63def..8df43cb 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -139,6 +139,24 @@ manually joining branches on commit.\n \twhere the repository URL ends and where the repository path\n \tbegins.\n \n+-T<trunk_subdir>::\n+--trunk=<trunk_subdir>::\n+-t<tags_subdir>::\n+--tags=<tags_subdir>::\n+-b<branches_subdir>::\n+--branches=<branches_subdir>::\n+\tThese are the command-line options for multi-init.  Each of\n+\tthese flags can point to a relative repository path\n+\t(--tags=project/tags') or a full url\n+\t(--tags=https://foo.org/project/tags)\n+\n+--prefix=<prefix>\n+\tThis allows one to specify a prefix which is prepended to the\n+\tnames of remotes.  The prefix does not automatically include a\n+\ttrailing slash, so be sure you include one in the argument if\n+\tthat is what you want.  This is useful if you wish to track\n+\tmultiple projects that share a common repository.\n+\n 'multi-fetch'::\n \tThis runs fetch on all known SVN branches we're tracking.  This\n \twill NOT discover new branches (unlike git-svnimport), so\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 1da31fd..a092be8 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -70,7 +70,7 @@ my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit,\n \t$_version, $_upgrade, $_authors, $_branch_all_refs, @_opt_m,\n \t$_merge, $_strategy, $_dry_run, $_ignore_nodate, $_non_recursive,\n \t$_username, $_config_dir, $_no_auth_cache,\n-\t$_pager, $_color);\n+\t$_pager, $_color, $_prefix);\n my (@_branch_from, %tree_map, %users, %rusers, %equiv);\n my ($_svn_can_do_switch);\n my @repo_path_split_cache;\n@@ -134,6 +134,7 @@ my %cmd = (\n \t\t\t 'username=s' => \\$_username,\n \t\t\t 'config-dir=s' => \\$_config_dir,\n \t\t\t 'no-auth-cache' => \\$_no_auth_cache,\n+\t\t\t 'prefix=s' => \\$_prefix,\n \t\t\t} ],\n \t'multi-fetch' => [ \\&multi_fetch,\n \t\t\t'Fetch multiple trees (like git-svnimport)',\n@@ -595,8 +596,9 @@ sub multi_init {\n \t\t\tcommand_noisy('repo-config', 'svn.trunk', $trunk_url);\n \t\t}\n \t}\n-\tcomplete_url_ls_init($url, $_branches, '--branches/-b', '');\n-\tcomplete_url_ls_init($url, $_tags, '--tags/-t', 'tags/');\n+\t$_prefix = '' unless defined $_prefix;\n+\tcomplete_url_ls_init($url, $_branches, '--branches/-b', $_prefix);\n+\tcomplete_url_ls_init($url, $_tags, '--tags/-t', $_prefix . 'tags/');\n }\n \n sub multi_fetch {\n-- \n1.5.0.rc0.ge21b-dirty\n"},{"id":"31115","messageId":"11682273424039-git-send-email-normalperson@yhbt.net","threadId":"6280","inReplyTo":"11682273413995-git-send-email-normalperson@yhbt.net","subject":"[PATCH 2/2] git-svn: pass an unambiguous ref to rev-list when grafting-branches","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-01-08T03:35:41Z","receivedAt":"2007-01-08T03:35:41Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Some users apparently create local heads with the same basename\nas the remote branch they're tracking.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex a092be8..56f1700 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1086,7 +1086,7 @@ sub graft_merge_msg {\n \tmy ($grafts, $l_map, $u, $p, @re) = @_;\n \n \tmy $x = $l_map->{$u}->{$p};\n-\tmy $rl = rev_list_raw($x);\n+\tmy $rl = rev_list_raw(\"refs/remotes/$x\");\n \twhile (my $c = next_rev_list_entry($rl)) {\n \t\tforeach my $re (@re) {\n \t\t\tmy (@br) = ($c->{m} =~ /$re/g);\n-- \n1.5.0.rc0.ge21b-dirty\n"}]}