Svn: ignore generated subfolders

I always have problems with svn: ignore, but this time I think that maybe I'm trying to do something impossible.

Assuming dir structure:

/
   /foo
   /bar
   /web
      /uploads
          /assets
          /avatars
              /fu
                  /*.jpg
              /ba
                  /*.jpg
              keepme.jpg
              keepmetoo.jpg

I want to ignore all subdirectories of the avatar directory, but not the files of this directory (keepme.jpg, keepmetoo.jpg).

The subfolders of the avatar (fu, ba) are automatically generated, and the names cannot be predefined, so you must completely ignore all subfolders / avatars.

Is it possible? And How?

, post-commit hooks. . -, , . . , , ( ), .

+3
3

svn, /avataurs/fu avatars/ba ( /xxx )?

svn. Tortoise, , , , . - , .

, , , - "" - . - perl script, isgex , 1, - ".*/avatars/.*/.*" ( ). , , . (,.obj ..).

SVN, - - !


pre-commit.cmd hook. hooks ( ), .

@echo off

svnlook changed -t %2 %1 > c:\temp\pre-commit.txt

findstr /G:"%1\hooks\ignore-matches.txt"  c:\temp\pre-commit.txt > c:\temp\precommit-bad.txt
if %ERRORLEVEL% NEQ 0 exit 0

echo disallowed file extension >> c:\temp\precommit-bad.txt

type c:\temp\precommit-bad.txt 1>&2
exit 1

ignore-matches.txt , :

^[^D].*\.obj$

, ignore-matches.txt, , , , .

+2

, SVN, config, . ,

  • ,
  • , SVN ,
  • , SVN .

  • pre-commit, ,
  • ,
  • CI.

-, svn: ignore . - . :

@echo off
echo.>~svnignore
dir /b /aD >~svnignore
svn propset svn:ignore --file ~svnignore .
del ~svnignore

, ~svnignore , , . , .

-, -. - , , , .

, , : tortoisesvn, , . . TortoiseSVN. Hook Scripts, (, ...), , , .

, SVN, / .., .

+1
-2

Source: https://habr.com/ru/post/1765225/


All Articles