Phillip Wood <phillip.wood123@xxxxxxxxx> writes: > There is also a practical argument against using "git diff" to > generate the expected output as it only works if the diff contains a > single hunk. If the diff contains more than one hunk "add -p" displays > them separately. True, but spliting the output from "git diff" at @@ hunk boundary lines would allow you to hardcode the assumption that "add -p" shows each hunk exactly as "git diff" would. So if we really wanted to have the convenience that the tests' expectation automatically follow what "git diff" of the day happens to produce, it is still a viable approach to use "git diff" output with some post-processing. Thanks.