You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Lars Kruse <li...@sumpfralle.de> on 2007/11/11 10:42:49 UTC

directory named "_svn" is ignored

[beware: this message was originally posted on the users list yesterday
(http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=71890)
Karl Fogel suggested, to put it here, too]


Hi,

I am using subversion v.1.4.4 on debian (x86, lenny).

Recently I encountered a strange problem: I was unable to update a working
directory when giving its complete path (output: 'skipping "."').
This problem disappeared, as soon as I changed to that directory before
updating.

I tracked down the problem to the name of the last directory node: the
problem only occours, when the directory is called "_svn".

It seems like subversion ignores directories named like that due to
compatibility towards the windows environment.
(http://subversion.tigris.org/svn_1.3_releasenotes.html - "Enhancements &
bugfixes" -> "Official support for windows '_svn' directories")

I am running linux and I did not set the mentioned environment variable
(SVN_ASP_DOT_NET_HACK), thus I do not expect, that directories called "_svn"
are treated as invalid.

See the commands and comments below to reproduce this behaviour:
(a working local copy called 'test' is required)

# check the working copy
$ svn up test
Revision 5.
# ok

# check if the working copy is usable after renaming to "_svn"
$ mv test _svn
$ svn up _svn/
Skipped '.'
# failure!

# change into the directory and do the same
$ cd _svn/
$ svn up
Revision 5.
# ok

# are subdirectories accessible?
$ cd ..
$ svn up _svn/wg-ludwig/
Revision 5.
# ok


btw: the same applies to directories named ".svn". But in this case it would be
less likely, that someone names a working copy like that.
My case of using "_svn" as a name is real. It took me some hours to
identify the root cause :(

It seems to me, as if svn would be guessing, that the parent directory is
meant, in case someone accesses directories called ".svn" or "_svn".
I do not expect a command line client to do this kind of guessing.

In case you really have to rely on this guessing, I would prefer, if there
would be a test (e.g. is there a subdirectory ".svn" inside of the specified
directory?), that would make sure, that the specified direcotory was _really_ a
mistake and not just "could-be-a-mistake".

thanks for your time!
reards,
Lars

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

Re: directory named "_svn" is ignored

Posted by Augie Fackler <du...@gmail.com>.
On Nov 19, 2007, at 3:53 PM, C. Michael Pilato wrote:

> Augie Fackler wrote:
>>
>> On Nov 19, 2007, at 3:42 PM, Karl Fogel wrote:
>>
>>> Augie Fackler <du...@gmail.com> writes:
>>>> http://subversion.tigris.org/issues/show_bug.cgi?id=3026
>>>
>>> One more thing: the code in adm_files.c predates the invention of
>>> subversion/include/private/*.h.  It's possible that some of the adm
>>> area handling could be simplified now, by using svn_wc_private.h.   
>>> So
>>> don't take the current architecture as gospel -- if things look
>>> twisted, it's because they are, and you're free to untwist them!
>>
>> Excellent. The actual code responsible for silently ignoring .svn and
>> _svn is in subversion/libsvn_subr/opt.c:1011. If nobody beats me to  
>> it,
>> I'll add some code there to print a warning to the user. My  
>> inclination
>> is that the client should bail out if it sees an argument like this
>> (rather than continue) - does anyone vehemently object to that?
>
> We must continue to allow folks to do:
>
>  $ svn propget svn:mergeinfo .*
>
> (where that * will be expanded to include .svn) without error.  I  
> don't have
> any problem with printing a "hey we skipped .svn on your behalf"  
> message,
> but doing so must not interrupt the operation.

Ah, very true. I knew there was a reason I shouldn't do that. :)
Thanks!

Augie

(sorry about the double-send, cmpilato, I had reply-brain-failure)

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

Re: directory named "_svn" is ignored

Posted by "C. Michael Pilato" <cm...@collab.net>.
Augie Fackler wrote:
> 
> On Nov 19, 2007, at 3:42 PM, Karl Fogel wrote:
> 
>> Augie Fackler <du...@gmail.com> writes:
>>> http://subversion.tigris.org/issues/show_bug.cgi?id=3026
>>
>> One more thing: the code in adm_files.c predates the invention of
>> subversion/include/private/*.h.  It's possible that some of the adm
>> area handling could be simplified now, by using svn_wc_private.h.  So
>> don't take the current architecture as gospel -- if things look
>> twisted, it's because they are, and you're free to untwist them!
> 
> Excellent. The actual code responsible for silently ignoring .svn and
> _svn is in subversion/libsvn_subr/opt.c:1011. If nobody beats me to it,
> I'll add some code there to print a warning to the user. My inclination
> is that the client should bail out if it sees an argument like this
> (rather than continue) - does anyone vehemently object to that?

We must continue to allow folks to do:

   $ svn propget svn:mergeinfo .*

(where that * will be expanded to include .svn) without error.  I don't have
any problem with printing a "hey we skipped .svn on your behalf" message,
but doing so must not interrupt the operation.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: directory named "_svn" is ignored

Posted by Augie Fackler <du...@gmail.com>.
On Nov 19, 2007, at 3:42 PM, Karl Fogel wrote:

> Augie Fackler <du...@gmail.com> writes:
>> http://subversion.tigris.org/issues/show_bug.cgi?id=3026
>
> One more thing: the code in adm_files.c predates the invention of
> subversion/include/private/*.h.  It's possible that some of the adm
> area handling could be simplified now, by using svn_wc_private.h.  So
> don't take the current architecture as gospel -- if things look
> twisted, it's because they are, and you're free to untwist them!

Excellent. The actual code responsible for silently ignoring .svn and  
_svn is in subversion/libsvn_subr/opt.c:1011. If nobody beats me to  
it, I'll add some code there to print a warning to the user. My  
inclination is that the client should bail out if it sees an argument  
like this (rather than continue) - does anyone vehemently object to  
that?

Augie

>
>
> -Karl
>
>

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

Re: directory named "_svn" is ignored

Posted by Karl Fogel <kf...@red-bean.com>.
Augie Fackler <du...@gmail.com> writes:
> http://subversion.tigris.org/issues/show_bug.cgi?id=3026

One more thing: the code in adm_files.c predates the invention of
subversion/include/private/*.h.  It's possible that some of the adm
area handling could be simplified now, by using svn_wc_private.h.  So
don't take the current architecture as gospel -- if things look
twisted, it's because they are, and you're free to untwist them!

-Karl


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

Re: directory named "_svn" is ignored

Posted by Karl Fogel <kf...@red-bean.com>.
Augie Fackler <du...@gmail.com> writes:
> http://subversion.tigris.org/issues/show_bug.cgi?id=3026

(Btw, the issue should point to this mailing list thread.)

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

Re: directory named "_svn" is ignored

Posted by Karl Fogel <kf...@red-bean.com>.
Augie Fackler <du...@gmail.com> writes:
> Filed:
> http://subversion.tigris.org/issues/show_bug.cgi?id=3026

Thanks!

> I'll take a look at this tonight if I have time - it's an interesting
> little bug to me. (On that note, anyone want to kick me towards the
> right hunk of code? I'm assuming it's in the svn binary itself).

subversion/libsvn_wc/adm_files.c is the place to start, I think.
Search for

   default_adm_dir_name
   adm_dir_name
   "_svn"               /* with the double quotes */

-Karl

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

Re: directory named "_svn" is ignored

Posted by Augie Fackler <du...@gmail.com>.
On Nov 19, 2007, at 3:08 PM, Karl Fogel wrote:

> Augie Fackler <du...@gmail.com> writes:
>> On Nov 19, 2007, at 1:35 AM, Karl Fogel wrote:
>>> Do these behaviors all reproduce with the latest trunk  
>>> Subversion?  If
>>> you have time to test, that would be very helpful.  If not, I'll try
>>> to do it soon and file a bug.
>>
>> I checked this and it does happen in the trunk version.
>
> Thank you, Augie!
>
> Got time to file an issue for it?  I know it's shameless of me to try
> to pass the work off to you like that, but I promise to use the time
> well -- I'm deep in merge-tracking studies at the moment.


Filed:
http://subversion.tigris.org/issues/show_bug.cgi?id=3026

I'll take a look at this tonight if I have time - it's an interesting  
little bug to me. (On that note, anyone want to kick me towards the  
right hunk of code? I'm assuming it's in the svn binary itself).

Augie

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

Re: directory named "_svn" is ignored

Posted by Karl Fogel <kf...@red-bean.com>.
Augie Fackler <du...@gmail.com> writes:
> On Nov 19, 2007, at 1:35 AM, Karl Fogel wrote:
>> Do these behaviors all reproduce with the latest trunk Subversion?  If
>> you have time to test, that would be very helpful.  If not, I'll try
>> to do it soon and file a bug.
>
> I checked this and it does happen in the trunk version.

Thank you, Augie!

Got time to file an issue for it?  I know it's shameless of me to try
to pass the work off to you like that, but I promise to use the time
well -- I'm deep in merge-tracking studies at the moment.

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

Re: directory named "_svn" is ignored

Posted by Augie Fackler <du...@gmail.com>.
On Nov 19, 2007, at 1:35 AM, Karl Fogel wrote:

> Do these behaviors all reproduce with the latest trunk Subversion?  If
> you have time to test, that would be very helpful.  If not, I'll try
> to do it soon and file a bug.
>

I checked this and it does happen in the trunk version.

Augie

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

Re: directory named "_svn" is ignored

Posted by Lars Kruse <li...@sumpfralle.de>.
Hi,

> This sounds like buggy behavior, independently of whether "_svn" is
> treated like ".svn" -- we shouldn't be treating either of them in this
> way!  That is, if we're going to protect ".svn" (and maybe "_svn")
> from being targets, this is not the right way to do it anyway.
> 
> Do these behaviors all reproduce with the latest trunk Subversion?  If
> you have time to test, that would be very helpful.  If not, I'll try
> to do it soon and file a bug.

It would be great, if you could do it ...

Thanks for taking care for the problem!

regards,
Lars

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

Re: directory named "_svn" is ignored

Posted by Karl Fogel <kf...@red-bean.com>.
Lars Kruse <li...@sumpfralle.de> writes:
> ah - good question - now we can clear up the confusion:
> for now I was always talking about the top directory of my local working copy.
> Thus this is not a name of an item within the repository, but just the name of
> a directory within my local filesystem.
>
> Then I did some more tests and now the problem seems to be clear:
>
> (1) svn mkdir _svn
> output: svn: Not enough arguments provided; try 'svn help' for more info
>
> (2) svn up SOMEDIR/_svn
> result: svn always tries to update the _current_ directory - no matter, what
> SOMEDIR contains
>
> (3) svn co https://systemausfall.org/svn/lars _svn
> result: a local directory named "lars" is created, instead of "_svn"
>
> It looks like svn simply ignores any command line argument ending in ".svn" or
> "_svn", since all of the above examples show the behaviour, that would happen
> _without_ the specific argument.
>
> So my previous assumption, that the svn CLI removes the last part of a
> directory if it is ".svn" or "_svn" was wrong.
> Instead, it completely ignores all the arguments that happen to end in one of
> these magic strings.
>
> I hope, this helps to clarify the problem,

Yes, very much!

This sounds like buggy behavior, independently of whether "_svn" is
treated like ".svn" -- we shouldn't be treating either of them in this
way!  That is, if we're going to protect ".svn" (and maybe "_svn")
from being targets, this is not the right way to do it anyway.

Do these behaviors all reproduce with the latest trunk Subversion?  If
you have time to test, that would be very helpful.  If not, I'll try
to do it soon and file a bug.

Thank you,
-Karl

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

Re: directory named "_svn" is ignored

Posted by Lars Kruse <li...@sumpfralle.de>.
Hi,

> Lars Kruse <li...@sumpfralle.de> writes:
> > For now the svn CLI guesses, that any directory name ending in some magic
> > strings (in this case: ".svn" or "_svn") must be a mistake of the user -
> > thus just skipping step (1).
> 
> Wait -- does it really do that?  Does it disallow any directory
> *ending* in the magic strings?  I thought it only disallowed any
> object whose name actually *is* the magic string, and that we were
> just discussing what the set of magic strings should be.
> 
> Which is it?

ah - good question - now we can clear up the confusion:
for now I was always talking about the top directory of my local working copy.
Thus this is not a name of an item within the repository, but just the name of
a directory within my local filesystem.

Then I did some more tests and now the problem seems to be clear:

(1) svn mkdir _svn
output: svn: Not enough arguments provided; try 'svn help' for more info

(2) svn up SOMEDIR/_svn
result: svn always tries to update the _current_ directory - no matter, what
SOMEDIR contains

(3) svn co https://systemausfall.org/svn/lars _svn
result: a local directory named "lars" is created, instead of "_svn"


It looks like svn simply ignores any command line argument ending in ".svn" or
"_svn", since all of the above examples show the behaviour, that would happen
_without_ the specific argument.

So my previous assumption, that the svn CLI removes the last part of a
directory if it is ".svn" or "_svn" was wrong.
Instead, it completely ignores all the arguments that happen to end in one of
these magic strings.

I hope, this helps to clarify the problem,
Lars

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

Re: directory named "_svn" is ignored

Posted by Karl Fogel <kf...@red-bean.com>.
Lars Kruse <li...@sumpfralle.de> writes:
> For now the svn CLI guesses, that any directory name ending in some magic
> strings (in this case: ".svn" or "_svn") must be a mistake of the user - thus
> just skipping step (1).

Wait -- does it really do that?  Does it disallow any directory
*ending* in the magic strings?  I thought it only disallowed any
object whose name actually *is* the magic string, and that we were
just discussing what the set of magic strings should be.

Which is it?

> yes - my naming convention ("_svn") for local copies is rare, but it took me
> some time and energy to find the cause of my problem, since I trusted in the
> reliability of the svn client. Thus I could not imagine, that the following two
> lines could make a difference:
>  svn up SOMEDIR
>  (cd SOMEDIR; svn up)
> (the latter always works - the first breaks for the mentioned special strings)

Yes, I understand your frustration.

There are some good reasons why we might want to block "_svn" by
default, but perhaps we should at least make this a configurable
behavior.  Or perhaps we should turn it off and instead ship a
pre-commit hook that lets admins block objects named "_svn" if they
want to.  I'm not sure... but first I'd like to get clarification on
my question above! :-)

-Karl

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

Re: directory named "_svn" is ignored

Posted by Lars Kruse <li...@sumpfralle.de>.
Hi,

> It seems to me, as if svn would be guessing, that the parent directory is
> meant, in case someone accesses directories called ".svn" or "_svn".
> I do not expect a command line client to do this kind of guessing.

the topic seems to get lost right now, so I would like to clarify it a bit:

The misbehaviour, that I noticed does not involve the SVN_ASP_DOT_NET_HACK.

I think, that the subversion command line client should:
 (1) first check, if the directory specified by the user is valid (= a working
     copy)
 (2) afterwards (maybe) guess if the user actually meant something else and try
     this alternative option

For now the svn CLI guesses, that any directory name ending in some magic
strings (in this case: ".svn" or "_svn") must be a mistake of the user - thus
just skipping step (1).

yes - my naming convention ("_svn") for local copies is rare, but it took me
some time and energy to find the cause of my problem, since I trusted in the
reliability of the svn client. Thus I could not imagine, that the following two
lines could make a difference:
 svn up SOMEDIR
 (cd SOMEDIR; svn up)
(the latter always works - the first breaks for the mentioned special strings)

thanks for your time,
Lars

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

Re: directory named "_svn" is ignored

Posted by Lars Kruse <li...@sumpfralle.de>.
Hi,

> Lars, I believe that we specifically disallow "_svn" in the repository
> for interoperability between different clients that are using both
> ".svn" and "_svn" administrative directories.  If we allowed "_svn"
> into the repository, how would the users who have SVN_ASP_DOT_NET_HACK
> pull that directory from the repository?

Maybe I overlooked something, but from my point of view, the following thing
should happen after issueing "svn up SOME_DIR":

 1) check if SOME_DIR contains a subdirectory called ".svn" resp. "_svn"

 2a) if (1) succeeded, then SOME_DIR is a valid directory

 2b) if (1) fails, then check if the last part of SOME_DIR is ".svn" or "_svn" -
