Subject: Re: [PATCH] diffcore-delta: avoid ignoring final 'line' of file

From: Junio C Hamano <[email-masked]>
Date: Thu, 18 Jan 2024 22:27:43 -0800

Elijah Newren <[email-masked]> writes:

> But perhaps I can put it another way:  You can't just look at the
> output of `diff --name-only` and say a rename was involved -- unless
> you know the test setup and the previous operations.

That is true.  But that is exactly what a test is about.  You have
this and that file, and you do this operation, now what should
happen?  Does the observation match the expectation?  That is what
our tests are done.

And your argument should not have to rely on a bug in "git mv".
After all, you should be able to do the same with "mv A B && git add
B && git add -u" (or "git rm -f A") and you won't be affected by
such a bug.

> If you still like `diff --name-only` better anyway, that's fine and
> I'll switch it.  I'm just stating why it seems suboptimal to me.

I'd prefer to omit "sed" involved, but I'd even more prefer not
waste more time on the test.  As long as we can make a robust test
(which an extra process running sed would certainly give us), I'd be
fine.

Thanks.