Skip to content

Commit 0df8405

Browse files
kumbayoEric Wong
authored andcommitted
git-svn: read the dcommit url from the config file on a per remote basis
The commit url for dcommit is determined in the following order: commandline option --commit-url svn.commiturl svn-remote.<name>.commiturl svn-remote.<name>.url Signed-off-by: Peter Oberndorfer <[email protected]> Acked-by: Eric Wong <[email protected]>
1 parent 83c2fcf commit 0df8405

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Documentation/git-svn.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ and have no uncommitted changes.
169169
reused if a user is later given access to an alternate transport
170170
method (e.g. `svn+ssh://` or `https://`) for commit.
171171

172+
config key: svn-remote.<name>.commiturl
173+
174+
config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
175+
172176
Using this option for any other purpose (don't ask)
173177
is very strongly discouraged.
174178
--

git-svn.perl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,17 @@ sub cmd_dcommit {
438438
die "Unable to determine upstream SVN information from ",
439439
"$head history.\nPerhaps the repository is empty.";
440440
}
441-
$url = defined $_commit_url ? $_commit_url : $gs->full_url;
441+
442+
if (defined $_commit_url) {
443+
$url = $_commit_url;
444+
} else {
445+
$url = eval { command_oneline('config', '--get',
446+
"svn-remote.$gs->{repo_id}.commiturl") };
447+
if (!$url) {
448+
$url = $gs->full_url
449+
}
450+
}
451+
442452
my $last_rev = $_revision if defined $_revision;
443453
if ($url) {
444454
print "Committing to $url ...\n";

0 commit comments

Comments
 (0)