TortoiseSVN Add and global-ignores

335 views
Skip to first unread message

Julien Cugnière

unread,
Apr 3, 2014, 5:46:05 AM4/3/14
to us...@tortoisesvn.tigris.org
Hello,

I noticed that the command line "svn add" on a folder respects the svn:global-ignore property, while the Add command from TortoiseSVN does not. Is this by design ? This unfortunately limits the usefulness of the global-ignores property.

Julien Cugnière

Andy Levy

unread,
Apr 3, 2014, 6:25:45 AM4/3/14
to us...@tortoisesvn.tigris.org

Subversion does exactly what you tell it to. What you've observed is not TortoiseSVN but core Subversion. If you explicitly add an item that is ignored, Subversion assumes you know what you're doing and lets you do it.

To do otherwise would become a major usability problem as you'd have to manually change global-ignores anytime you need to override it.

Julien Cugnière

unread,
Apr 3, 2014, 7:47:42 AM4/3/14
to us...@tortoisesvn.tigris.org
Sorry, I should have been more specific : I'm not explicitly adding an item that is ignored. Rather, I'm adding a folder that contains ignored items. And Tortoise is behaving differently from core Subversion.

Consider the following working copy, with the property svn:global-ignores set to "*.log" on "/trunk" :

    /trunk/
    /trunk/folder1/

Then create the following files and directory :

    /trunk/folder1/app/
    /trunk/folder1/app/run.log
    /trunk/folder1/app/main.cpp

With the core Subversion command-line, if you run "svn add app" from the "folder1" directory, svn will respect the inherited svn:global-ignores property, and add "app/" and "main.cpp", but *not* "run.log".

With TortoiseSVN, if you execute the "Add" command on the "app" directory, TSVN will *not* respect the svn:global-ignores, and will add everything, including "run.log". I feel that in the "Add" dialog, the ignored files and folders should at least be unchecked by default. Maybe they should even not appear at all.


Julien Cugnière

Stefan Küng

unread,
Apr 3, 2014, 2:07:30 PM4/3/14
to us...@tortoisesvn.tigris.org
On 03.04.2014 13:47, Julien Cugnière wrote:
> Sorry, I should have been more specific : I'm not explicitly adding an
> item that is ignored. Rather, I'm adding a folder that contains ignored
> items. And Tortoise is behaving differently from core Subversion.
>
> Consider the following working copy, with the property
> svn:global-ignores set to "*.log" on "/trunk" :
>
> /trunk/
> /trunk/folder1/
>
> Then create the following files and directory :
>
> /trunk/folder1/app/
> /trunk/folder1/app/run.log
> /trunk/folder1/app/main.cpp
>
> With the core Subversion command-line, if you run "svn add app" from the
> "folder1" directory, svn will respect the inherited svn:global-ignores
> property, and add "app/" and "main.cpp", but *not* "run.log".
>
> With TortoiseSVN, if you execute the "Add" command on the "app"
> directory, TSVN will *not* respect the svn:global-ignores, and will add
> everything, including "run.log". I feel that in the "Add" dialog, the
> ignored files and folders should at least be unchecked by default. Maybe
> they should even not appear at all.

TSVN will show you a dialog where you can review and check/uncheck the
files you want to add and those you don't. It will not add anything
without asking you first.

Stefan


--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest interface to (Sub)version control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3075792

To unsubscribe from this discussion, e-mail: [users-un...@tortoisesvn.tigris.org].

Julien Cugnière

unread,
Apr 3, 2014, 2:44:30 PM4/3/14
to us...@tortoisesvn.tigris.org
2014-04-03 20:07 GMT+02:00 Stefan Küng <torto...@gmail.com>:
>
> On 03.04.2014 13:47, Julien Cugnière wrote:
> > With TortoiseSVN, if you execute the "Add" command on the "app"
> > directory, TSVN will *not* respect the svn:global-ignores, and will add
> > everything, including "run.log". I feel that in the "Add" dialog, the
> > ignored files and folders should at least be unchecked by default. Maybe
> > they should even not appear at all.
>
> TSVN will show you a dialog where you can review and check/uncheck the
> files you want to add and those you don't. It will not add anything
> without asking you first.

Manually hunting for and unchecking every file that should not be
added in a directory with dozens of files and sub-directories is a
pain for knowledgeable users, and less knowledgeable ones simply never
do it. And if I follow your reasoning, there is no need at all for
them in svn either : people can just pass the correct list of path to
the command line client :-)

The global-ignore property and configuration setting are meant to make
life easier by automatically getting the most obvious files out of the
way. As a repository admin, they allow me to make it easier for people
to respect policies such as "don't version log files unless you really
need to" (note that hook scripts can answer the "don't version log
files" part, but not the "unless you really need to" one).

What's weird is that the Check for Modification dialog does respect
this property. I suppose it comes from the subversion library, whereas
in the Add dialog, TSVN has to manually harvest the list of files to
add. Is not following the global-ignore property by design, or is it
an oversight ? In other words, if I get motivated enough to work on
this and submit a patch, does it stand a chance to be accepted ?
(though of course if there is no appropriate API in the subversion
library, this might be much more complicated than it looks).

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3075797

Stefan Küng

unread,
Apr 7, 2014, 2:07:13 PM4/7/14
to us...@tortoisesvn.tigris.org
Opened issue #630 for this:
http://code.google.com/p/tortoisesvn/issues/detail?id=630

Stefan


--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest interface to (Sub)version control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3076020
Reply all
Reply to author
Forward
0 new messages