沉默git rebase --interactive的“如何继续”的消息

问题描述 投票:4回答:1

我有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 documentationgit -c advice.statusHints=false rebase --quiet --interactive --autostash --autosquash "$commit"~

advice.resolveConflict下似乎没有任何有用的选项。

git git-rebase git-config git-interactive-rebase
1个回答
4
投票

advise.detachedHeadrebase.*)和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,您需要处理命令的输出以过滤掉您不需要的内容:

你最好的选择可能是用你的钩子脚本完全匹配它并消灭。 可能分两步完成:

  1. 匹配kostix并在匹配时将其删除;
  2. 如果匹配并删除,则匹配整个后续横幅并删除(如果匹配)。

(虽然kostix建议用比bash更高级的语言来做到这一点)

© www.soinside.com 2019 - 2024. All rights reserved.