You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Chris Hecker <ch...@d6.com> on 2003/06/23 07:27:22 UTC

%HOME% on Win32 (Re: ra_dav compression question)

> > PPS.  Special bonus question that I haven't had time to look in the
> > source to answer:  for the Win32 client, is there any way to use the
> > %HOME%\.subversion directory rather than \Documents and Settings\blah
> > blah blah\Subverion directory.
>No. How many points do I get for this answer? :-)

How many points you get depends on which "no" it is.  Is that "no" as in 
"no, that's not currently possible but if somebody wrote the code...", or 
"no" as in "we will absolutely never consider such a feature"?  :)  If it's 
the former I'd be happy to submit a patch and you get full points.

>Putting per-user settings in %APPADATA%\Subversion is simply following
>the Windows conventions, same as putting them in ~/.subversion is
>following the Unix conventions. It's also necessary to do so if you want
>the SVN settings to work correctly with roaming profiles and such.

Sure, but there are a zillion other command line tools that use %HOME% 
(many many more than use the Windows conventions, like emacs, cvs, cygwin 
tools, openssl, etc...all unix ports, to be sure, but also highly 
correlated with commandline source code control tool use as well, I'd 
assume), so I claim giving people the option to use %HOME% if they choose 
is the right thing.  Anybody who goes and toasts their %APPDATA%\Subversion 
directory and also has a %HOME%\.subversion directory is already making a 
choice to manage their user information themselves.  Or, another 
alternative is having a %SVNHOME% envvar, and the Win32 default install can 
stuff it with %APPDATA% (like it does with the APR_ICONV_PATH) and users 
who want to can change it.  I think silently testing existence on 
%APPDATA%\Subversion and %HOME%\.subversion is better than yet another 
environment variable, but either way is fine with me as long as it's 
possible to put the configs in %HOME%\.subversion.  Or, how about following 
a link if %APPDATA%\Subversion is a .lnk.  Lots of possibilities.

Thoughts?

Thanks,
Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: %HOME% on Win32 (Re: ra_dav compression question)

Posted by Branko Čibej <br...@xbc.nu>.
Chris Hecker wrote:

> You can already change your %APPDATA% setting to, say, a subdirectory of
>
>> your %HOME%. So you can get almost exactly what you want without
>> changing a single line of SVN code.
>
>
> This will destroy the universe, I'm fairly sure.  Windows is really
> bad about that kind of thing.  I've never tried it, however.  Have you?

Yes, I have. It works. And these days, Windows is really _good_ about
these things; only programs that don't conform to the Windows
conventions have problems, and that'w what I want to avoid.

>> However, Subversion also _creates_ that directory; how does it know
>> which you prefer?
>
>
> Sorry, I wasn't clear.  I was saying that if it finds that directory
> is not there, it will check for %HOME%/.subversion as well.  That's
> all.  So, most of the time it will just use %APPDATA% for people who
> don't care, but if somebody does then they'll move the directory and
> svn will do the right thing. 

I see. So you create %HOME%/.subversion before running SVN for the first
time, nad make sure the %APPDATA%/Subversion doesn't exist, and from
that point on things should just work?

Hm.

> From looking at it briefly, it'll be very little code to make this
> change, only a few lines in one function
> (svn_config__user_config_path) and one line in the config_impl.h
> header to do it right. 

Oh, no. All of this logic should go into config_win.c, and nowhere else.
It's _different_ than on Unix, even with just the directory check.

> That won't work, .lnk files are handled by the Explorer, not the
>
>> filesystem. However, on Win2k and above, you can make
>> %APPDATA%\Subversion a junction to anywhere you like -- again, not
>> having to change a single line of code in SVN.
>
>
> Except junctions aren't very well documented or supported

Yes, they are, if you look at the right place. Also, the "dir" command
will show junctions.

> and there are reports of filesystem weirdness when using them.

What kind? I've been using them for years, with no percieved weirdness.
The main thing is that they're supported on the filesystem level. The
drawback is that they're NTFS-only, but if you ask me, people who don't
use NTFS are in for trouble anyway.

> Again, I'm happy to write the 10 lines of code and test them and send
> a patch to the HEAD, I just want to know it will be considered before
> I do that.  If you're absolutely not interested I won't bother. 
> However, I think the feature is sound and this is the best of the
> options.

This discussion is similar to the one about whether the SVN command-line
client should print paths with \ or / as a separator. As always, my
first answer is to conform to the OS native conventions.

What you're proposing complicates the code, but it's just possible that
the complication isn't too big. So, let's see the patch first, and
decide afterwards.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: %HOME% on Win32 (Re: ra_dav compression question)

Posted by Chris Hecker <ch...@d6.com>.
>Exactly. Unix ports. Subversion on Windows is _not_ a Unix port, believe
>it or not.

Sure, that's why I put the parenthetical comment in there.  My point is 
there's going to be a high correlation between people who have %HOME% 
defined and people who use svn.exe.  But anyway, I'm not saying to break 
the old way, I'm saying to check for the new way in addition.  I don't 
think it will be much code.  And, as a side benefit, the 8 zillion comments 
in the code referring to ~/.subversion will suddenly be optionally 
applicable to Win32 (since you're _not_ a unix port, this might appeal to 
you :).

