Ignore multiple specific files using svn

Our build system generates several files that are scattered throughout the source tree.

These files are displayed when svn status starts.

In the example below, all files with the symbol '?' in the thirdparty directory were created by the build system.

eg.

 svn status M common/db/unit_test/src/db_payload_builder_test_suite.cpp ? common/db/unit_test/Makefile M common/lib/osal/variant/linux/public_inc/osal_specific_msgq.hpp M common/lib/enb/public_inc/enb_service.h ? thirdparty/lib/curl/public_inc_arm ? thirdparty/lib/curl/public_inc_x86 ? thirdparty/lib/curl/originals/config.log ? thirdparty/lib/curl/originals/libcurl.pc ? thirdparty/lib/curl/originals/config.status ? thirdparty/lib/curl/originals/libtool ? thirdparty/lib/curl/originals/curl-config ? thirdparty/lib/curl/originals/src/curl 

I would like to tell svn ignore these files. I cannot just specify directories that should be ignored, since many of these directories contain sources that are checked in the repository.

The above example is a subset of the generated files, we cannot use the ignore pattern because some of the generated files correspond to files that we do not want to ignore (for example, xxx_.h ")

I tried using svn propset svn:ignore 'somefile' dir , but I can only tell svn to ignore one specific file in the directory.

How can I specify several specific files for svn to ignore?

+4
source share
3 answers

You can give it a list of files to ignore, one per line

 vnix$ svn propset svn:ignore 'config.log > libcurl.pc > config.status > libtool > curl-config' thirdparty/lib/curl/originals 

... where vnix$ is the primary prompt of your shell, and > is the secondary prompt.

Do not be afraid how to write multi-line lines in the shell.

Alternatively, submit the file to stdin:

 vnix$ svn propset svn:ignore -F - thirdparty/lib/curl/originals <<HERE > config.log > libcurl.pc > config.status > libtool > curl-config > HERE 

See also Red Book , although this example is not very explicit for your specific scenario.

+8
source

One line solution:

 svn propset svn:ignore "file1"$'\n'"file2"$'\n'"file3" . 
+9
source

If you start reading documents, you will find that

  • svn: ignore can be applied to a folder that contains files that should be ignored, not just the parents of this folder
  • svn: ignore file template definition, which by default will be ignored in the future svn add and svn status , but only for untranslated files . Files already under version control do not affect svn: ignore

Your fork should be:

  • Add all necessary files to SVN
  • For folders that are objects of your builder, add. ignore-pattern
  • Test patterns and completeness of blocking using a test run of the assembly and checking the output of svn st in the root of the WC
+3
source

All Articles