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

Re: git svn dcommit doesn't support --username option for file:/// urls

From
EWEric Wong <normalperson@yhbt.net>
Date
Feb 15, 2016, 10:06 UTC
Message-ID
<20160215100636.GA5785@dcvr.yhbt.net>
In-Reply-To
<CAGZMbfc5Oi=EOYbCbZWfM1T65AZwCEbsso+QTkAe1sa4hRC61A@mail.gmail.com>
Tim Ringenbach <tim.ringenbach@gmail.com> wrote:
Show 9 quoted lines
> Hi,
> 
> 'git svn dcommit' doesn't seem to honor the --username argument when
> my svn repository url is a file:/// url.  It doesn't complain either,
> it just seems to silently ignore the option. My dcommits show up as
> the user I'm logged in as. The only way I found to change that is to
> 'sudo' to some other user.
> 
> The actual 'svn' command does support --username with 'svn commit'.

Interesting, I didn't know --username would be handled with file:// at all by svn(1). I don't think we do anything special depending on the URL scheme for auth, either.

I took a quick look at the svn(1) code (subversion/svn/svn.c in git://git.apache.org/subversion.git) but didn't see anything jump out at me (I'm not really familiar with that code, either).

Totally untested, but does flipping the order of auth providers help at all?

diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm
index e764696..c6ce247 100644
--- a/perl/Git/SVN/Ra.pm
+++ b/perl/Git/SVN/Ra.pm
@@ -43,6 +43,7 @@ END {
 sub _auth_providers () {
 	require SVN::Client;
 	my @rv = (
+	  SVN::Client::get_username_provider(),
 	  SVN::Client::get_simple_provider(),
 	  SVN::Client::get_ssl_server_trust_file_provider(),
 	  SVN::Client::get_simple_prompt_provider(
@@ -53,7 +54,6 @@ sub _auth_providers () {
 	  SVN::Client::get_ssl_client_cert_pw_file_provider(),
 	  SVN::Client::get_ssl_client_cert_pw_prompt_provider(
 	    \&Git::SVN::Prompt::ssl_client_cert_pw, 2),
-	  SVN::Client::get_username_provider(),
 	  SVN::Client::get_ssl_server_trust_prompt_provider(
 	    \&Git::SVN::Prompt::ssl_server_trust),
 	  SVN::Client::get_username_prompt_provider(


(I'm not sure if it breaks other things, either).
Previous: Tim RingenbachNext: Tim Ringenbach
Message 2 of 5 in “git svn dcommit doesn't support --username option for file:/// urls”
  1. Tim RingenbachFeb 12, 2016
  2. Eric WongFeb 15, 2016
  3. Tim RingenbachFeb 15, 2016
  4. Eric WongFeb 15, 2016
  5. Tim RingenbachFeb 15, 2016

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.