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 13, 2024, 06:21 UTC
Message-ID
<xmqqil3x69dk.fsf@gitster.g>
In-Reply-To
<CABPp-BGp0NMQKLYg=OxJgnVxARffNF57B_N2bLmwT2R2EZqhdA@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 20 quoted lines
>> I am not very happy with the hardcoded 97.  You are already using
>> the non-standard 10% threshold.  If the delta detection that
>> forgets about the last line is so broken as your proposed log
>> message noted, shouldn't you be able to construct a sample pair of
>> preimage and postimage for which the broken version gives so low
>> similarity to be judged not worth treating as a rename, while the
>> fixed version gives reasonable similarity to be made into a rename,
>> by the default threshold?  That way, the test only needs to see if
>> we got a rename (with any similarity) or a delete and an add.
>
> Oops, the threshold is entirely unnecessary here; not sure why I
> didn't remember to take it out (originally used the threshold while
> testing without the fix to just how low of a similarity git thought
> these nearly identical files had).
>
> Since you don't like the threshold, and since we don't seem to have a
> summary format that reports on the rename without the percentage, I
> guess I need to munge the output with sed:
>
>       sed -e "s/^R[0-9]* /R /" actual >actual.munged &&
Heh, I was hoping that we should be able to use "diff --name-only".
 $ git mv Makefile Breakfile
 $ git diff --name-only -M HEAD
 Breakfile
 $ git reset --hard
 $ git rm Makefile
 $ >Breakfile && git add Breakfile
 $ git diff --name-only -M HEAD
 Breakfile
 Makefile
 $ git reset --hard
Previous: Elijah NewrenNext: Elijah Newren
Message 5 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.