You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Küng <to...@gmail.com> on 2011/02/06 10:42:33 UTC
mark .svn folders to not get indexed
Hi,
For some time now I've been looking for a way to configure the windows
indexing service to not index the .svn folders. I wanted to do that in
my installer for TSVN, but after countless hours of searching the web
and reading up even on the internals of the service I found that there
just isn't a way to do that.
Then I found a way to do this: just set the attribute
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED on the .svn folder - the files and
folders created in it will automatically inherit that attribute when
they get created.
But this would have to be done in the svn library when those folders and
files are created.
Unfortunately, apr doesn't provide a way to set this flag when creating
the folders or even later, so this would mean OS specific code in the
svn library.
The advantages for Windows users would be:
* a search won't show matches in the pristine files, those search
results are useless for users anyway and are only "spam" in the results
* the indexing service won't crawl unnecessary data, reducing disk
access a lot
* since the indexing service won't crawl the .svn folder anymore,
access-denied errors during svn commands would also get reduced,
especially errors like these:
http://subversion.wandisco.com/blogs/windows-7-bogus-errorfilecorrupt-error-.html
I still remember the heated discussions about setting the hidden
attribute on Windows for the .svn folders, so I'd like to discuss this
first before I commit the change to init_adm()
#ifdef WIN32
/* tell Windows to not index the admin dir and its content */
const char * admdirpath = svn_wc__adm_child(local_abspath, NULL, pool);
SetFileAttributes(admindirpath, GetFileAttributes(admindirpath)
|FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
#endif
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net
Re: mark .svn folders to not get indexed
Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Sun, Feb 6, 2011 at 12:42, Stefan Küng <to...@gmail.com> wrote:
> Hi,
>
> For some time now I've been looking for a way to configure the windows
> indexing service to not index the .svn folders. I wanted to do that in my
> installer for TSVN, but after countless hours of searching the web and
> reading up even on the internals of the service I found that there just
> isn't a way to do that.
>
> Then I found a way to do this: just set the attribute
> FILE_ATTRIBUTE_NOT_CONTENT_INDEXED on the .svn folder - the files and
> folders created in it will automatically inherit that attribute when they
> get created.
> But this would have to be done in the svn library when those folders and
> files are created.
>
> Unfortunately, apr doesn't provide a way to set this flag when creating the
> folders or even later, so this would mean OS specific code in the svn
> library.
>
> The advantages for Windows users would be:
> * a search won't show matches in the pristine files, those search results
> are useless for users anyway and are only "spam" in the results
> * the indexing service won't crawl unnecessary data, reducing disk access a
> lot
> * since the indexing service won't crawl the .svn folder anymore,
> access-denied errors during svn commands would also get reduced, especially
> errors like these:
> http://subversion.wandisco.com/blogs/windows-7-bogus-errorfilecorrupt-error-.html
>
>
> I still remember the heated discussions about setting the hidden attribute
> on Windows for the .svn folders, so I'd like to discuss this first before I
> commit the change to init_adm()
>
> #ifdef WIN32
> /* tell Windows to not index the admin dir and its content */
> const char * admdirpath = svn_wc__adm_child(local_abspath, NULL, pool);
> SetFileAttributes(admindirpath, GetFileAttributes(admindirpath)
> |FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
> #endif
>
>
>
I'm big +1 for marking .svn not indexed by Windows indexing service.
--
Ivan Zhakov
VisualSVN Team
Re: mark .svn folders to not get indexed
Posted by Stefan Küng <to...@gmail.com>.
On 07.02.2011 19:23, C. Michael Pilato wrote:
> On 02/07/2011 12:31 PM, Stefan Küng wrote:
>> On 07.02.2011 16:28, C. Michael Pilato wrote:
>>> Is there at least some attribution that needs to happen if we add it to our
>>> codebase?
>>
>> Actually, it's a copy of the function utf8_to_unicode_path() that's part of
>> apr, but apr doesn't export that function :(
>> That's why we need a copy of it.
>>
>> But the comment above the function should already tell you that?
>
> Doh! I managed to completely overlook that comment. Sorry, Stefan. :-(
>
> Is the function suitable for export from APR? I mean, it's is
> public-API-worthy like that? Maybe we should point to its general utility
> and get the APR folks to make that happen.
It's a Windows-only function. Not sure what the policy is here, maybe
apr doesn't allow exporting OS specific functions.
But other than that, it's perfectly fine to export it. And since that
function seems to be copied elsewhere too as you've noticed, it may be
worth exporting it to avoid even more copies of it.
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net
Re: mark .svn folders to not get indexed
Posted by "C. Michael Pilato" <cm...@collab.net>.
On 02/07/2011 12:31 PM, Stefan Küng wrote:
> On 07.02.2011 16:28, C. Michael Pilato wrote:
>> Is there at least some attribution that needs to happen if we add it to our
>> codebase?
>
> Actually, it's a copy of the function utf8_to_unicode_path() that's part of
> apr, but apr doesn't export that function :(
> That's why we need a copy of it.
>
> But the comment above the function should already tell you that?
Doh! I managed to completely overlook that comment. Sorry, Stefan. :-(
Is the function suitable for export from APR? I mean, it's is
public-API-worthy like that? Maybe we should point to its general utility
and get the APR folks to make that happen.
--
C. Michael Pilato <cm...@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
Re: mark .svn folders to not get indexed
Posted by Stefan Küng <to...@gmail.com>.
On 07.02.2011 16:28, C. Michael Pilato wrote:
> On 02/06/2011 09:27 AM, Stefan Küng wrote:
>> On 06.02.2011 11:43, Bert Huijben wrote:
>>
>>> Note that this patch is not really what you want: It doesn't handle UTF-8,
>>> nor long path names (which apr's version would do for us). We need to
>>> support both when we don't want to introduce a regression.
>>>
>>> In 1.7 we usually only have one .svn directory per workingcopy so there
>>> won't be any performance difference on our operations.
>>
>> Attached is a patch that would address the issue. I implemented it in
>> make_dir when the 'hidden' attribute is set: I just set the 'no index'
>> attribute as well.
>
> This patch bears a striking resemblance to similar code in mod_wsgi:
> http://code.google.com/p/modwsgi/source/browse/trunk/mod_wsgi/wsgi_apache.c?spec=svn1755&r=1755#72
>
> Is there at least some attribution that needs to happen if we add it to our
> codebase?
Actually, it's a copy of the function utf8_to_unicode_path() that's part
of apr, but apr doesn't export that function :(
That's why we need a copy of it.
But the comment above the function should already tell you that?
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net
Re: mark .svn folders to not get indexed
Posted by "C. Michael Pilato" <cm...@collab.net>.
On 02/06/2011 09:27 AM, Stefan Küng wrote:
> On 06.02.2011 11:43, Bert Huijben wrote:
>
>> Note that this patch is not really what you want: It doesn't handle UTF-8,
>> nor long path names (which apr's version would do for us). We need to
>> support both when we don't want to introduce a regression.
>>
>> In 1.7 we usually only have one .svn directory per workingcopy so there
>> won't be any performance difference on our operations.
>
> Attached is a patch that would address the issue. I implemented it in
> make_dir when the 'hidden' attribute is set: I just set the 'no index'
> attribute as well.
This patch bears a striking resemblance to similar code in mod_wsgi:
http://code.google.com/p/modwsgi/source/browse/trunk/mod_wsgi/wsgi_apache.c?spec=svn1755&r=1755#72
Is there at least some attribution that needs to happen if we add it to our
codebase?
--
C. Michael Pilato <cm...@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
Re: mark .svn folders to not get indexed
Posted by Stefan Küng <to...@gmail.com>.
On 06.02.2011 11:43, Bert Huijben wrote:
> Note that this patch is not really what you want: It doesn't handle UTF-8,
> nor long path names (which apr's version would do for us). We need to
> support both when we don't want to introduce a regression.
>
> In 1.7 we usually only have one .svn directory per workingcopy so there
> won't be any performance difference on our operations.
Attached is a patch that would address the issue. I implemented it in
make_dir when the 'hidden' attribute is set: I just set the 'no index'
attribute as well.
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net
Re: mark .svn folders to not get indexed
Posted by Stefan Küng <to...@gmail.com>.
On 06.02.2011 11:43, Bert Huijben wrote:
> Note that this patch is not really what you want: It doesn't handle UTF-8,
> nor long path names (which apr's version would do for us). We need to
> support both when we don't want to introduce a regression.
Yes, of course.
How about adding this to dir_make() and just also set this attribute if
the 'hidden' attribute is set? I guess it is safe to assume that hidden
folders shouldn't be indexed either.
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net
RE: mark .svn folders to not get indexed
Posted by Bert Huijben <be...@qqmail.nl>.
> -----Original Message-----
> From: Stefan Küng [mailto:tortoisesvn@gmail.com]
> Sent: zondag 6 februari 2011 10:43
> To: Subversion Development
> Subject: mark .svn folders to not get indexed
>
> Hi,
>
> For some time now I've been looking for a way to configure the windows
> indexing service to not index the .svn folders. I wanted to do that in
> my installer for TSVN, but after countless hours of searching the web
> and reading up even on the internals of the service I found that there
> just isn't a way to do that.
>
> Then I found a way to do this: just set the attribute
> FILE_ATTRIBUTE_NOT_CONTENT_INDEXED on the .svn folder - the files and
> folders created in it will automatically inherit that attribute when
> they get created.
> But this would have to be done in the svn library when those folders and
> files are created.
>
> Unfortunately, apr doesn't provide a way to set this flag when creating
> the folders or even later, so this would mean OS specific code in the
> svn library.
>
> The advantages for Windows users would be:
> * a search won't show matches in the pristine files, those search
> results are useless for users anyway and are only "spam" in the results
> * the indexing service won't crawl unnecessary data, reducing disk
> access a lot
> * since the indexing service won't crawl the .svn folder anymore,
> access-denied errors during svn commands would also get reduced,
> especially errors like these:
> http://subversion.wandisco.com/blogs/windows-7-bogus-errorfilecorrupt-
> error-.html
>
>
> I still remember the heated discussions about setting the hidden
> attribute on Windows for the .svn folders, so I'd like to discuss this
> first before I commit the change to init_adm()
>
> #ifdef WIN32
> /* tell Windows to not index the admin dir and its content */
> const char * admdirpath = svn_wc__adm_child(local_abspath, NULL, pool);
> SetFileAttributes(admindirpath, GetFileAttributes(admindirpath)
> |FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
> #endif
Note that this patch is not really what you want: It doesn't handle UTF-8,
nor long path names (which apr's version would do for us). We need to
support both when we don't want to introduce a regression.
In 1.7 we usually only have one .svn directory per workingcopy so there
won't be any performance difference on our operations.
So +1 on the idea.
Bert
Re: mark .svn folders to not get indexed
Posted by Branko Čibej <br...@e-reka.si>.
+1, this is a great idea.
On 06.02.2011 10:42, Stefan Küng wrote:
> Hi,
>
> For some time now I've been looking for a way to configure the windows
> indexing service to not index the .svn folders. I wanted to do that in
> my installer for TSVN, but after countless hours of searching the web
> and reading up even on the internals of the service I found that there
> just isn't a way to do that.
>
> Then I found a way to do this: just set the attribute
> FILE_ATTRIBUTE_NOT_CONTENT_INDEXED on the .svn folder - the files and
> folders created in it will automatically inherit that attribute when
> they get created.
> But this would have to be done in the svn library when those folders
> and files are created.
>
> Unfortunately, apr doesn't provide a way to set this flag when
> creating the folders or even later, so this would mean OS specific
> code in the svn library.
>
> The advantages for Windows users would be:
> * a search won't show matches in the pristine files, those search
> results are useless for users anyway and are only "spam" in the results
> * the indexing service won't crawl unnecessary data, reducing disk
> access a lot
> * since the indexing service won't crawl the .svn folder anymore,
> access-denied errors during svn commands would also get reduced,
> especially errors like these:
> http://subversion.wandisco.com/blogs/windows-7-bogus-errorfilecorrupt-error-.html
>
>
>
> I still remember the heated discussions about setting the hidden
> attribute on Windows for the .svn folders, so I'd like to discuss this
> first before I commit the change to init_adm()
>
> #ifdef WIN32
> /* tell Windows to not index the admin dir and its content */
> const char * admdirpath = svn_wc__adm_child(local_abspath, NULL, pool);
> SetFileAttributes(admindirpath, GetFileAttributes(admindirpath)
> |FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
> #endif
>
>
>
> Stefan
>
>