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 15, 2016, 23:09 UTC
Message-ID
<CA+P7+xq7cEjAeW720gtKXm==8rrfOdJu81efJdtEmsXfv7E4Vw@mail.gmail.com>
In-Reply-To
<xmqqwpjihwkz.fsf@gitster.mtv.corp.google.com>
On Mon, Aug 15, 2016 at 8:37 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Jacob Keller <jacob.keller@gmail.com> writes:
>
>> I will look more into how to do the log version tomorrow, if I am
>> still stuck I will re-work the patches as you suggest here.
>>
>> I am hoping I can find a good solution for how to handle it though.
>
> Thanks, I am hoping the same, too ;-)

Ok, so I found a way that (ab)uses the graph API to enable line-prefix support. I moved the way we handle diff prefix into the graph callback handler as well, and I also moved around some code so that the graph API will work correctly. I found several places that actually broke if you tried calling the graph API with a null graph, because they would still try to access the FILE* pointer inside and could lead to a segfault. This should fix those up as well.

Hopefully this is along the lines of what you were thinking, and it should allow more advanced calls to a submodule format that shows the full log if we wanted.

Thanks, Jake

Previous: Junio C Hamano
Message 10 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.