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

Re: [PATCH v4 1/2] diff: add --line-prefix option for passing in a prefix

From
Jacob Keller <jacob.keller@gmail.com>
Date
Aug 11, 2016, 18:30 UTC
Message-ID
<CA+P7+xqodtUt9gPzZ5HxPurFy67niN5+-EDOTJpraNrvLJfZ=Q@mail.gmail.com>
In-Reply-To
<xmqqh9ar2pc7.fsf@gitster.mtv.corp.google.com>
On Thu, Aug 11, 2016 at 10:22 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
> -- >8 --
> Subject: diff.c: remove output_prefix_length field
>
> "diff/log --stat" has a logic that determines the display columns
> available for the diffstat part of the output and apportions it for
> pathnames and diffstat graph automatically.
>
> 5e71a84a (Add output_prefix_length to diff_options, 2012-04-16)
> added the output_prefix_length field to diff_options structure to
> allow this logic subtract the display columns used for display the
> history graph part from the total "terminal width"; this matters
> when the "git log --graph -p" option is in use.
>
> The field be set to the number of display columns needed to show the
> output from the output_prefix() callback.  Any new output_prefix()
> callback must also update the field accordingly, which is error
> prone.  As there is only one user of the field, and the user has the
> actual value of the prefix string, let's get rid of the field and
> have the user count the display width itself.
>
Seems correct to me.

Thanks, Jake

Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 8 in “diff: add --line-prefix option for passing in a prefix”
  1. 1/2 diff: add --line-prefix option for passing in a prefixJacob Keller, Aug 10, 2016
  2. 2/2 diff: add SUBMODULE_DIFF format to display submodule diffJacob Keller, Aug 10, 2016
  3. Junio C HamanoAug 11, 2016
  4. Jacob KellerAug 11, 2016
  5. Junio C HamanoAug 11, 2016
  6. Junio C HamanoAug 11, 2016
  7. Jacob KellerAug 11, 2016
  8. Junio C HamanoAug 11, 2016

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.