From: Peter Oberndorfer Date: Mon, 23 Feb 2009 11:02:53 +0000 (+0100) Subject: git-svn: read the dcommit url from the config file on a per remote basis X-Git-Tag: v1.6.2-rc2~14^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0df84059d4127ed06e040998ec0e6ce6f61d3d1f;p=git.git 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..commiturl svn-remote..url Signed-off-by: Peter Oberndorfer Acked-by: Eric Wong --- diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt index 3d456545d..cda338933 100644 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@ -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..commiturl + +config key: svn.commiturl (overwrites all svn-remote..commiturl options) + Using this option for any other purpose (don't ask) is very strongly discouraged. -- diff --git a/git-svn.perl b/git-svn.perl index bce24a80c..d8476c81e 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -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";