git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git: how to produce context diffs?

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 27, 2006, 16:05 UTC
Message-ID
<200611271705.36479.jnareb@gmail.com>
In-Reply-To
<BAYC1-PASMTP01B6529D1821EEBC0A6E6FAEE60@CEZ.ICE>
Sean wrote:
Show 19 quoted lines
> On Mon, 27 Nov 2006 15:27:20 +0100
> Jakub Narebski <jnareb@gmail.com> wrote:
> 
>> 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".
Which both mean the same.
> 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.
Which, in convoluted way is said in documentation (the fact that
GIT_DIFF_OPTS affect internal diff).
 
> 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.
For now.
-- 
Jakub Narebski
Previous: SeanNext: Sean
Message 4 of 8 in “git: how to produce context diffs?”
  1. Bruno HaibleNov 27, 2006
  2. Jakub NarebskiNov 27, 2006
  3. SeanNov 27, 2006
  4. Jakub NarebskiNov 27, 2006
  5. SeanNov 27, 2006
  6. SeanNov 27, 2006
  7. Thomas KolejkaNov 27, 2006
  8. Junio C HamanoNov 27, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.