Discussion:
svnignore?
Bo Berglund
2017-12-29 15:57:16 UTC
Permalink
What is the equivalent of the CVS .cvsignore file?

I have a lot of files that I don't want to get into the repository
because they are only temporary files created by the compiler every
time I do almost anything in the IDE. These are ignored when we use
CVS by the use of a global cvsignore setting plus .cvsignore files in
projects that need some more files ignored.
My main cvsignore file has something like 40-50 entries..

I tried to study the svnbook on this matter but the closest I get is
to use:
svn propedit svn:ignore
But this seems to be an exercise to be done on directory levels and my
IDE creates a lot of directories that are not versioned to begin
with...
Is there no way to make a global setting on the client side such that
the known files types will be ignored from svn?

If it matters I use the SmartSvn program as a user interface on my
development PC. It was recommended for users wanting a GUI interface
like we had for CVS.
--
Bo Berglund
Developer in Sweden
David Chapman
2017-12-29 17:24:10 UTC
Permalink
Post by Bo Berglund
What is the equivalent of the CVS .cvsignore file?
I have a lot of files that I don't want to get into the repository
because they are only temporary files created by the compiler every
time I do almost anything in the IDE. These are ignored when we use
CVS by the use of a global cvsignore setting plus .cvsignore files in
projects that need some more files ignored.
My main cvsignore file has something like 40-50 entries..
I tried to study the svnbook on this matter but the closest I get is
svn propedit svn:ignore
But this seems to be an exercise to be done on directory levels and my
IDE creates a lot of directories that are not versioned to begin
with...
Is there no way to make a global setting on the client side such that
the known files types will be ignored from svn?
If it matters I use the SmartSvn program as a user interface on my
development PC. It was recommended for users wanting a GUI interface
like we had for CVS.
Tell Subversion to ignore temporary files in a working copy by editing
the "global-ignores" line in the file "config".  On Windows systems this
is in "AppData\Roaming\Subversion" within the user's home directory; on
Linux systems this is in ".subversion" within the user's home
directory.  These are global per user, not per working copy.

For example, my "global-ignores" line for Windows is:

global-ignores = *.obj *.lib *.ciz *.map *.exe  *.bak *.pdb *.ilk *.idb

Note that these directories are not present for a given user until that
person has run some Subversion command on the machine.  "svn --version"
should be enough.
--
David Chapman ***@acm.org
Chapman Consulting -- San Jose, CA
EDA Software Developer, Expert Witness
www.chapman-consulting-sj.com
Ryan Schmidt
2017-12-29 17:27:34 UTC
Permalink
Post by Bo Berglund
What is the equivalent of the CVS .cvsignore file?
I have a lot of files that I don't want to get into the repository
because they are only temporary files created by the compiler every
time I do almost anything in the IDE. These are ignored when we use
CVS by the use of a global cvsignore setting plus .cvsignore files in
projects that need some more files ignored.
My main cvsignore file has something like 40-50 entries..
I tried to study the svnbook on this matter but the closest I get is
svn propedit svn:ignore
But this seems to be an exercise to be done on directory levels and my
IDE creates a lot of directories that are not versioned to begin
with...
Is there no way to make a global setting on the client side such that
the known files types will be ignored from svn?
If it matters I use the SmartSvn program as a user interface on my
development PC. It was recommended for users wanting a GUI interface
like we had for CVS.
Tell Subversion to ignore temporary files in a working copy by editing the "global-ignores" line in the file "config". On Windows systems this is in "AppData\Roaming\Subversion" within the user's home directory; on Linux systems this is in ".subversion" within the user's home directory. These are global per user, not per working copy.
global-ignores = *.obj *.lib *.ciz *.map *.exe *.bak *.pdb *.ilk *.idb
Note that these directories are not present for a given user until that person has run some Subversion command on the machine. "svn --version" should be enough.
As of Subversion 1.8, you can configure svn:global-ignores in the repository as well.

http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.ignore.html

