I've written a script to automate a git rebase --interactive
to edit a specified commit using GIT_SEQUENCE_EDITOR=sed ...s/pick/edit/...
How do I prevent the "helpful" message that git rebase --interactive
prints out:
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
This message is printed to STDERR, and I still want to see any errors of the rebase
command itself and/or any {pre,post}-rebase
hooks, so 2>/dev/null
isn't an option.
From the git config documentation, I've tried:
git -c advice.statusHints=false rebase --quiet --interactive --autostash --autosquash "$commit"~
I've also tried disabling advice.resolveConflict
and advise.detachedHead
.
There don't seem to be any useful options under
rebase.*
.
Both
git-rebase--preserve-merges.sh
(which callswarn ()
) and thesequencer.c
don't offer any option to prevent the display of that warning.You can modify
git-rebase--preserve-merges.sh
locally, but that won't be portable (plusgit rebase
is being rewritten in C anyway, starting with Git 2.19)Or you can submit a patch with a new setting allowing to silence that warning.
Or, as kostix suggests in the comments, you need to process the output of your command to filter out what you don't need:
(although kostix suggests to do this with a more advanced language than bash)