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

Re: [RFC/PATCH 5/4] Documentation: flesh out diff --no-index description

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 13, 2010, 22:40 UTC
Message-ID
<7vtykphg2q.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20101011160718.GF25842@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 12 quoted lines
> +'git diff' [--options] --no-index [--] <path> <path>::
> +
> +	In this form, 'git diff' will compare a pair of files or
> +	directories that are not necessarily being managed by git.
> +	The tracked content of files in the index and the object
> +	database are ignored.
> ++
> +In other words, this form allows 'git diff' to be used as a
> +traditional 'diff' command (plus the familiar extras like --check,
> +color, pagination, automatic use of -r, --stat/--name-status,
> +--pickaxe, --binary, copy/rename detection, -Oorderfile, and
> +--patience).

My initial knee-jerk reaction was "how would -C/-M/-O be useful when you can only give two paths?" Perhaps it would become easier to read if we phrased it like this?

    This form allows 'git diff' to be used as a better 'diff' command,
    with extras like whitespace checks (--check), coloring (--color),
    wordwise diff (--color-words), pagination, diffstat (--stat), binary
    patch (--binary), alternative algorithm (e.g. --patience).  In
    addition, when comparing two directories, rename detection (-M) may
    come in handy.
Note, by the way, that I didn't verify all the claims the above makes.
Previous: Jonathan NiederNext: Yann Dirson
Message 12 of 15 in “Undocumented git-diff syntax”
  1. Yann DirsonOct 11, 2010
  2. Santi BéjarOct 11, 2010
  3. Yann DirsonOct 11, 2010
  4. Santi BéjarOct 11, 2010
  5. 0/4 Re: Undocumented git-diff syntaxJonathan Nieder, Oct 11, 2010
  6. 1/5 Documentation: gitrevisions is in section 7Jonathan Nieder, Oct 11, 2010
  7. Sverre RabbelierOct 11, 2010
  8. 2/4 Documentation: diff can compare blobsJonathan Nieder, Oct 11, 2010
  9. 3/4 Documentation: expand 'git diff' SEE ALSO sectionJonathan Nieder, Oct 11, 2010
  10. 4/4 Documentation: update "git diff --no-index" descriptionJonathan Nieder, Oct 11, 2010
  11. 5/4 Documentation: flesh out diff --no-index descriptionJonathan Nieder, Oct 11, 2010
  12. Junio C HamanoOct 13, 2010
  13. Yann DirsonOct 11, 2010
  14. Sverre RabbelierOct 11, 2010
  15. Jakub NarebskiOct 11, 2010

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.