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
TRTim Ringenbach <tim.ringenbach@gmail.com>
Date
Feb 15, 2016, 22:01 UTC
Message-ID
<CAGZMbffPYjX4g19AUPWJvknUtQ4AFeacKXpnQtuuOb1pPcOz-A@mail.gmail.com>
In-Reply-To
<20160215211413.GA1578@dcvr.yhbt.net>
On Mon, Feb 15, 2016 at 3:14 PM, Eric Wong <normalperson@yhbt.net> wrote:
> It might take a while for me to get around to looking at this
> more, so it would be very helpful if you poked around and tried
> some different things in the source.

Ok, I played around with it some and found something that works. I commented out all the providers except for:

   SVN::Client::get_username_prompt_provider(
     \&Git::SVN::Prompt::username, 2)
And that seems to actually work!

Interestingly, it doesn't actually interactively prompt me for a username. At least, not when I ran 'git svn dcommit --username test'. It did when I later ran a 'git svn fetch'.

I don't know this API at all, and it's been a long time since I've done any perl. (And I didn't even realize you used perl bindings to libsvn until a few minutes ago, I just assumed you somehow implemented everything from scratch.)

But my guess is that 'SVN::Client::get_username_provider()' is provided by the perl binding and isn't git-svn specific, and so it knows nothing of the --username argument, it simply is reading ~/.svn. (Assuming git-svn reads ~/.svn at all.) (That hints at maybe I could control the user with the files in ~/.svn, which I didn't even consider previously.) And if it knows nothing about git-svn or any arguments passed, then that explains why it didn't work.

Meanwhile, 'SVN::Client::get_username_prompt_provider' also looks like a stock SVN::Client function, but it's passed in a Git::SVN:: argument, that I'm assuming is some sort of callback. So in that case it's able to provided it with the passed in --username argument, or failing that, it prompts me.

So I have something that I think will work for me. I'm not sure how to turn it into a reasonable patch though. Maybe we need to eliminate some of the auth_provides from the list if the --username option is passed in?

> Btw, which version of SVN are you using?  I also wonder if
> there's something version-dependent.

svn --version svn, version 1.6.12 (r955767)

I know that's pretty old.

Thanks, Tim

Previous: Eric Wong
Message 5 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.