svn - Subversion pre-commit hook filtering unwanted files (most generated by quartus & nios) -
i wonder if there's way pre-commit hook used in svnserve can "filter" files based on list of extensions. have prepared list similar global ignore list in "%appdata%/subversion/config" own added patterns such *.cdf *.sof *.elf quartus , nios projects. our primary objective save space filtering out unnecessary files during commit, i.e. not displayed "svn status"
i have done lot of searches on google couldn't find satisfying solution. 1 of approaches have write windows batch file automatically enable , replace global ignore list on subversion client side own list. problem obvious: works on single client. if want enforce filtering globally, every single client using repository must execute batch file. not mention not uses windows platform.
the next approach have found modify svn:ignore property recursively each pattern can ignored globally. again, method requires client-side operations , it's non-trivial maintain - applies current directories in repository. in other words, if import new directory, ignore list won't apply it.
i did write pre-commit hook in python merely checks length of log messages , size of files being committed. understanding, pre-commit hooks not supposed make modifications transaction because otherwise working cache on client side inconsistent , unusable, comprehensible. hook 2 things:
reject commit if check fails (exit 1) code
accept commit transaction becomes revision of repository
what thought reject commit if file within transaction needs filtered. colleagues said tedious manage many files on own, besides have no clue file extensions not required rebuild project.
i still sense there must way automate process of filtering without involving client-side operations. what's on mind right 2 possible pre-commit hooks:
reject commit, modify new added project property ignore specific patterns (as in svn:ignore)
accept commit, ignore unwanted file transaction, informing user files have been ignored, manage working cache on client-side consistent repository.
i prefer option 2 though looks lot harder option 1
in addition, please suggest files should put under version quartus ii , nios projects, i.e. whole project can rebuilt after checking out these files. list have is: .vhd .v .qpf .qsf .bsf
Comments
Post a Comment