Is there logic that can check if the push included the creation of a new file in the a files directory in git repo?
是否有逻辑可以检查推送是否包括在git repo的a文件目录中创建新文件?
I am looking to execute a python script only if the push had a new file created in the files directory.
我希望只有当推送在文件目录中创建了一个新文件时,才会执行一个python脚本。
One example uses git diff --name-only --diff-filter=A and grep
一个示例使用git diff --name-only --diff-filter=A和grep
Which does look to answer my question, how could I use a for loop to execute the python script x amount of times using each new file set as a parameter?
这确实回答了我的问题,我如何才能使用for循环将每个新文件集作为参数执行x次呢?
Eg. 3 new files added to the directory githook to then execute the python script 3 times each time passing the new file as a variable?
例.3个添加到githook目录的新文件,然后每次将新文件作为变量传递时执行3次python脚本?
更多回答
优秀答案推荐
我是一名优秀的程序员,十分优秀!