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

Re: [PATCH 0/7] Rework diff options

From
Junio C Hamano <junkio@cox.net>
Date
Jun 26, 2006, 18:24 UTC
Message-ID
<7v64inixm6.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vslltopzg.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 12 quoted lines
> Here are a few problems I have seen:
>
>  - "git show --stat HEAD" gives '---' marker as Johannes and you
>    have already discussed (I do not mind this that much though);
>
>  - "--cc" seems to be quite broken.  "git show v1.0.0" nor "git
>    diff-tree --pretty --cc v1.0.0" does not give the log
>    message, and gives something quite confused instead.  I think
>    it is showing "-m -p" followed by "--cc".
>
> We may find more minor breakages, in addition to these, but I am
> reasonably sure we should be able to fix them in-tree.
Further impressions, while with a clean index and working tree.
First the good ones (improvements).
 - "git diff-index --patch-with-raw HEAD" gives empty result;
   the traditional one shows one empty line.
 - "git diff-tree -p --stat" and "git diff-tree --stat -p"
   works, as you planned.
 - "git diff-tree --root --patch-with-raw --summary" works; the
   traditional one misses --summary.
 - "git show --name-only HEAD" works; the traditional one always
   does --cc -p; the same for "git show -s HEAD".
Regressions, most of the minor.
 - "git diff-index -p --stat HEAD" gives one empty line; the
   traditional one gives empty.
 - "git diff-tree --patch-with-raw HEAD" for a non-merge commit
   misses the empty line between raw and patch.
 - "git diff-tree --cc HEAD" for an evil merge (a merge whose
   result does not match either parents, e.g. v1.0.0) shows extra
   two-tree diffs (presumably HEAD^1..HEAD and HEAD^2..HEAD)
   before showing what is expected.  The same for "git show". 
 - "git show --name-only HEAD" for an evil merge similarly shows
   extra two-tree diffs in --name-only format before showing
   what is expected.  Presumably the same bug as the above.
 - "git diff-tree -c HEAD" for an evil merge shows extra newline
   after the output.
 - Neither "git diff-tree -m -s HEAD" for a merge, "git diff-tree -s
   HEAD" for a non-merge does not squelch the output; same for
   "git whatchanged".
 - "git log --raw HEAD" descends into subdirectories.  It
   instead should show the top-level tree differences.
 - "git diff-tree --pretty --patch-with-stat HEAD" for a
   non-merge misses "---\n" before stat (I think you are aware
   of this).
 - "git show --cc HEAD" for a merge should do "---\n", followed
   by a stat for diff between HEAD^1..HEAD, followed by dense
   combined-diff for HEAD.
Previous: Timo Hirvonen
Message 20 of 20 in “Rework diff options”
  1. 0/7 Rework diff optionsTimo Hirvonen, Jun 24, 2006
  2. 1/7 Clean up diff.cTimo Hirvonen, Jun 24, 2006
  3. 2/7 Merge with_raw, with_stat and summary variables to output_formatTimo Hirvonen, Jun 24, 2006
  4. Johannes SchindelinJun 24, 2006
  5. Timo HirvonenJun 24, 2006
  6. Johannes SchindelinJun 24, 2006
  7. Add msg_sep to diff_optionsTimo Hirvonen, Jun 25, 2006
  8. Junio C HamanoJun 25, 2006
  9. whatchanged: Default to DIFF_FORMAT_RAWTimo Hirvonen, Jun 25, 2006
  10. Junio C HamanoJun 25, 2006
  11. whatchanged: Default to DIFF_FORMAT_RAWTimo Hirvonen, Jun 25, 2006
  12. Don't xcalloc() struct diffstat_tTimo Hirvonen, Jun 25, 2006
  13. 3/7 Make --raw option available for all diff commandsTimo Hirvonen, Jun 24, 2006
  14. 4/7 Set default diff output format after parsing command lineTimo Hirvonen, Jun 24, 2006
  15. 5/7 DIFF_FORMAT_RAW is not default anymoreTimo Hirvonen, Jun 24, 2006
  16. 6/7 --name-only, --name-status, --check and -s are mutually exclusiveTimo Hirvonen, Jun 24, 2006
  17. 7/7 Remove awkward compatibility wartsTimo Hirvonen, Jun 24, 2006
  18. Junio C HamanoJun 25, 2006
  19. Timo HirvonenJun 25, 2006
  20. Junio C HamanoJun 26, 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.