Re: Ignore every file except XX*

2020-06-12 Thread Daniel Sahlberg
>
> Care to move this over to dev@ with a patch?
>

Will do, it might take a few days.

Thanks to the other users for their suggestions but I don't think they'll
be general enough for my use case.

/ Daniel


Re: Ignore every file except XX*

2020-06-12 Thread Matt Simmons
It would see the contents of the commit, though, and if the commit included
files not starting with XX, it could abort the commit, unless I'm
misunderstanding something here?

On Fri, Jun 12, 2020 at 5:00 AM Branko Čibej  wrote:

> On 12.06.2020 08:24, Matt Simmons wrote:
>
> Have you considered a pre-commit hook to deny anything not matching your
> rule?
>
>
> A pre-commit hook doesn't see the contents of the working copy, it's
> completely unsuitable for this use case.
>
> -- Brane
>
>
> On Thu, Jun 11, 2020 at 11:21 PM Branko Čibej  wrote:
>
>> On 12.06.2020 07:30, Daniel Sahlberg wrote:
>> > Hi,
>> >
>> > Thanks for your quick response!
>> >
>> >
>> > The way I solve a similar case is to set svn:ignore to '*', i.e.,
>> to
>> > ignore everything, then just 'svn add' the files I want under
>> version
>> > control. It's not ideal, as you'd miss the files you're interested
>> in.
>> >
>> >
>> > Already doing this. But sometimes we forget to 'svn add' a new file
>> > which then doesn't show up as modified. User error, surely, but if the
>> > mistake can be avoided :-)
>> >
>> >
>> > About feature design -- unfortunately we can't just invent a
>> > syntax that
>> > would invert the meaning of the glob patterns in svn:ignore, as
>> that
>> > would break backward compatibility. Any ideas for a solution would
>> be
>> > most welcome.
>> >
>> >
>> > Exactly my thoughts. The only solution I see is to add a new property
>> > svn:unignore which is applied after (or in conjunction with) the
>> > svn:ignore property. A file is ignored if it matches the svn:ignore
>> > glob pattern AND NOT matches the svn:unignore glob pattern. If
>> > svn:unignore is empty (or non-existent), the behaviour should be
>> > exactly the same as today.
>> >
>> > The code should be reasonably simple (but I have not analyzed if it
>> > would affect anything in the public interface) - only question if
>> > maintainers think a new property is a good idea.
>>
>> I can't think of a way to solve this without introducing a new property
>> (actually, two new properties, the other has to be the opposite of
>> svn:global-ignores). The code would, indeed, be quite simple; the
>> complex part has already been done, and adding the additional "and not
>> matches X" logic should be trivial.
>>
>> Care to move this over to dev@ with a patch?
>>
>> -- Brane
>>
> --
> "Today, vegetables... Tomorrow, the world!"
>
>
>

-- 
"Today, vegetables... Tomorrow, the world!"


Re: Ignore every file except XX*

2020-06-12 Thread Daniel Shahaf
Branko Čibej wrote on Thu, 11 Jun 2020 09:42 +00:00:
> On 11.06.2020 10:46, Daniel Sahlberg wrote:
> > Hi,
> >
> > Not sure if this belongs in users or in dev so I follow the guidelines
> > and post here first.
> >
> > I would like to svn:ignore every file (in a certain path) except files
> > starting with XX or YY.
> >
> > This question seems to have been asked in 2006 ("inverse of svn:ignore
> > property"). I've tried to trace the code and it seems nothing came out
> > of this.
> >
> > Considering there has been 14 years of development, is there another
> > way to solve this nowadays?
> 
> There's no explicit "inverse of svn:ignore" property, or any magic
> syntax that would invert the match.

Not in general, but in this specific case, there _is_ a syntax that
would invert the match:

[[[
% touch XXfoo YYfoo XZbar YZbar ZZbar 
% cat /tmp/propval 
[^XY]*
X[^X]*
Y[^Y]*
% svn ps svn:ignore -F /tmp/propval ./ 
property 'svn:ignore' set on '.'
% svn st --no-ignore
 M  .
?   XXfoo
I   XZbar
?   YYfoo
I   YZbar
I   ZZbar
% 
]]]

Cheers,

Daniel


> The way I solve a similar case is to set svn:ignore to '*', i.e., to
> ignore everything, then just 'svn add' the files I want under version
> control. It's not ideal, as you'd miss the files you're interested in.
> 
> About feature design -- unfortunately we can't just invent a syntax that
> would invert the meaning of the glob patterns in svn:ignore, as that
> would break backward compatibility. Any ideas for a solution would be
> most welcome.
> 
> -- Brane
>


Re: Ignore every file except XX*

2020-06-12 Thread Branko Čibej
On 12.06.2020 08:24, Matt Simmons wrote:
> Have you considered a pre-commit hook to deny anything not matching
> your rule?

A pre-commit hook doesn't see the contents of the working copy, it's
completely unsuitable for this use case.

-- Brane


> On Thu, Jun 11, 2020 at 11:21 PM Branko Čibej  > wrote:
>
> On 12.06.2020 07:30, Daniel Sahlberg wrote:
> > Hi,
> >
> > Thanks for your quick response!
> >  
> >
> >     The way I solve a similar case is to set svn:ignore to '*',
> i.e., to
> >     ignore everything, then just 'svn add' the files I want
> under version
> >     control. It's not ideal, as you'd miss the files you're
> interested in.
> >
> >
> > Already doing this. But sometimes we forget to 'svn add' a new file
> > which then doesn't show up as modified. User error, surely, but
> if the
> > mistake can be avoided :-)
> >  
> >
> >     About feature design -- unfortunately we can't just invent a
> >     syntax that
> >     would invert the meaning of the glob patterns in svn:ignore,
> as that
> >     would break backward compatibility. Any ideas for a solution
> would be
> >     most welcome.
> >
> >
> > Exactly my thoughts. The only solution I see is to add a new
> property
> > svn:unignore which is applied after (or in conjunction with) the
> > svn:ignore property. A file is ignored if it matches the svn:ignore
> > glob pattern AND NOT matches the svn:unignore glob pattern. If
> > svn:unignore is empty (or non-existent), the behaviour should be
> > exactly the same as today.
> >
> > The code should be reasonably simple (but I have not analyzed if it
> > would affect anything in the public interface) - only question if
> > maintainers think a new property is a good idea.
>
> I can't think of a way to solve this without introducing a new
> property
> (actually, two new properties, the other has to be the opposite of
> svn:global-ignores). The code would, indeed, be quite simple; the
> complex part has already been done, and adding the additional "and not
> matches X" logic should be trivial.
>
> Care to move this over to dev@ with a patch?
>
> -- Brane
>
> -- 
> "Today, vegetables... Tomorrow, the world!" 



