git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 19, 2024, 06:27 UTC
Message-ID
<xmqqbk9hn8gw.fsf@gitster.g>
In-Reply-To
<CABPp-BHybPEg_+649fL6QrKjRQcJXxbYMFiQn0KxAgbr2Nz0Gg@mail.gmail.com>
Elijah Newren <newren@gmail.com> 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.
Previous: Elijah NewrenNext: Elijah Newren via GitGitGadget
Message 9 of 10 in “diffcore-delta: avoid ignoring final 'line' of file”
  1. diffcore-delta: avoid ignoring final 'line' of fileElijah Newren via GitGitGadget, Jan 11, 2024
  2. Taylor BlauJan 11, 2024
  3. Junio C HamanoJan 11, 2024
  4. Elijah NewrenJan 13, 2024
  5. Junio C HamanoJan 13, 2024
  6. Elijah NewrenJan 19, 2024
  7. Junio C HamanoJan 19, 2024
  8. Elijah NewrenJan 19, 2024
  9. Junio C HamanoJan 19, 2024
  10. diffcore-delta: avoid ignoring final 'line' of fileElijah Newren via GitGitGadget, Jan 13, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.