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

Re: [PATCH 1/3] pretty: Pass graph width to pretty formatting for use in '%>|(N)'

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 22, 2015, 22:54 UTC
Message-ID
<xmqqbn9iccwa.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CACsJy8C8DCi_pZDd=m1hE70t7Z+MX3j6WcMe-Hp-u0y5VvwKqg@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 33 quoted lines
> (I'm joining the newer thread [1] back to this one, thanks for
> reminding me about this)
>
> [1] http://thread.gmane.org/gmane.comp.version-control.git/282771
>
> On Tue, Sep 22, 2015 at 2:40 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Josef Kufner <josef@kufner.cz> writes:
>>
>>> Pass graph width to pretty formatting, so N in '%>|(N)' includes columns
>>> consumed by graph rendered when --graph option is in use.
>>>
>>> Example:
>>>   git log --all --graph --pretty='format: [%>|(20)%h] %ar%d'
>>>
>>>   All commit hashes should be aligned at 20th column from edge of the
>>>   terminal, not from the edge of the graph.
>>>
>>> Signed-off-by: Josef Kufner <josef@kufner.cz>
>>> ---
>>
>> [CC'ed Duy for ideas, as the "%>|(ALIGN)" thing is his invention]
>> ...
>>
>> I have a suspicion that 50% of the users would appreciate this
>> change, and the remainder of the users see this break their
>> expectation.  To avoid such a regression, we may be better off if we
>> introduced a new alignment operator that is different from '%>|(N)'
>> so that this new behaviour is available to those who want to use it,
>> without negatively affecting existing uses.
>
> I tend to agree with Josef. >|(N) is about columns relative to the
> left edge of the screen. You can already use >(N) to be relative to
> the left edge of the space given to the commit.

OK. I didn't check if >(N) with that old patch still behaves that way, but if that is sensible, then it is not breaking anything, so it may be a good idea to salvage it. I dunno.

Previous: Duy Nguyen
Message 6 of 6 in “pretty: Pass graph width to pretty formatting for use in '%>|(N)'”
  1. 1/3 pretty: Pass graph width to pretty formatting for use in '%>|(N)'Josef Kufner, Sep 11, 2015
  2. 2/3 Add tests for "pretty: Pass graph width to pretty formatting for use in '%>|(N)'"Josef Kufner, Sep 11, 2015
  3. 3/3 t4205: remove unnecessary use of qz_to_tab_spaceJosef Kufner, Sep 11, 2015
  4. Junio C HamanoSep 21, 2015
  5. Duy NguyenDec 22, 2015
  6. Junio C HamanoDec 22, 2015

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.