in this case, obviously the user wanted to ask for the parent directory of
SOME_DIR (e.g. issuing "svn up foo/.svn" instead of "svn up foo")


If I don't get it wrong, then the current behaviour is:
 start with (2)
 continue with (1)
The opposite order should be correct, I would say.


In my case, the directory called "_svn" is the root directory of my local
working copy - thus there is no conflict here.

I do not see a scenario, where a reversed order of checks (as described above)
could cause a conflict with the SVN_ASP_DOT_NET_HACK.
Or am I missing something?

regards,
Lars

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

Re: directory named "_svn" is ignored

Posted by Daniel Rall <dl...@collab.net>.
Lars, I believe that we specifically disallow "_svn" in the repository
for interoperability between different clients that are using both
".svn" and "_svn" administrative directories.  If we allowed "_svn"
into the repository, how would the users who have SVN_ASP_DOT_NET_HACK
pull that directory from the repository?

- Dan


On Sun, 11 Nov 2007, Lars Kruse wrote:

> [beware: this message was originally posted on the users list yesterday
> (http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=71890)
> Karl Fogel suggested, to put it here, too]
> 
> 
> Hi,
> 
> I am using subversion v.1.4.4 on debian (x86, lenny).
> 
> Recently I encountered a strange problem: I was unable to update a working
> directory when giving its complete path (output: 'skipping "."').
> This problem disappeared, as soon as I changed to that directory before
> updating.
> 
> I tracked down the problem to the name of the last directory node: the
> problem only occours, when the directory is called "_svn".
> 
> It seems like subversion ignores directories named like that due to
> compatibility towards the windows environment.
> (http://subversion.tigris.org/svn_1.3_releasenotes.html - "Enhancements &
> bugfixes" -> "Official support for windows '_svn' directories")
> 
> I am running linux and I did not set the mentioned environment variable
> (SVN_ASP_DOT_NET_HACK), thus I do not expect, that directories called "_svn"
> are treated as invalid.
> 
> See the commands and comments below to reproduce this behaviour:
> (a working local copy called 'test' is required)
> 
> # check the working copy
> $ svn up test
> Revision 5.
> # ok
> 
> # check if the working copy is usable after renaming to "_svn"
> $ mv test _svn
> $ svn up _svn/
> Skipped '.'
> # failure!
> 
> # change into the directory and do the same
> $ cd _svn/
> $ svn up
> Revision 5.
> # ok
> 
> # are subdirectories accessible?
> $ cd ..
> $ svn up _svn/wg-ludwig/
> Revision 5.
> # ok
> 
> 
> btw: the same applies to directories named ".svn". But in this case it would be
> less likely, that someone names a working copy like that.
> My case of using "_svn" as a name is real. It took me some hours to
> identify the root cause :(
> 
> It seems to me, as if svn would be guessing, that the parent directory is
> meant, in case someone accesses directories called ".svn" or "_svn".
> I do not expect a command line client to do this kind of guessing.
> 
> In case you really have to rely on this guessing, I would prefer, if there
> would be a test (e.g. is there a subdirectory ".svn" inside of the specified
> directory?), that would make sure, that the specified direcotory was _really_ a
> mistake and not just "could-be-a-mistake".