"Subversion 1.8 provides a more powerful version of the svn:ignore property, the svn:global-ignores property. Like the svn:ignore property,svn:global-ignores can only be set on a directory and contains file patterns Subversion uses to determine ignorable objects.[21] These ignore patterns are also appended to any patterns defined in the global-ignores runtime configuration option together with any svn:ignore defined patterns. Unlike svn:ignore however, the svn:global-ignores property is inheritable [22] and applies to all paths under the directory on which the property is set, not just the immediate children of the directory."
Bo Berglund
2017-12-29 18:05:06 UTC
Permalink
Post by David Chapman
Post by Bo Berglund
Is there no way to make a global setting on the client side such that
the known files types will be ignored from svn?
Tell Subversion to ignore temporary files in a working copy by editing
the "global-ignores" line in the file "config".  On Windows systems this
is in "AppData\Roaming\Subversion" within the user's home directory; on
Linux systems this is in ".subversion" within the user's home
directory.  These are global per user, not per working copy.
global-ignores = *.obj *.lib *.ciz *.map *.exe  *.bak *.pdb *.ilk *.idb
OK, I found it in the location you specified!
But if I add the content of my cvsignore file to the config file as a
whitespace separated list on one line that line becomes VERY log (over
600 chars).
Can I put the info in separate lines?

And by the way the config file is organized in sections so one has to
enter the data in the [miscellany] section.
--
Bo Berglund
Developer in Sweden
Bo Berglund
2017-12-29 18:55:08 UTC
Permalink
On Fri, 29 Dec 2017 19:05:06 +0100, Bo Berglund
Post by Bo Berglund
But if I add the content of my cvsignore file to the config file as a
whitespace separated list on one line that line becomes VERY log (over
600 chars).
Can I put the info in separate lines?
It turns out that enabling this option by removing the # character
makes SmartSvn barf when I want to check out a project!
So it is necessary also to remove all whitespace *before* the
global-ignores text. After this whitespace is permissible.

This is how my file looks now for ignores (the ignore globs are all on
one line, the newsreader has added the line breaks):

[miscellany]
### Set global-ignores to a set of whitespace-delimited globs
### which Subversion will ignore in its 'status' output, and
### while importing or adding files and directories.
### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'.
global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc
*.pyo *.a *.aps *.bak *.BAK *.bpt *.bro *.bsc *.cdb *.cfg
*.cgl *.class *.compiled *.clw *.db *.dbg *.dcu *.DCU *.ddp
*.dsk *.dti *.err *.exp *.gid *.gz *.identcache *.ilk *.jar
*.lnk *.local *.log *.lps *.lrt *.mod *.MOD *.ncb *.NCB *.ocx
*.OPT *.opt *.pch *.pjt *.plg *.PLG *.pdb *.PDB *.ppu *.o
*.obj *.OBJ *.or *.rsj *.rst *.sbr *.scc *.SID *.sln *.tar
*.tds *.tlh *.tli *.trg *.vbw *.zip __history bak *.~* .#*

