Skip to content

Commit

Permalink
git-svn: read the dcommit url from the config file on a per remote basis
Browse files Browse the repository at this point in the history
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 <kumbayo84@arcor.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
  • Loading branch information
Peter Oberndorfer authored and Eric Wong committed Feb 23, 2009
1 parent 83c2fcf commit 0df8405
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Documentation/git-svn.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ and have no uncommitted changes.
reused if a user is later given access to an alternate transport
method (e.g. `svn+ssh://` or `https://`) for commit.

config key: svn-remote.<name>.commiturl

config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)

Using this option for any other purpose (don't ask)
is very strongly discouraged.
--
Expand Down
12 changes: 11 additions & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,17 @@ sub cmd_dcommit {
die "Unable to determine upstream SVN information from ",
"$head history.\nPerhaps the repository is empty.";
}
$url = defined $_commit_url ? $_commit_url : $gs->full_url;

if (defined $_commit_url) {
$url = $_commit_url;
} else {
$url = eval { command_oneline('config', '--get',
"svn-remote.$gs->{repo_id}.commiturl") };
if (!$url) {
$url = $gs->full_url
}
}

my $last_rev = $_revision if defined $_revision;
if ($url) {
print "Committing to $url ...\n";
Expand Down

0 comments on commit 0df8405

Please sign in to comment.