问题
I am using Git for version control of local files, which finally have to be checked in into another version control system. Now I am experiencing some problems with most of the C code files:
- They all have an automatic version history in their header comment
- Most of the files are cluttered by EasyCode or EasyCase comments
I now simply created two git filters "History" and "EasyTool" to clean up the code before being checked in to Git. How is it possible to filter all C and H files with both of the filters?
Specifying the commands multiple times does not work and concatenation of the filter command does neither (or I at least did not find the correct syntax).
This was my first try:
*.c filter=History
*.c filter=EasyTool # This one wins, "History" is not executed
Then I tried something like this:
*.c filter=History EasyTool # The first wins, other separators work neither
回答1:
I don't think you can chain filters that way.
The simplest way would be to write a wrapper which would call both sequentially (at least through a pipe in a shell script).
(as in "Is it possible to redirect output of one program to input of other program in different operational systems?").
来源:https://stackoverflow.com/questions/13988619/apply-multiple-filters-for-same-files-in-git