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

[PATCH] git-svn: read the dcommit url from the config file on a per remote basis

From
Peter Oberndorfer <kumbayo84@arcor.de>
Date
Feb 23, 2009, 11:02 UTC
Message-ID
<200902231202.54054.kumbayo84@arcor.de>
In-Reply-To
<20090223020545.GE26706@dcvr.yhbt.net>

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>
---
Now with a short documentation for svn.commiturl.
I hope the wording is OK.
 Documentation/git-svn.txt |    4 ++++
 git-svn.perl              |   12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 3d45654..cda3389 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.<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.
 --
diff --git a/git-svn.perl b/git-svn.perl
index cbc5211..be4d011 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";
-- 
1.6.1.3
Previous: Eric WongNext: Eric Wong
Message 8 of 10 in “git-svn: try to read the dcommit url from the config file”
  1. git-svn: try to read the dcommit url from the config filePeter Oberndorfer, Feb 19, 2009
  2. git svn dcommit difficulties/feature requestPeter Oberndorfer, Feb 19, 2009
  3. Kevin MenardFeb 20, 2009
  4. Eric WongFeb 21, 2009
  5. Eric WongFeb 21, 2009
  6. Peter OberndorferFeb 22, 2009
  7. Eric WongFeb 23, 2009
  8. git-svn: read the dcommit url from the config file on a per remote basisPeter Oberndorfer, Feb 23, 2009
  9. Eric WongFeb 23, 2009
  10. Junio C HamanoFeb 23, 2009

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.