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

Re: Feature request: Improve diff algorithm

From
Jacob Keller <jacob.keller@gmail.com>
Date
Nov 21, 2016, 18:55 UTC
Message-ID
<CA+P7+xqMUPLC-aKW-fiS629_Owat8sCa5vp_bOwQTO8LP4hCzw@mail.gmail.com>
In-Reply-To
<CAGZ79kZbGPneUXVEqJYhQAn+dfYve7qCjhO7QFaV1JBs3HD1aA@mail.gmail.com>
On Mon, Nov 21, 2016 at 10:17 AM, Stefan Beller <sbeller@google.com> wrote:
Show 43 quoted lines
> On Mon, Nov 21, 2016 at 8:56 AM, Jacob Keller <jacob.keller@gmail.com> wrote:
>> On Mon, Nov 21, 2016 at 12:11 AM, KES <kes-kes@yandex.ru> wrote:
>>> Hi.
>>>
>>
>> Hi,
>>
>>> I have some question about how diff works then give proposal:
>>>
>>> it will be very useful for each "symbol" store additional meta info as source line length. So in this case when git counter two equal sequence of commands it will do further comparison: Adds 23 chars deletes none VS adds 75 chars deletes 46
>>>
>>> Actually I got this:
>>>
>>> @@ -129,8 +132,9 @@ sub _preprocess_message {
>>>  sub _process_message {
>>>      my ($self, $message) = @_;
>>>
>>> -    my $method = ref($message) eq 'HASH' ? $message->{method} : undef;
>>> +    my $time =  [ gettimeofday ];
>>>
>>> +    my $method = ref($message) eq 'HASH' ? $message->{method} : undef;
>>>      return $self->send_error(ERROR_REQUEST_INVALID)
>>>          unless defined($method);
>>>
>>> Instead of expected:
>>> @@ -129,6 +132,8 @@ sub _preprocess_message {
>>>  sub _process_message {
>>>      my ($self, $message) = @_;
>>>
>>> +    my $time =  [ gettimeofday ];
>>> +
>>>      my $method = ref($message) eq 'HASH' ? $message->{method} : undef;
>>> -
>>>      return $self->send_error(ERROR_REQUEST_INVALID)
>>>
>>
>> Have you tried the various options for git to search for smaller
>> diffs? Or using the other diff algorithms such as histogram instead of
>> patience?
>>
>
> The newest version of Git comes with a flag to move around the diff
> better, based on the work at https://github.com/mhagger/diff-slider-tools

Unfortunately in this case, I'm not convinced that it will improve the diff. It's worth a try as well though.

Thanks, Jake

Previous: Stefan BellerNext: KES
Message 4 of 13 in “Feature request: Improve diff algorithm”
  1. KESNov 21, 2016
  2. Jacob KellerNov 21, 2016
  3. Stefan BellerNov 21, 2016
  4. Jacob KellerNov 21, 2016
  5. KESJan 24, 2018
  6. Jacob KellerJan 24, 2018
  7. KESJan 25, 2018
  8. SZEDER GáborJan 25, 2018
  9. SZEDER GáborJan 25, 2018
  10. Junio C HamanoJan 25, 2018
  11. KESJan 27, 2018
  12. Stefan BellerJan 30, 2018
  13. Stefan BellerJan 26, 2018

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.