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

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

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Mar 9, 2010, 16:49 UTC
Message-ID
<4B967C36.90309@lsrfire.ath.cx>
In-Reply-To
<fcaeb9bf1003080632o622c8c79x85b816edcf893bc3@mail.gmail.com>
Am 08.03.2010 15:32, schrieb Nguyen Thai Ngoc Duy:
Show 6 quoted lines
> On 3/8/10, René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:
>>  I'm not so sure about the interface, though.  Does the task really
>>  warrant adding a new git command?
> 
> Several reasons:
>  - Can be reused outside of git (I was surprised Solaris did not have "column")

Granted, we have a precedent: git stripspace. But I don't like that one, either. ;) If it's not specific to git, then it should not be a git command.

Perhaps name it git-column--helper, so that it can still be used by git commands that are implemented as scripts?

>  - Easier to test
Name it test-column?
>  - Minimum code change in modifed commands

OK, forking out is easy, but replacing printf() calls with calls to feed the columnizer shouldn't be _that_ intrusive, either.

>  - I can play with more complicated column layout, with minimum code
> change in git (ok, that's the third reason).

This is possible regardless of the way how the columnizer is invoked if its full functionality is exposed through the command line parameter.

With "more complicated", do you perhaps mean what GNU ls does, namely having non-uniform column widths? I never consciously noticed that it actually goes out of its way to cram as may columns on the screen as possible, it just feels so natural. :)

Show 7 quoted lines
>>  If a --column parameter is added, I think it should expose the full
>>  range of options, i.e. fill columns first (ls -C style), fill rows first
>>  (ls -x style) as well as off (ls -1 style) and auto.
> 
> Maybe an env variable would be better, so you can pass abitrary
> arguments to git-column. "--column=auto" should be supported, of
> course.
I don't see any benefit of an environment variable over config options.
René
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 16 of 24 in “Support columinized output in tag/branch/ls-files/grep”
  1. 00/12 Support columinized output in tag/branch/ls-files/grepNguyễn Thái Ngọc Duy, Mar 7, 2010
  2. 01/12 Move term_columns() to pager.cNguyễn Thái Ngọc Duy, Mar 7, 2010
  3. 02/12 setup_pager(): save terminal width before redirecting stdoutNguyễn Thái Ngọc Duy, Mar 7, 2010
  4. 03/12 Add columnizerNguyễn Thái Ngọc Duy, Mar 7, 2010
  5. 04/12 help: use columnizerNguyễn Thái Ngọc Duy, Mar 7, 2010
  6. 05/12 Add builtin command "column"Nguyễn Thái Ngọc Duy, Mar 7, 2010
  7. 06/12 Add helpers to redirect stdout to "git column"Nguyễn Thái Ngọc Duy, Mar 7, 2010
  8. 07/12 add core.columnsNguyễn Thái Ngọc Duy, Mar 7, 2010
  9. 08/12 tag: support column output with --columnsNguyễn Thái Ngọc Duy, Mar 7, 2010
  10. 09/12 branch: support column output with --columnsNguyễn Thái Ngọc Duy, Mar 7, 2010
  11. 10/12 ls-files: support column output with --columnsNguyễn Thái Ngọc Duy, Mar 7, 2010
  12. 11/12 grep: do not return early in cmd_grep() if there is no errorNguyễn Thái Ngọc Duy, Mar 7, 2010
  13. 12/12 grep: support column output with --columnsNguyễn Thái Ngọc Duy, Mar 7, 2010
  14. René ScharfeMar 8, 2010
  15. Nguyen Thai Ngoc DuyMar 8, 2010
  16. René ScharfeMar 9, 2010
  17. Nguyen Thai Ngoc DuyMar 10, 2010
  18. Johannes SixtMar 10, 2010
  19. Nguyen Thai Ngoc DuyMar 10, 2010
  20. René ScharfeMar 11, 2010
  21. Nguyen Thai Ngoc DuyMar 12, 2010
  22. Junio C HamanoMar 8, 2010
  23. Nguyen Thai Ngoc DuyMar 9, 2010
  24. Junio C HamanoMar 9, 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.