Re: git: how to produce context diffs?
- From
Sean <seanlkml@sympatico.ca>
- Date
- Nov 27, 2006, 15:38 UTC
- Message-ID
- <BAYC1-PASMTP10B822EE809E075EFFD879AEE60@CEZ.ICE>
- In-Reply-To
- <ekesgt$6jq$1@sea.gmane.org>
On Mon, 27 Nov 2006 15:27:20 +0100 Jakub Narebski <jnareb@gmail.com> wrote:
Show 12 quoted lines
> Bruno Haible wrote: > > > Is this a bug in git-diff? The git-diff-files.html says: > > > > " When the environment variable GIT_EXTERNAL_DIFF is not set ... > > For example, if you prefer context diff: > > GIT_DIFF_OPTS=-c git-diff-index -p HEAD " > > > > This doesn't work for me with git-1.4.4: > > Yes, the bug in documentation, I think. There is an option '-c' to git-diff, > but it means "combined diff" (for merges), not "context diff".
Indeed. That documentation predates built-in diff completely.
It appears the only valid options now are "-u XX" and "--unified=XX". These options are never passed to diff, but rather used to control the internal diff. Strangely, it appears that gitk is even passing incorrect parameters via GIT_DIFF_OPTS.
Unless i've really missed something, the above documentation should be reworked to remove mention of running diff altogether, and should mention that the GIT_DIFF_OPTS only has two valid settings.