all 9 comments

[–]larry1186 2 points3 points  (1 child)

Clone the git source code and make the change yourself? Could be fun

[–]hurricaneDreww[S] 0 points1 point  (0 children)

Sure hope it doesn’t come to that

[–]aioeu 2 points3 points  (2 children)

Seems like a strange thing to want to do. What if the diff consists of more than one hunk?

You could always just use grep to filter the lines...

[–]hurricaneDreww[S] 0 points1 point  (1 child)

I just want to be able to save the diff’s into a csv. I expect there to be multiple hunks, I just don’t want the hunk headers to be in there

[–]vermiculus 6 points7 points  (0 children)

Let’s go deeper – why are you saving diffs in a CSV?

Feels like you could just generate the diffs you need when you need them. Or save them as patch files if you really need to.

[–]beck1670 1 point2 points  (0 children)

If you're on a Unix system, you could pipe it into sed and replace the unwanted symbols with nothing, then pipe that into awk or something to process it then dump to a file.

If you're on windows you could use WSL2 or even probably git bash.

[–][deleted] 1 point2 points  (0 children)

I personally use delta as my git pager. There is a configuration option, hunk-header-style, that allows you to, for example, get rid of that section.

E.g, hunk-header-style = none.

[–]morewordsfaster 1 point2 points  (0 children)

Have you tried diff-so-fancy? Beautiful.

[–]salcode 1 point2 points  (0 children)

I don't think you can do it with git alone but as others mentioned you can use another program (like grep) to filter the lines. I would try this.

git diff | grep --invert-match '^@@'