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

Re: diff --break-rewrites for just a part of a file

From
Junio C Hamano <gitster@pobox.com>
Date
May 10, 2016, 19:16 UTC
Message-ID
<xmqq1t59pvtg.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<toea8jx3mt1.fsf@mimosa.sascha.silbe.org>
Sascha Silbe <sascha-ml-reply-to-2016-2@silbe.org> writes:
Show 5 quoted lines
> A combination of --break-rewrites and --inter-hunk-context that merges
> changes with less than the given number of unchanged lines between them
> into a single delete/insert change would be even better. But just
> ignoring the unchanged header and footer of a file for --break-rewrites
> would already go a long way.

That's interesting. Break-rewrites as originally designed and implemented is only about "When the entire file been rewritten completely, it is easier to read when the diff did not pay any attention to those accidentally common lines".

We recently had a discussion on tweaking the logic used to merge and minimize hunks; the topic was about where to start the hunk boundary for maximum readability when the beginning and end of a hunk can be shifted around, but this smells like a similar issue.

Previous: Sascha Silbe
Message 2 of 2 in “diff --break-rewrites for just a part of a file”
  1. Sascha SilbeMay 10, 2016
  2. Junio C HamanoMay 10, 2016

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.