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

Re: [PATCH 3/3] WIP - Allow custom printf function for column printing

From
Stefan Beller <sbeller@google.com>
Date
Mar 30, 2017, 18:53 UTC
Message-ID
<CAGZ79ka6_wmVecBDpCrxr+3Vp5evKVUf164fs=CMGxgTx5PWxQ@mail.gmail.com>
In-Reply-To
<20170330032219.ujqddocibufn535d@sigill.intra.peff.net>
On Wed, Mar 29, 2017 at 8:22 PM, Jeff King <peff@peff.net> wrote:
Show 11 quoted lines
> On Wed, Mar 29, 2017 at 06:42:38PM -0700, Stefan Beller wrote:
>
>> Ever wondered why column.ui applies the untracked files in git-status,
>> but not for the help text comment in git-commit? Nobody wrote the code!
>>
>> This is marked as WIP, as it barely demonstrates how the code may look
>> like. No tests, no documentation.
>
> I'm confused about what this patch is trying to do. Is it just to turn
> on column.status support for the template shown by git-commit? Or is it
> columnizing more than the untracked files list?
It is just columnizing the untracked files list.
>
> If the former, why isn't just setting s.colopts enough? I guess because
> we write into a strbuf?

Yes, because it is a strbuf, and not stdout. the column code could only write to stdout (which was solved in prior patches), but we still have to provide a "printf like" function, which is the majority of this patch.

The remaining part of the patch, which could go into a separate patch
is the removal of:
-       s.colopts = 0;
> If the latter, then isn't that a separate logical patch from "should
> commit use columns"?
yes, I was too quick there.
> I don't have an opinion on the whole thing myself, as I do not use
> columns nor really know how they are supposed to work. You found my
> 4d2292e9a9, but I was explicitly trying _not_ to get involved in any
> behavior changes there due to my cluelessness. :)

eh, ok. I thought you had deeper reasons than that. I did not use columns either, but now it looks like I am a new user of that feature. If only Git would users easily discover cool features. ;)

>
> I think Duy, who wrote all of the column code, is a better person to cc.
>
> -Peff
Previous: Jeff KingNext: Duy Nguyen
Message 7 of 9 in “Respect column.ui in commented status in git-commit”
  1. 0/3 Respect column.ui in commented status in git-commitStefan Beller, Mar 30, 2017
  2. 2/3 column: allow for custom printfStefan Beller, Mar 30, 2017
  3. Jeff KingMar 30, 2017
  4. Duy NguyenApr 10, 2017
  5. 3/3 WIP - Allow custom printf function for column printingStefan Beller, Mar 30, 2017
  6. Jeff KingMar 30, 2017
  7. Stefan BellerMar 30, 2017
  8. Duy NguyenApr 10, 2017
  9. 1/3 column.c: pass column_options to down to display_plainStefan Beller, Mar 30, 2017

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.