{"thread":{"id":"22186","subject":"git-svn dcommit ignores --username if there are cached credentials","startedAt":"2010-01-12T22:47:57Z","lastAt":"2010-01-13T07:05:23Z","messageCount":3,"participants":["Michel Jouvin","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"131411","messageId":"loom.20100112T233835-324@post.gmane.org","threadId":"22186","inReplyTo":null,"subject":"git-svn dcommit ignores --username if there are cached credentials","fromName":"Michel Jouvin","fromEmail":"jouvin@lal.in2p3.fr","sentAt":"2010-01-12T22:47:57Z","receivedAt":"2010-01-12T22:47:57Z","isPatch":false,"sender":{"key":"jouvin@lal.in2p3.fr","avatar":null},"body":"Hi,\n\nI am new to Git and using 1.6.6. I'm very interested by using it to mirror SVN \nrepositories. But I am running into troubles with the way git-svn handles SVN \ncredentials. \n\nFor one SVN I use I have some cached credentials that have only very restricted \nwrite access. With svn command, I am using --username for every commit and this \ncached credential is just ignored: I'm asked for a password.\n\nWith git-svn, I use --username at init/fetch but during dcommit --username is \nignored becaused of the cached credential. I can see in SVN logs that the \ncached credential (which doesn't have the right to commit the mods I made) has \nbeen used instead of the one specified during fetch. If I removed the cached \ncredential, the username specified with --username is taken into account (I'm \nasked a password for it and it works) and if I ommit the --username, the one \nspecified at fetch time is used.\n\nIMO, looks like a bug... Thanks in advance for any comment.\n\nCheers,\n\nMichel\n"},{"id":"131421","messageId":"20100113054138.GB23182@dcvr.yhbt.net","threadId":"22186","inReplyTo":"loom.20100112T233835-324@post.gmane.org","subject":"Re: git-svn dcommit ignores --username if there are cached credentials","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-01-13T05:41:38Z","receivedAt":"2010-01-13T05:41:38Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Michel Jouvin <jouvin@lal.in2p3.fr> wrote:\n> Hi,\n> \n> I am new to Git and using 1.6.6. I'm very interested by using it to mirror SVN \n> repositories. But I am running into troubles with the way git-svn handles SVN \n> credentials. \n> \n> For one SVN I use I have some cached credentials that have only very restricted \n> write access. With svn command, I am using --username for every commit and this \n> cached credential is just ignored: I'm asked for a password.\n> \n> With git-svn, I use --username at init/fetch but during dcommit --username is \n> ignored becaused of the cached credential. I can see in SVN logs that the \n> cached credential (which doesn't have the right to commit the mods I made) has \n> been used instead of the one specified during fetch. If I removed the cached \n> credential, the username specified with --username is taken into account (I'm \n> asked a password for it and it works) and if I ommit the --username, the one \n> specified at fetch time is used.\n> \n> IMO, looks like a bug... Thanks in advance for any comment.\n \nHi Michel,\n\nI wonder if this is because we explicitly reread the config directory\nwhen creating Git::SVN::Editor.\n\nDoes using --no-auth-cache work for you?\n\nOtherwise, try pointing --config-dir= to an empty directory.\n\nOr you can try this patch to force us to not reread the config_dir:\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 650c9e5..280fd15 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -550,9 +550,6 @@ sub cmd_dcommit {\n \t\t\tmy %ed_opts = ( r => $last_rev,\n \t\t\t                log => get_commit_entry($d)->{log},\n \t\t\t                ra => Git::SVN::Ra->new($url),\n-\t\t\t                config => SVN::Core::config_get_config(\n-\t\t\t                        $Git::SVN::Ra::config_dir\n-\t\t\t                ),\n \t\t\t                tree_a => \"$d~1\",\n \t\t\t                tree_b => $d,\n \t\t\t                editor_cb => sub {\n\nWe have a good reason to read config dirs there for getting auto-props,\nthough, so the above patch isn't going into git.git\n\n-- \nEric Wong\n"},{"id":"131437","messageId":"loom.20100113T080137-723@post.gmane.org","threadId":"22186","inReplyTo":"20100113054138.GB23182@dcvr.yhbt.net","subject":"Re: git-svn dcommit ignores --username if there are cached credentials","fromName":"Michel Jouvin","fromEmail":"jouvin@lal.in2p3.fr","sentAt":"2010-01-13T07:05:23Z","receivedAt":"2010-01-13T07:05:23Z","isPatch":false,"sender":{"key":"jouvin@lal.in2p3.fr","avatar":null},"body":"Eric Wong <normalperson <at> yhbt.net> writes:\n\n> Hi Michel,\n> \n> I wonder if this is because we explicitly reread the config directory\n> when creating Git::SVN::Editor.\n> \n> Does using --no-auth-cache work for you?\n> \n> Otherwise, try pointing --config-dir= to an empty directory.\n> \n> Or you can try this patch to force us to not reread the config_dir:\n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index 650c9e5..280fd15 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -550,9 +550,6 @@ sub cmd_dcommit {\n>  \t\t\tmy %ed_opts = ( r => $last_rev,\n>  \t\t\t                log => get_commit_entry($d)->{log},\n>  \t\t\t                ra => Git::SVN::Ra->new($url),\n> -\t\t\t                config => SVN::Core::config_get_config(\n> -\t\t\t                        $Git::SVN::Ra::config_dir\n> -\t\t\t                ),\n>  \t\t\t                tree_a => \"$d~1\",\n>  \t\t\t                tree_b => $d,\n>  \t\t\t                editor_cb => sub {\n> \n> We have a good reason to read config dirs there for getting auto-props,\n> though, so the above patch isn't going into git.git\n> \n\nHi Eric,\n\nThanks for your quick answer. Unfortunatly, none of the suggested workaround \nworked for me... I even tried to clone again the SVN repository passing the \nsuggested options when cloning but no effect. BTW, does specifying --username \nat cloning time should add something to some config file (like .git/config) ?\n\nCheers,\n\nMichel\n"}]}