Skip to content

Support columinized output in tag/branch/ls-files/grep

Nguyễn Thái Ngọc Duy git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12Move term_columns() to pager.ccache.h help.c pager.c+24 -220 replies
2/12setup_pager(): save terminal width before redirecting stdoutpager.c+9 -00 replies
3/12Add columnizer.gitignore Makefile column.c +2 more+191 -00 replies
4/12help: use columnizerhelp.c+10 -210 replies
5/12Add builtin command "column"Documentation/git-column.txt Makefile builtin.h +3 more+186 -00 replies
6/12Add helpers to redirect stdout to "git column"column.h pager.c+65 -00 replies
7/12add core.columnsDocumentation/config.txt cache.h config.c +1 more+16 -00 replies
8/12tag: support column output with --columnsDocumentation/git-tag.txt builtin/tag.c+24 -40 replies
9/12branch: support column output with --columnsDocumentation/git-branch.txt builtin/branch.c+23 -30 replies
10/12ls-files: support column output with --columnsbuiltin/ls-files.c+10 -00 replies
11/12grep: do not return early in cmd_grep() if there is no errorbuiltin/grep.c+17 -220 replies
12/12grep: support column output with --columnsDocumentation/git-grep.txt builtin/grep.c+19 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/12] Support columinized output in tag/branch/ls-files/grep

This adds support to show columnized output in the mentioned commands. I am quite happy with columnized "git branch/tag".

There is still room for improvement. For example, if "git column" is going to display all items in one or two lines (too wide screen), then falling back to one column mode would be better.

I'm also experimenting aligned grep output. While it's useful sometimes to look for things near the beginning of line, I don't know if it's really worth the effort.

Anyway, enjoy the new output (Hmm.. "git config -l" may be applicable for columnization too)

Nguyễn Thái Ngọc Duy (12):
Move term_columns() to pager.c
setup_pager(): save terminal width before redirecting stdout Add columnizer
help: use columnizer
Add builtin command "column"
Add helpers to redirect stdout to "git column"
add core.columns
tag: support column output with --columns
branch: support column output with --columns
ls-files: support column output with --columns
grep: do not return early in cmd_grep() if there is no error
grep: support column output with --columns

 .gitignore                   |    1 +
 Documentation/config.txt     |    8 ++
 Documentation/git-branch.txt |    8 ++
 Documentation/git-column.txt |   40 ++++++++++
 Documentation/git-grep.txt   |   10 +++
 Documentation/git-tag.txt    |   11 +++-
 Makefile                     |    3 +
 builtin.h                    |    1 +
 builtin/branch.c             |   18 ++++-
 builtin/column.c             |   42 +++++++++++
 builtin/grep.c               |   48 +++++++------
 builtin/ls-files.c           |   10 +++
 builtin/tag.c                |   17 ++++-
 cache.h                      |    2 +
 column.c                     |  164 ++++++++++++++++++++++++++++++++++++++++++
 column.h                     |   25 +++++++
 command-list.txt             |    1 +
 config.c                     |    6 ++
 environment.c                |    1 +
 git.c                        |    1 +
 help.c                       |   55 +++-----------
 pager.c                      |   95 ++++++++++++++++++++++++
 t/t9002-column.sh            |  101 ++++++++++++++++++++++++++
 23 files changed, 595 insertions(+), 73 deletions(-)
 create mode 100644 Documentation/git-column.txt
 create mode 100644 builtin/column.c
 create mode 100644 column.c
 create mode 100644 column.h
 create mode 100755 t/t9002-column.sh