Re: [RFC] best way to show diff of commit
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 25, 2007, 22:52 UTC
- Message-ID
- <7v1waej5ub.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20071125223150.GD21121@artemis.corp>
Pierre Habouzit <madcoder@debian.org> writes:
Show 18 quoted lines
> On Sun, Nov 25, 2007 at 10:27:09PM +0000, Junio C Hamano wrote: >> Pierre Habouzit <madcoder@debian.org> writes: >> >> > Hmm it doesn't because I would have to call git commit -v each time I >> > commit and well I _like_ having the status better. And moreover I want >> > the diff to go in a separated buffer too. >> >> I've never felt it a problem while editing the log message in Emacs. >> >> Don't enhanced vi implementations let you split the same buffer into >> two allowing you to view different portions of it these days? > > Well, maybe I could write my plugin so that it cuts the diff out from > the main buffer indeed, though I will have to learn using git commit -v > instead of git commit :P > > That and the fact that the syntax colorization of the diff doesn't > work, but it's probably not up to git to fix that.
Or you can use pre-commit hook (which will be run with GIT_INDEX_FILE set to the index file used for the commit) to generate the diff in a separate file, and set EDITOR (or GIT_EDITOR) to a script around vim to open the given COMMIT_EDITMSG as well as that file you create.