gpt4 book ai didi

git - 对 git 中的相同文件应用多个过滤器

转载 作者:太空狗 更新时间:2023-10-29 13:41:28 25 4
gpt4 key购买 nike

我正在使用 Git 对本地文件进行版本控制,最终必须将其 checkin 另一个版本控制系统。现在我遇到了大多数 C 代码文件的一些问题:

  1. 他们在标题评论中都有一个自动版本历史记录
  2. 大多数文件都被 EasyCode 或 EasyCase 注释弄得乱七八糟

我现在简单地创建了两个 git 过滤器“History”和“EasyTool”,以便在 checkin Git 之前清理代码。如何使用两个过滤器过滤所有 C 和 H 文件?

多次指定命令不起作用,过滤器命令的串联也不起作用(或者我至少没有找到正确的语法)。

这是我的第一次尝试:

*.c  filter=History
*.c filter=EasyTool # This one wins, "History" is not executed

然后我尝试了这样的事情:

*.c  filter=History EasyTool   # The first wins, other separators work neither

最佳答案

我不认为你可以那样链接过滤器。

最简单的方法是编写一个包装器,它会按顺序调用两者(至少通过 shell 脚本中的管道)。
(如“Is it possible to redirect output of one program to input of other program in different operational systems? ”)。

关于git - 对 git 中的相同文件应用多个过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13988619/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com