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

[Question] Can Git Diff with block context

From
ZheNing Hu <adlternative@gmail.com>
Date
Dec 25, 2023, 03:46 UTC
Message-ID
<CAOLTT8R-wo+20Xt94mBsC8gaP3aaAg=aa96K8fTjYQMyaC0fJA@mail.gmail.com>
Hi,

In our code review process on our coding platform, when displaying the diff of a file, we add a parameter called include_extra_info_lines, which is used to expand the display of code lines related to code comments (I'm not sure if this feature was ported from GitLab). However, in terms of implementation, this feature is achieved on the server side by a very cumbersome method, which stitches together the normal diff and the diff of the code comment block before rendering it. I would like to know if git diff natively supports a similar capability, where I can specify the first and last lines of the blocks of the file that I need, and then diff will load these blocks together.

-- ZheNing Hu

Message 1 of 1 in “[Question] Can Git Diff with block context”
  1. ZheNing HuDec 25, 2023

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.