I guess it is not valid to split the list on several lines in they
config file?
--
Bo Berglund
Developer in Sweden
David Chapman
2017-12-29 19:44:01 UTC
Permalink
Post by Bo Berglund
On Fri, 29 Dec 2017 19:05:06 +0100, Bo Berglund
Post by Bo Berglund
But if I add the content of my cvsignore file to the config file as a
whitespace separated list on one line that line becomes VERY log (over
600 chars).
Can I put the info in separate lines?
It turns out that enabling this option by removing the # character
makes SmartSvn barf when I want to check out a project!
So it is necessary also to remove all whitespace *before* the
global-ignores text. After this whitespace is permissible.
This is how my file looks now for ignores (the ignore globs are all on
[miscellany]
### Set global-ignores to a set of whitespace-delimited globs
### which Subversion will ignore in its 'status' output, and
### while importing or adding files and directories.
### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'.
global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc
*.pyo *.a *.aps *.bak *.BAK *.bpt *.bro *.bsc *.cdb *.cfg
*.cgl *.class *.compiled *.clw *.db *.dbg *.dcu *.DCU *.ddp
*.dsk *.dti *.err *.exp *.gid *.gz *.identcache *.ilk *.jar
*.lnk *.local *.log *.lps *.lrt *.mod *.MOD *.ncb *.NCB *.ocx
*.OPT *.opt *.pch *.pjt *.plg *.PLG *.pdb *.PDB *.ppu *.o
*.obj *.OBJ *.or *.rsj *.rst *.sbr *.scc *.SID *.sln *.tar
*.tds *.tlh *.tli *.trg *.vbw *.zip __history bak *.~* .#*
I guess it is not valid to split the list on several lines in they
config file?
I tried to use a backslash character as a line continuation for
"global-ignores" and it did not work.  Apparently you are stuck with a
very long line here.  I don't know if anyone else has complained about
it or if an enhancement request would be seen favorably by the
Subversion developers.

You could shorten the line a bit by reducing the number of spaces
between words, and on Windows the names should be case-insensitive so
that you can remove entries that differ only in case.
--
David Chapman ***@acm.org
Chapman Consulting -- San Jose, CA
EDA Software Developer, Expert Witness
www.chapman-consulting-sj.com
Ryan Schmidt
2017-12-29 20:05:26 UTC
Permalink
Post by Bo Berglund
I guess it is not valid to split the list on several lines in they
config file?
I've never heard of that being possible.
Daniel Shahaf
2017-12-29 23:27:12 UTC
Permalink
Post by Ryan Schmidt
Post by Bo Berglund
I guess it is not valid to split the list on several lines in they
config file?
I've never heard of that being possible.
It doesn't seem to be (to my surprise), but the following does work:

[miscellany]
gi1 = foo1 foo2
gi2 = bar1 bar2
global-ignores = %(gi1)s %(gi2)s

That's equivalent to

[miscellany]
global-ignores = foo1 foo2 bar1 bar2

.
Branko Čibej
2017-12-30 04:56:17 UTC
Permalink
Post by Bo Berglund
Post by Ryan Schmidt
Post by Bo Berglund
I guess it is not valid to split the list on several lines in they
config file?
I've never heard of that being possible.
[miscellany]
gi1 = foo1 foo2
gi2 = bar1 bar2
global-ignores = %(gi1)s %(gi2)s
That's equivalent to
[miscellany]
global-ignores = foo1 foo2 bar1 bar2
.
Yes and this also works:

[miscellany]
global-ignores =
    foo1 foo2
    bar1 bar2


Note the space at the beginning of the continuation lines. The syntax of
Subversion config files is compatible with
https://docs.python.org/2/library/configparser.html


-- Brane
David Chapman
2017-12-30 05:23:18 UTC
Permalink
Post by Bo Berglund
Post by Bo Berglund
Post by Ryan Schmidt
Post by Bo Berglund
I guess it is not valid to split the list on several lines in they
config file?
I've never heard of that being possible.
[miscellany]
gi1 = foo1 foo2
gi2 = bar1 bar2
global-ignores = %(gi1)s %(gi2)s
That's equivalent to
[miscellany]
global-ignores = foo1 foo2 bar1 bar2
.
[miscellany]
global-ignores =
    foo1 foo2
    bar1 bar2
Note the space at the beginning of the continuation lines. The syntax of
Subversion config files is compatible with
https://docs.python.org/2/library/configparser.html
Is this documented in The Book?  I was looking at
http://svnbook.red-bean.com/nightly/en/svn.advanced.confarea.html today
and it made no mention of this.
--
David Chapman ***@acm.org
Chapman Consulting -- San Jose, CA
EDA Software Developer, Expert Witness
www.chapman-consulting-sj.com
Branko Čibej
2017-12-30 05:40:05 UTC
Permalink
Post by David Chapman
Post by Bo Berglund
Post by Bo Berglund
Post by Ryan Schmidt
Post by Bo Berglund
I guess it is not valid to split the list on several lines in they
config file?
I've never heard of that being possible.
[miscellany]
gi1 = foo1 foo2
gi2 = bar1 bar2
global-ignores = %(gi1)s %(gi2)s
That's equivalent to
[miscellany]
global-ignores = foo1 foo2 bar1 bar2
.
[miscellany]
global-ignores =
     foo1 foo2
     bar1 bar2
Note the space at the beginning of the continuation lines. The syntax of
Subversion config files is compatible with
https://docs.python.org/2/library/configparser.html
Is this documented in The Book?  I was looking at
http://svnbook.red-bean.com/nightly/en/svn.advanced.confarea.html
today and it made no mention of this.
I don't know if it's documented. Omissions should be reported to the
book authors, see the "Feedback/Contributing" section here:
http://svnbook.red-bean.com/

-- Brane
Bo Berglund
2017-12-30 07:51:54 UTC
Permalink
Post by Bo Berglund
[miscellany]
global-ignores =
    foo1 foo2
    bar1 bar2
This is what I tried and failed because I did not realize that it is
not enough to just remove the comment char from the template config
file to activate a value line, one must remove everything before the
identifier. It must start at column 1...
Post by Bo Berglund
Note the space at the beginning of the continuation lines. The syntax of
Subversion config files is compatible with
https://docs.python.org/2/library/configparser.html
So here the leading whitespace on continuation lines is 4 characters
wide. It seems like the requirement is one or more leading spaces for
a line to be recognized as a continuation.
The example uses 4 space characters but afaict this example is legal
(4, 2, 3 whitespace chars and a comment line):

global-ignores = pop1 pop2
    foo1 foo2
  bar1 bar2
# Added these values too:
chuck1 chuck2
--
Bo Berglund
Developer in Sweden
Daniel Shahaf
2017-12-30 08:31:05 UTC
Permalink
Post by Bo Berglund
[miscellany]
global-ignores =
    foo1 foo2
    bar1 bar2
Are you sure? I couldn't get continuation lines to take effect
regardless of what I tried. (With/without text after the "=",
with/without backslash, with single tab or single space at the start of
the continuation line...)
Branko Čibej
2017-12-30 09:09:58 UTC
Permalink
Post by Daniel Shahaf
Post by Bo Berglund
[miscellany]
global-ignores =
    foo1 foo2
    bar1 bar2
Are you sure? I couldn't get continuation lines to take effect
regardless of what I tried. (With/without text after the "=",
with/without backslash, with single tab or single space at the start of
the continuation line...)
Don't know what you were trying but see parse_option() and
parse_value_continuation_lines() in subversion/libsvn_subr/config_file.c.

-- Brane
Daniel Shahaf
2017-12-30 10:00:03 UTC
Permalink
Post by Branko Čibej
Don't know what you were trying
[[[
% cat ~/.subversion/config
[miscellany]
global-ignores = bar
foo
% touch foo bar
]]]
Post by Branko Čibej
but see parse_option() and
parse_value_continuation_lines() in subversion/libsvn_subr/config_file.c.
(lldb) p ctx->value->data
(char *) $2 = 0x00007ffff7e1d310 "bar oo"

And if I «touch ./oo» then ./oo gets ignored and ./foo doesn't.

We've got an off-by-one somewhere.

Cheers,

Daniel
Bo Berglund
2017-12-30 10:25:48 UTC
Permalink
On Sat, 30 Dec 2017 08:31:05 +0000, Daniel Shahaf
Post by Daniel Shahaf
Post by Bo Berglund
[miscellany]
global-ignores =
    foo1 foo2
    bar1 bar2
Are you sure? I couldn't get continuation lines to take effect
regardless of what I tried. (With/without text after the "=",
with/without backslash, with single tab or single space at the start of
the continuation line...)
I have now edited my file and it now looks as follows (actual line
breaks):

global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a
*.pyc *.pyo *.a *.aps *.bak.clw *.db *.dbg *.dcu
*.ddp *.dsk *.dti *.err *.exp *.gid *.gz
*.identcache *.ilk *.jar *.lnk *.local *.log *.lps
*.lrt *.mod *.ncb *.ocx *.opt *.pch
*.pjt *.plg *.pdb *.ppu *.obj
*.or *.rsj *.rst *.sbr *.scc *.sln *.tar *.tds
*.tlh *.tli *.trg *.vbw *.zip __history bak *.~* .#*

When I create a new file in a non-versioned directory with extension
.jar (3rd continuation line above) then SmartSVN does not show it
unless I change the display filter to show also ignored files.
So I am pretty sure the local version does work with line
continuation.
--
Bo Berglund
Developer in Sweden
Daniel Shahaf
2017-12-30 10:33:18 UTC
Permalink
Post by Bo Berglund
So I am pretty sure the local version does work with line
continuation.
The bug exists only in 1.10 pre-releases; it doesn't exist in 1.9.x.
You've found a regression. :-)

Loading...