On 20/02/18 17:39, Junio C Hamano wrote:
Phillip Wood <phillip.wood@xxxxxxxxxxxx> writes:
From: Phillip Wood <phillip.wood@xxxxxxxxxxxxx>
Purge the index lines from diffs so we're not hard coding sha1 hash
values in the expected output.
The motivation of this patch is clear, but all-zero object name for
missing side of deletion or creation patch should not change when we
transition to any hash function. Neither the permission bits shown
in the output (and whether the index line has the bits are shown on
it in the first place, i.e. the index line of a creation patch does
not, whilethe one in a modification patch does).
So I am a bit ambivalent about this change.
Perhaps have a filter that redacts, instead of removes, selected
pieces of information that are likely to change while hash
transition, and use that consistently to filter both the expected
output and the actual output before comparing?
Keeping the permission bits makes sense (I'd not thought of them when I
created the patch) as we want to check that the file has the correct
permissions. As for the all-zero object name, is it really worth leaving
it in - if a file has been created or deleted then we'll still have
/dev/null as the file name for one side or the other and the diff lines
will show it as well. As these tests are just to check the state of the
index then I'm not sure the hash values add anything. How do you feel
about a filter like
sed "/^ index/s/ [0-9a-f][0-9a-f]*\.\.[0-9a-f][0-9a-f]*/x/"
Best Wishes
Phillip