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

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

From
Jacob Keller <jacob.keller@gmail.com>
Date
Aug 12, 2016, 21:21 UTC
Message-ID
<CA+P7+xoX6AT7tGb5AJr1CSjzAQ67o8QXJFF1LxsV_7E_pF-moA@mail.gmail.com>
In-Reply-To
<xmqqvaz5vgc7.fsf@gitster.mtv.corp.google.com>
On Fri, Aug 12, 2016 at 2:15 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 45 quoted lines
> Jacob Keller <jacob.e.keller@intel.com> writes:
>
>> The prefix shall come first prior to any other prefix associated with
>> the --graph option or other source.
>>
>> Add tests for the same.
>>
>> Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
>> ---
>> - v5
>> * Changed name to --diff-line-prefix since --line-prefix might indicate
>>   for other commands such as log, when it only modifies diff output
>
> As you are adding this to "diff.c", I think the option would be
> visible to "git log" anyway, and more importantly
>
>     git log --line-prefix='I I ' --graph --boundary -p HEAD^..HEAD
>
> should honor the line-prefix for the log message part.  I'd expect
> that its output would be like:
>
> I I * commit 3c90ffd2f01e2d0d080c8e42df2ee89709b324de
> I I | Author: Jacob Keller <jacob.keller@gmail.com>
> I I | Date:   Thu Aug 11 15:59:45 2016 -0700
> I I |
> I I |     diff: add --diff-line-prefix option for passing in a prefix
> I I |
> I I |     Add an option to pass additional prefix to be displayed before diff
> I I |     output. This feature will be used in a following patch to output correct
> I I |     ...
> I I |     Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
> I I |     Signed-off-by: Junio C Hamano <gitster@pobox.com>
> I I |
> I I | diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
> I I | index 705a873..f924f57 100644
> I I | --- a/Documentation/diff-options.txt
> I I | +++ b/Documentation/diff-options.txt
> I I | ...
>
> Otherwise, a "git log --graph -p --submodule=log-with-diff", when
> showing a commit in the superproject that changes submodule from
> commit A to commit B, wouldn't be able to run "git log --graph -p A..B",
> i.e. as if the command recursed beyond the module boundary, would
> it?
>

Hmmmm, yes. I'll dig through and see if I can get the prefix to be honored by the git log as well.

Thanks, Jake

>
>
Previous: Junio C HamanoNext: Jacob Keller
Message 4 of 10 in “diff.c: remove output_prefix_length field”
  1. 1/3 diff.c: remove output_prefix_length fieldJacob Keller, Aug 11, 2016
  2. 2/3 diff: add --diff-line-prefix option for passing in a prefixJacob Keller, Aug 11, 2016
  3. Junio C HamanoAug 12, 2016
  4. Jacob KellerAug 12, 2016
  5. Jacob KellerAug 12, 2016
  6. 3/3 diff: add SUBMODULE_DIFF format to display submodule diffJacob Keller, Aug 11, 2016
  7. Junio C HamanoAug 14, 2016
  8. Jacob KellerAug 15, 2016
  9. Junio C HamanoAug 15, 2016
  10. Jacob KellerAug 15, 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.