Re: Ignore every file except XX*

2020-06-12 Thread Matt Simmons
Have you considered a pre-commit hook to deny anything not matching your
rule?

On Thu, Jun 11, 2020 at 11:21 PM Branko Čibej  wrote:

> On 12.06.2020 07:30, Daniel Sahlberg wrote:
> > Hi,
> >
> > Thanks for your quick response!
> >
> >
> > The way I solve a similar case is to set svn:ignore to '*', i.e., to
> > ignore everything, then just 'svn add' the files I want under version
> > control. It's not ideal, as you'd miss the files you're interested
> in.
> >
> >
> > Already doing this. But sometimes we forget to 'svn add' a new file
> > which then doesn't show up as modified. User error, surely, but if the
> > mistake can be avoided :-)
> >
> >
> > About feature design -- unfortunately we can't just invent a
> > syntax that
> > would invert the meaning of the glob patterns in svn:ignore, as that
> > would break backward compatibility. Any ideas for a solution would be
> > most welcome.
> >
> >
> > Exactly my thoughts. The only solution I see is to add a new property
> > svn:unignore which is applied after (or in conjunction with) the
> > svn:ignore property. A file is ignored if it matches the svn:ignore
> > glob pattern AND NOT matches the svn:unignore glob pattern. If
> > svn:unignore is empty (or non-existent), the behaviour should be
> > exactly the same as today.
> >
> > The code should be reasonably simple (but I have not analyzed if it
> > would affect anything in the public interface) - only question if
> > maintainers think a new property is a good idea.
>
> I can't think of a way to solve this without introducing a new property
> (actually, two new properties, the other has to be the opposite of
> svn:global-ignores). The code would, indeed, be quite simple; the
> complex part has already been done, and adding the additional "and not
> matches X" logic should be trivial.
>
> Care to move this over to dev@ with a patch?
>
> -- Brane
>
-- 
"Today, vegetables... Tomorrow, the world!"


Re: Ignore every file except XX*

2020-06-12 Thread Branko Čibej
On 12.06.2020 07:30, Daniel Sahlberg wrote:
> Hi,
>
> Thanks for your quick response!
>  
>
> The way I solve a similar case is to set svn:ignore to '*', i.e., to
> ignore everything, then just 'svn add' the files I want under version
> control. It's not ideal, as you'd miss the files you're interested in.
>
>
> Already doing this. But sometimes we forget to 'svn add' a new file
> which then doesn't show up as modified. User error, surely, but if the
> mistake can be avoided :-)
>  
>
> About feature design -- unfortunately we can't just invent a
> syntax that
> would invert the meaning of the glob patterns in svn:ignore, as that
> would break backward compatibility. Any ideas for a solution would be
> most welcome.
>
>
> Exactly my thoughts. The only solution I see is to add a new property
> svn:unignore which is applied after (or in conjunction with) the
> svn:ignore property. A file is ignored if it matches the svn:ignore
> glob pattern AND NOT matches the svn:unignore glob pattern. If
> svn:unignore is empty (or non-existent), the behaviour should be
> exactly the same as today.
>
> The code should be reasonably simple (but I have not analyzed if it
> would affect anything in the public interface) - only question if
> maintainers think a new property is a good idea.

I can't think of a way to solve this without introducing a new property
(actually, two new properties, the other has to be the opposite of
svn:global-ignores). The code would, indeed, be quite simple; the
complex part has already been done, and adding the additional "and not
matches X" logic should be trivial.

Care to move this over to dev@ with a patch?

-- Brane