我有qazxsw poi自动化qazxsw poi使用written a script编辑特定的提交
如何防止git rebase --interactive
打印出的“有用”消息:
GIT_SEQUENCE_EDITOR=sed ...s/pick/edit/...
此消息打印到STDERR,我仍然希望看到git rebase --interactive
命令本身和/或任何Stopped at 307c446... Add candy-text
You can amend the commit now, with
git commit --amend
Once you are satisfied with your changes, run
git rebase --continue
挂钩的任何错误,因此rebase
不是一个选项。
从{pre,post}-rebase
,我尝试过:
2>/dev/null
我也试过禁用git config documentation和git -c advice.statusHints=false rebase --quiet --interactive --autostash --autosquash "$commit"~
。
在advice.resolveConflict
下似乎没有任何有用的选项。
advise.detachedHead
(rebase.*
)和git-rebase--preserve-merges.sh
都没有提供任何选项来阻止显示该警告。
你可以在本地修改calls warn ()
,但那不可移植(加上sequencer.c
)
或者你可以用一个新的设置git-rebase--preserve-merges.sh
,让沉默警告。
或者,正如git rebase
is being rewritten in C anyway, starting with Git 2.19建议使用submit a patch,您需要处理命令的输出以过滤掉您不需要的内容:
你最好的选择可能是用你的钩子脚本完全匹配它并消灭。 可能分两步完成:
- 匹配kostix并在匹配时将其删除;
- 如果匹配并删除,则匹配整个后续横幅并删除(如果匹配)。
(虽然kostix建议用比bash更高级的语言来做到这一点)