In a project where, for example, a parser is used, some source code is a product of the program. For example, yacc generates - based on the .yy file - a source code file that the parser implements.
Since small changes in the .yy file can lead to large changes in the corresponding source code file after compilation, and since the resulting source code (almost) never changes after it is created. Such source code files are ideal candidates for the .gitignore list.
Now you can, of course, manually write such files to the list:
lexer1.cpp parser1.cpp lexer2.cpp parser2.cpp
But most likely, when you create a new parser, he / she will forget to add the file to the list.
Is there a way to specify a template that acts as follows:
If the file foo.ext1 exists, ignore foo.ext2 .
Where, in this way, ext1 and ext2 provided. In the case of the lexer / parser, this means using this template for .xx / .cpp and .yy / .cpp .
Perhaps this is possible not only with .gitignore , but maybe there are already some interceptors for this?
git wildcard gitignore githooks
Willem van onsem
source share