>You can already change your %APPDATA% setting to, say, a subdirectory of
>your %HOME%. So you can get almost exactly what you want without
>changing a single line of SVN code.

This will destroy the universe, I'm fairly sure.  Windows is really bad 
about that kind of thing.  I've never tried it, however.  Have you?  But 
even if it did work, it's not what you want; you don't want a huge slew of 
random windows apps writing into your home directory, you want your 
"unix-like" command line tools to do so.  So, this should be a subversion 
specific thing, I think.

>Note that
>%HOME% is not a standard env. var on Windows, so you're proposing a
>"new" variable in any case. :-)
>However, Subversion also _creates_ that directory; how does it know
>which you prefer?

Sorry, I wasn't clear.  I was saying that if it finds that directory is not 
there, it will check for %HOME%/.subversion as well.  That's all.  So, most 
of the time it will just use %APPDATA% for people who don't care, but if 
somebody does then they'll move the directory and svn will do the right thing.

 From looking at it briefly, it'll be very little code to make this change, 
only a few lines in one function (svn_config__user_config_path) and one 
line in the config_impl.h header to do it right.

>That won't work, .lnk files are handled by the Explorer, not the
>filesystem. However, on Win2k and above, you can make
>%APPDATA%\Subversion a junction to anywhere you like -- again, not
>having to change a single line of code in SVN.

Except junctions aren't very well documented or supported and there are 
reports of filesystem weirdness when using them.  The .lnk suggestion was 
because a number of windows apps are starting to parse .lnk as a symbolic 
link transparently since junctions aren't first class citizens.  It's not 
hard, but it is more windows cruft.  The directory check is way simpler and 
cleaner, I think.

Again, I'm happy to write the 10 lines of code and test them and send a 
patch to the HEAD, I just want to know it will be considered before I do 
that.  If you're absolutely not interested I won't bother.  However, I 
think the feature is sound and this is the best of the options.

Chris



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: %HOME% on Win32 (Re: ra_dav compression question)

Posted by Branko Čibej <br...@xbc.nu>.
Chris Hecker wrote:

>
>> > PPS.  Special bonus question that I haven't had time to look in the
>> > source to answer:  for the Win32 client, is there any way to use the
>> > %HOME%\.subversion directory rather than \Documents and Settings\blah
>> > blah blah\Subverion directory.
>> No. How many points do I get for this answer? :-)
>
>
> How many points you get depends on which "no" it is.  Is that "no" as
> in "no, that's not currently possible but if somebody wrote the
> code...", or "no" as in "we will absolutely never consider such a
> feature"?  :)  If it's the former I'd be happy to submit a patch and
> you get full points. 

Heh. Whatever gets me more points, then. :-)

> Putting per-user settings in %APPADATA%\Subversion is simply following
>
>> the Windows conventions, same as putting them in ~/.subversion is
>> following the Unix conventions. It's also necessary to do so if you want
>> the SVN settings to work correctly with roaming profiles and such.
>
>
> Sure, but there are a zillion other command line tools that use %HOME%
> (many many more than use the Windows conventions, like emacs, cvs,
> cygwin tools, openssl, etc...all unix ports, to be sure,

Exactly. Unix ports. Subversion on Windows is _not_ a Unix port, believe
it or not.

> but also highly correlated with commandline source code control tool
> use as well, I'd assume), so I claim giving people the option to use
> %HOME% if they choose is the right thing.  Anybody who goes and toasts
> their %APPDATA%\Subversion directory and also has a %HOME%\.subversion
> directory is already making a choice to manage their user information
> themselves.

You can already change your %APPDATA% setting to, say, a subdirectory of
your %HOME%. So you can get almost exactly what you want without
changing a single line of SVN code.

>   Or, another alternative is having a %SVNHOME% envvar, and the Win32
> default install can stuff it with %APPDATA% (like it does with the
> APR_ICONV_PATH)

APR_ICONV_PATH is not a Subversion thing, it's an apr-iconv thing, and
(unfortunately) necessary.

> and users who want to can change it.  I think silently testing
> existence on %APPDATA%\Subversion and %HOME%\.subversion is better
> than yet another environment variable,

Absolutely, adding new environment variables is horrible. Note that
%HOME% is not a standard env. var on Windows, so you're proposing a
"new" variable in any case. :-)

However, Subversion also _creates_ that directory; how does it know
which you prefer?

> but either way is fine with me as long as it's possible to put the
> configs in %HOME%\.subversion.  Or, how about following a link if
> %APPDATA%\Subversion is a .lnk.  Lots of possibilities. 

That won't work, .lnk files are handled by the Explorer, not the
filesystem. However, on Win2k and above, you can make
%APPDATA%\Subversion a junction to anywhere you like -- again, not
having to change a single line of code in SVN.

I think a bit of documentation on the things you can already do -- i.e.,
move %APPDATA% or make a junction -- would be the best solution here. We
really don't want to complicate the configuration code more than it is
already.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org