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

[PATCH 0/3 v2] diff --stat: use the real terminal width

From
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date
Feb 10, 2012, 16:39 UTC
Message-ID
<1328891972-23695-1-git-send-email-zbyszek@in.waw.pl>
In-Reply-To
<CACsJy8AQdz=uwDm+FOgcUB5JOi5U7w-W4w7yUPL6wd2FO-bArg@mail.gmail.com>

Hi, this is version 2. Changes:

- style fixes
- some tests for git-format-patch added
- patches 3 and 4 squashed together, since they touch the same lines
- graph width is limited to 40 columns, even if there's more space
- patch descriptions extended and cleared up
Description (modified):

this is a patch series to make 'git diff --stat' use full terminal width instead of hard-coded 80 columns.

This is quite useful when working on projects with nested directory
structure, e.g. Java:
 .../{ => workspace/tasks}/GetTaskResultAction.java |   10 +-
 .../tasks}/RemoveAllAbortedTasksAction.java        |    7 +-
 .../tasks}/RemoveAllFailedTasksAction.java         |    7 +-
is changed to display full paths if the terminal window is wide
enough.

Git usually uses the full terminal width automatically, so it should do so with --stat too.

The "big" functional change in the patch series is s/80/term_columns()/ in show_stats(). The partitioning of available columns is changed to dedicate more space to file names and the number of columns used for +- graph is limited.

Previous: Nguyen Thai Ngoc DuyNext: Zbigniew Jędrzejewski-Szmek
Message 11 of 46 in “(unknown)”
  1. Zbigniew Jędrzejewski-SzmekFeb 9, 2012
  2. 1/4 Move git_version_string to help.c in preparation for diff changesZbigniew Jędrzejewski-Szmek, Feb 9, 2012
  3. Junio C HamanoFeb 10, 2012
  4. 2/4 help.c: make term_columns() cached and export itZbigniew Jędrzejewski-Szmek, Feb 9, 2012
  5. Junio C HamanoFeb 10, 2012
  6. 3/4 diff --stat: use the real terminal widthZbigniew Jędrzejewski-Szmek, Feb 9, 2012
  7. Junio C HamanoFeb 10, 2012
  8. Nguyen Thai Ngoc DuyFeb 10, 2012
  9. Zbigniew Jędrzejewski-SzmekFeb 10, 2012
  10. Nguyen Thai Ngoc DuyFeb 10, 2012
  11. 0/3 diff --stat: use the real terminal widthZbigniew Jędrzejewski-Szmek, Feb 10, 2012
  12. 1/3 Move git_version_string to help.c before diff changesZbigniew Jędrzejewski-Szmek, Feb 10, 2012
  13. Junio C HamanoFeb 10, 2012
  14. 2/3 help.c: make term_columns() cached and export itZbigniew Jędrzejewski-Szmek, Feb 10, 2012
  15. Nguyen Thai Ngoc DuyFeb 11, 2012
  16. Zbigniew Jędrzejewski-SzmekFeb 11, 2012
  17. Junio C HamanoFeb 12, 2012
  18. 1/2 Save terminal width before setting up pager and export term_columns()Zbigniew Jędrzejewski-Szmek, Feb 12, 2012
  19. Junio C HamanoFeb 13, 2012
  20. Nguyen Thai Ngoc DuyFeb 14, 2012
  21. Zbigniew Jędrzejewski-SzmekFeb 14, 2012
  22. 2/2 Rename lineno_width to decimal_width and export itZbigniew Jędrzejewski-Szmek, Feb 12, 2012
  23. Junio C HamanoFeb 13, 2012
  24. make lineno_width() from blame reusable for othersZbigniew Jędrzejewski-Szmek, Feb 14, 2012
  25. 3/3 diff --stat: use the real terminal widthZbigniew Jędrzejewski-Szmek, Feb 10, 2012
  26. Junio C HamanoFeb 10, 2012
  27. diff --stat: use the full terminal widthZbigniew Jędrzejewski-Szmek, Feb 12, 2012
  28. Junio C HamanoFeb 14, 2012
  29. 1/3 diff --stat: use the full terminal widthZbigniew Jędrzejewski-Szmek, Feb 14, 2012
  30. 2/3 diff --stat: better alignment for binary filesZbigniew Jędrzejewski-Szmek, Feb 14, 2012
  31. 3/3 Update diff --stat output in tests and tutorialZbigniew Jędrzejewski-Szmek, Feb 14, 2012
  32. Junio C HamanoFeb 15, 2012
  33. 1/3 diff --stat: tests for long filenames and big change countsZbigniew Jędrzejewski-Szmek, Feb 15, 2012
  34. 2/3 diff --stat: use the full terminal widthZbigniew Jędrzejewski-Szmek, Feb 15, 2012
  35. Junio C HamanoFeb 15, 2012
  36. 3/3 diff --stat: use less columns for change countsZbigniew Jędrzejewski-Szmek, Feb 15, 2012
  37. Nguyen Thai Ngoc DuyFeb 15, 2012
  38. Junio C HamanoFeb 15, 2012
  39. Junio C HamanoFeb 15, 2012
  40. Zbigniew Jędrzejewski-SzmekFeb 16, 2012
  41. Junio C HamanoFeb 16, 2012
  42. Junio C HamanoFeb 15, 2012
  43. Junio C HamanoFeb 15, 2012
  44. Johannes SixtFeb 15, 2012
  45. 4/4 diff --stat: use most of the space for file namesZbigniew Jędrzejewski-Szmek, Feb 9, 2012
  46. Junio C HamanoFeb 10, 2012

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.