You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Mark Phippard <ma...@gmail.com> on 2011/05/20 18:58:11 UTC
[PATCH] - Remove unneeded code from svnadmin
Log message and patch attached.
svnadmin create accepts the --config-dir option but no longer uses it
for anything. I do not believe we can remove the option from the UI,
but we can remove the code that get the configuration. The reason is
that I have observed a couple of odd scenarios where this code causes
problems.
1) The process running svnadmin does not have read authority to
$HOME/.subversion For example, here is an example from a mailing
list:
http://lists.okfn.org/pipermail/kforge-user/2007-February/000088.html
2) Have observed similar problem on Windows when the process is
running and it could not determine the home folder. Never figured out
the root cause of this problem, as normally this does work OK on
Windows.
The workaround people have used is to specify --config-dir and point
it at ' ' or some random folder they can read. But if we just removed
this code they would not get a problem in the first place.
Ran make check and manually tested the binary.
--
Thanks
Mark Phippard
http://markphip.blogspot.com/
Re: [PATCH] - Remove unneeded code from svnadmin
Posted by Stefan Sperling <st...@elego.de>.
On Fri, May 20, 2011 at 12:58:11PM -0400, Mark Phippard wrote:
> Log message and patch attached.
>
> svnadmin create accepts the --config-dir option but no longer uses it
> for anything. I do not believe we can remove the option from the UI,
> but we can remove the code that get the configuration. The reason is
> that I have observed a couple of odd scenarios where this code causes
> problems.
>
> 1) The process running svnadmin does not have read authority to
> $HOME/.subversion For example, here is an example from a mailing
> list:
>
> http://lists.okfn.org/pipermail/kforge-user/2007-February/000088.html
>
> 2) Have observed similar problem on Windows when the process is
> running and it could not determine the home folder. Never figured out
> the root cause of this problem, as normally this does work OK on
> Windows.
>
> The workaround people have used is to specify --config-dir and point
> it at ' ' or some random folder they can read. But if we just removed
> this code they would not get a problem in the first place.
>
> Ran make check and manually tested the binary.
>
> --
> Thanks
>
> Mark Phippard
> http://markphip.blogspot.com/
> Remove unneeded code that can cause errors.
>
> svnadmin create accepts the --config-dir option but no longer use it.
> Have seen errors when process cannot determine HOME or read the $HOME/.subversion
>
> * subversion/svnadmin/main.c
> (subcommand_create): Remove code to get and apply the config.
> Index: subversion/svnadmin/main.c
> ===================================================================
> --- subversion/svnadmin/main.c (revision 1125450)
> +++ subversion/svnadmin/main.c (working copy)
> @@ -616,9 +616,6 @@
> APR_HASH_KEY_STRING,
> "1");
>
> - SVN_ERR(svn_config_get_config(&config, opt_state->config_dir, pool));
> - SVN_ERR(svn_cmdline__apply_config_options(config, opt_state->config_options,
> - "svnadmin: ", "--config-option"));
> SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
> NULL, NULL,
> config, fs_config, pool));
I think we should remove the 'config' variable altogether and pass NULL
instead. This is allowed as per svn_repos_create()'s docstring.
Re: [PATCH] - Remove unneeded code from svnadmin
Posted by Kamesh Jayachandran <ka...@collab.net>.
On 05/23/2011 02:28 PM, Prabhu Gnana Sundar wrote:
> On Monday 23 May 2011 02:02 PM, Stefan Sperling wrote:
>> On Mon, May 23, 2011 at 01:08:28PM +0530, Prabhu Gnana Sundar wrote:
>>> Hi all,
>>>
>>> I have attached my recent patch along with this mail. Please
>>> share your views.
>>>
>>>
>> Can you provide a log message, too?
>>
> Sure Stefan :)
>
> Attaching the log message with this mail. Also attached is the updated
> patch with the change that you suggested below.
>
>
>
> Thanks and regards
> Prabhu
>>> Index: subversion/svnadmin/main.c
>>> ===================================================================
>>> --- subversion/svnadmin/main.c (revision 1126350)
>>> +++ subversion/svnadmin/main.c (working copy)
>>> @@ -585,7 +585,6 @@
>>> {
>>> struct svnadmin_opt_state *opt_state = baton;
>>> svn_repos_t *repos;
>>> - apr_hash_t *config;
>>> apr_hash_t *fs_config = apr_hash_make(pool);
>>>
>>> /* Expect no more arguments. */
>>> @@ -624,12 +623,9 @@
>>> APR_HASH_KEY_STRING,
>>> "1");
>>>
>>> - SVN_ERR(svn_config_get_config(&config, opt_state->config_dir,
>>> pool));
>>> - SVN_ERR(svn_cmdline__apply_config_options(config,
>>> opt_state->config_options,
>>> - "svnadmin: ",
>>> "--config-option"));
This PATCH ignores --config-option.
Bert via r1080198 you seemed to have introduced --config-option to svnadmin.
I am not aware of a case where --config-option would be needed for svnadmin.
Can you clarify?
With regards
Kamesh Jayachandran
>>> SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
>>> NULL, NULL,
>>> - config, fs_config, pool));
>>> + NULL, fs_config, pool));
>> We could wrap the above two lines into a single line.
>> So that we have just one line reading:
>>
>> NULL, NULL, NULL, fs_config_pool));
>>
>> Looks good to me, thanks!
>>
>>> svn_fs_set_warning_func(svn_repos_fs(repos), warning_func, NULL);
>>> return SVN_NO_ERROR;
>>> }
>
Re: [PATCH] - Remove unneeded code from svnadmin
Posted by Kamesh Jayachandran <ka...@collab.net>.
On 05/23/2011 02:28 PM, Prabhu Gnana Sundar wrote:
> On Monday 23 May 2011 02:02 PM, Stefan Sperling wrote:
>> On Mon, May 23, 2011 at 01:08:28PM +0530, Prabhu Gnana Sundar wrote:
>>> Hi all,
>>>
>>> I have attached my recent patch along with this mail. Please
>>> share your views.
>>>
>>>
>> Can you provide a log message, too?
>>
> Sure Stefan :)
>
> Attaching the log message with this mail. Also attached is the updated
> patch with the change that you suggested below.
>
>
>
> Thanks and regards
> Prabhu
>>> Index: subversion/svnadmin/main.c
>>> ===================================================================
>>> --- subversion/svnadmin/main.c (revision 1126350)
>>> +++ subversion/svnadmin/main.c (working copy)
>>> @@ -585,7 +585,6 @@
>>> {
>>> struct svnadmin_opt_state *opt_state = baton;
>>> svn_repos_t *repos;
>>> - apr_hash_t *config;
>>> apr_hash_t *fs_config = apr_hash_make(pool);
>>>
>>> /* Expect no more arguments. */
>>> @@ -624,12 +623,9 @@
>>> APR_HASH_KEY_STRING,
>>> "1");
>>>
>>> - SVN_ERR(svn_config_get_config(&config, opt_state->config_dir,
>>> pool));
>>> - SVN_ERR(svn_cmdline__apply_config_options(config,
>>> opt_state->config_options,
>>> - "svnadmin: ",
>>> "--config-option"));
>>> SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
>>> NULL, NULL,
>>> - config, fs_config, pool));
>>> + NULL, fs_config, pool));
>> We could wrap the above two lines into a single line.
>> So that we have just one line reading:
>>
>> NULL, NULL, NULL, fs_config_pool));
>>
>> Looks good to me, thanks!
>>
>>> svn_fs_set_warning_func(svn_repos_fs(repos), warning_func, NULL);
>>> return SVN_NO_ERROR;
>>> }
>
Thanks Prabhu,
I committed your two patches together as they are related at r1126459.
With regards
Kamesh Jayachandran
Re: [PATCH] - Remove unneeded code from svnadmin
Posted by Prabhu Gnana Sundar <pr...@collab.net>.
On Monday 23 May 2011 02:02 PM, Stefan Sperling wrote:
> On Mon, May 23, 2011 at 01:08:28PM +0530, Prabhu Gnana Sundar wrote:
>> Hi all,
>>
>> I have attached my recent patch along with this mail. Please
>> share your views.
>>
>>
> Can you provide a log message, too?
>
Sure Stefan :)
Attaching the log message with this mail. Also attached is the updated
patch with the change that you suggested below.
Thanks and regards
Prabhu
>> Index: subversion/svnadmin/main.c
>> ===================================================================
>> --- subversion/svnadmin/main.c (revision 1126350)
>> +++ subversion/svnadmin/main.c (working copy)
>> @@ -585,7 +585,6 @@
>> {
>> struct svnadmin_opt_state *opt_state = baton;
>> svn_repos_t *repos;
>> - apr_hash_t *config;
>> apr_hash_t *fs_config = apr_hash_make(pool);
>>
>> /* Expect no more arguments. */
>> @@ -624,12 +623,9 @@
>> APR_HASH_KEY_STRING,
>> "1");
>>
>> - SVN_ERR(svn_config_get_config(&config, opt_state->config_dir, pool));
>> - SVN_ERR(svn_cmdline__apply_config_options(config, opt_state->config_options,
>> - "svnadmin: ", "--config-option"));
>> SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
>> NULL, NULL,
>> - config, fs_config, pool));
>> + NULL, fs_config, pool));
> We could wrap the above two lines into a single line.
> So that we have just one line reading:
>
> NULL, NULL, NULL, fs_config_pool));
>
> Looks good to me, thanks!
>
>> svn_fs_set_warning_func(svn_repos_fs(repos), warning_func, NULL);
>> return SVN_NO_ERROR;
>> }
Re: [PATCH] - Remove unneeded code from svnadmin
Posted by Stefan Sperling <st...@elego.de>.
On Mon, May 23, 2011 at 01:08:28PM +0530, Prabhu Gnana Sundar wrote:
> Hi all,
>
> I have attached my recent patch along with this mail. Please
> share your views.
>
>
Can you provide a log message, too?
> Index: subversion/svnadmin/main.c
> ===================================================================
> --- subversion/svnadmin/main.c (revision 1126350)
> +++ subversion/svnadmin/main.c (working copy)
> @@ -585,7 +585,6 @@
> {
> struct svnadmin_opt_state *opt_state = baton;
> svn_repos_t *repos;
> - apr_hash_t *config;
> apr_hash_t *fs_config = apr_hash_make(pool);
>
> /* Expect no more arguments. */
> @@ -624,12 +623,9 @@
> APR_HASH_KEY_STRING,
> "1");
>
> - SVN_ERR(svn_config_get_config(&config, opt_state->config_dir, pool));
> - SVN_ERR(svn_cmdline__apply_config_options(config, opt_state->config_options,
> - "svnadmin: ", "--config-option"));
> SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
> NULL, NULL,
> - config, fs_config, pool));
> + NULL, fs_config, pool));
We could wrap the above two lines into a single line.
So that we have just one line reading:
NULL, NULL, NULL, fs_config_pool));
Looks good to me, thanks!
> svn_fs_set_warning_func(svn_repos_fs(repos), warning_func, NULL);
> return SVN_NO_ERROR;
> }
Re: [PATCH] - Remove unneeded code from svnadmin
Posted by Prabhu Gnana Sundar <pr...@collab.net>.
Hi all,
I have attached my recent patch along with this mail. Please share
your views.
Thanks and regards
Prabhu
On Saturday 21 May 2011 09:39 PM, Mark Phippard wrote:
> On Sat, May 21, 2011 at 11:12 AM, Kamesh Jayachandran<ka...@collab.net> wrote:
>> On 05/20/2011 10:28 PM, Mark Phippard wrote:
>>> Log message and patch attached.
>>>
>>> svnadmin create accepts the --config-dir option but no longer uses it
>>> for anything. I do not believe we can remove the option from the UI,
>>> but we can remove the code that get the configuration. The reason is
>>> that I have observed a couple of odd scenarios where this code causes
>>> problems.
>>>
>>> 1) The process running svnadmin does not have read authority to
>>> $HOME/.subversion For example, here is an example from a mailing
>>> list:
>>>
>>> http://lists.okfn.org/pipermail/kforge-user/2007-February/000088.html
>>>
>>> 2) Have observed similar problem on Windows when the process is
>>> running and it could not determine the home folder. Never figured out
>>> the root cause of this problem, as normally this does work OK on
>>> Windows.
>>>
>>> The workaround people have used is to specify --config-dir and point
>>> it at ' ' or some random folder they can read. But if we just removed
>>> this code they would not get a problem in the first place.
>>>
>>> Ran make check and manually tested the binary.
>>>
>>
>>> - SVN_ERR(svn_config_get_config(&config, opt_state->config_dir, pool));
>>> - SVN_ERR(svn_cmdline__apply_config_options(config,
>>> opt_state->config_options,
>>> - "svnadmin: ",
>>> "--config-option"));
>>> SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
>>> NULL, NULL,
>>> config, fs_config, pool));
>>
>> You can as well remove the config parameter and pass NULL instead.
>>
>> Prabhu posted similar patch 4 months back
>>
>> http://svn.haxx.se/dev/archive-2011-01/0157.shtml
>>
>> My +1 for this change.
> Thanks for the pointer. I think you should go ahead and commit
> Prabhu's patch. If some future version of Subversion starts to use
> the config in svn_repos_create it is easy enough to reinstate the code
> in this function. Until then, it seems like there are enough people
> getting an unnecessary error that we ought to fix it.
>
Re: [PATCH] - Remove unneeded code from svnadmin
Posted by Mark Phippard <ma...@gmail.com>.
On Sat, May 21, 2011 at 11:12 AM, Kamesh Jayachandran <ka...@collab.net> wrote:
> On 05/20/2011 10:28 PM, Mark Phippard wrote:
>>
>> Log message and patch attached.
>>
>> svnadmin create accepts the --config-dir option but no longer uses it
>> for anything. I do not believe we can remove the option from the UI,
>> but we can remove the code that get the configuration. The reason is
>> that I have observed a couple of odd scenarios where this code causes
>> problems.
>>
>> 1) The process running svnadmin does not have read authority to
>> $HOME/.subversion For example, here is an example from a mailing
>> list:
>>
>> http://lists.okfn.org/pipermail/kforge-user/2007-February/000088.html
>>
>> 2) Have observed similar problem on Windows when the process is
>> running and it could not determine the home folder. Never figured out
>> the root cause of this problem, as normally this does work OK on
>> Windows.
>>
>> The workaround people have used is to specify --config-dir and point
>> it at ' ' or some random folder they can read. But if we just removed
>> this code they would not get a problem in the first place.
>>
>> Ran make check and manually tested the binary.
>>
>
>
>> - SVN_ERR(svn_config_get_config(&config, opt_state->config_dir, pool));
>> - SVN_ERR(svn_cmdline__apply_config_options(config,
>> opt_state->config_options,
>> - "svnadmin: ",
>> "--config-option"));
>> SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
>> NULL, NULL,
>> config, fs_config, pool));
>
>
> You can as well remove the config parameter and pass NULL instead.
>
> Prabhu posted similar patch 4 months back
>
> http://svn.haxx.se/dev/archive-2011-01/0157.shtml
>
> My +1 for this change.
Thanks for the pointer. I think you should go ahead and commit
Prabhu's patch. If some future version of Subversion starts to use
the config in svn_repos_create it is easy enough to reinstate the code
in this function. Until then, it seems like there are enough people
getting an unnecessary error that we ought to fix it.
--
Thanks
Mark Phippard
http://markphip.blogspot.com/
Re: [PATCH] - Remove unneeded code from svnadmin
Posted by Kamesh Jayachandran <ka...@collab.net>.
On 05/20/2011 10:28 PM, Mark Phippard wrote:
> Log message and patch attached.
>
> svnadmin create accepts the --config-dir option but no longer uses it
> for anything. I do not believe we can remove the option from the UI,
> but we can remove the code that get the configuration. The reason is
> that I have observed a couple of odd scenarios where this code causes
> problems.
>
> 1) The process running svnadmin does not have read authority to
> $HOME/.subversion For example, here is an example from a mailing
> list:
>
> http://lists.okfn.org/pipermail/kforge-user/2007-February/000088.html
>
> 2) Have observed similar problem on Windows when the process is
> running and it could not determine the home folder. Never figured out
> the root cause of this problem, as normally this does work OK on
> Windows.
>
> The workaround people have used is to specify --config-dir and point
> it at ' ' or some random folder they can read. But if we just removed
> this code they would not get a problem in the first place.
>
> Ran make check and manually tested the binary.
>
>- SVN_ERR(svn_config_get_config(&config, opt_state->config_dir, pool));
>- SVN_ERR(svn_cmdline__apply_config_options(config, opt_state->config_options,
>- "svnadmin: ", "--config-option"));
> SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
> NULL, NULL,
> config, fs_config, pool));
You can as well remove the config parameter and pass NULL instead.
Prabhu posted similar patch 4 months back
http://svn.haxx.se/dev/archive-2011-01/0157.shtml
My +1 for this change.
With regards
Kamesh Jayachandran