Re: git commit -v does not removes the patch
- From
Jeff King <peff@peff.net>
- Date
- Nov 22, 2008, 20:10 UTC
- Message-ID
- <20081122201000.GA5903@sigill.intra.peff.net>
- In-Reply-To
- <20081122155541.GC6885@neumann>
On Sat, Nov 22, 2008 at 04:55:41PM +0100, SZEDER Gábor wrote:
Show 5 quoted lines
> Thanks for the tip. Junio's suggestion about '# Everything under this > line is deleted.' could be implemented this way fairly easily (just an > additional echo in prepare-commit-msg, and other pattern in > commit-msg). But 'git commit --no-verify' is indeed a problem. > Although I never use it explicitly, 'git rebase -i' does so.
One other option would be to munge the editor script instead of using hooks. I.e., something like this:
$ cat ~/local/bin/git-editor #!/bin/sh echo '# Everything under this line is deleted' >>"$1" git diff --cached >>"$1" $EDITOR "$1" || exit $? sed -i '/^# Everything under this line is deleted$/Q' "$1"
$ git config core.editor ~/local/bin/git-editor
Of course, then you end up with the munging for things like "git rebase -i" picking commits, but it should be harmless (since we end up removing it anyway).
-Peff