threads / discuss / 60654

[Question] Can Git Diff with block context

Subject: [Question] Can Git Diff with block context

## tl;dr

One message between Dec 25, 2023 and Dec 25, 2023.

replies: 0people: 1as markdown or json

ZheNing Hu· Dec 25, 2023, 03:46 UTC · lore
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

← back to recent threads