From: Sergey Organov <sorganov@gmail•com>
To: Junio C Hamano <gitster@pobox•com>
Cc: git@vger•kernel.org, Michael Haggerty <mhagger@alum•mit.edu>
Subject: Re: "git diff" surprising default output
Date: Wed, 01 Mar 2023 23:28:43 +0300 [thread overview]
Message-ID: <87sfeo2p38.fsf@osv.gnss.ru> (raw)
In-Reply-To: <xmqqzg8wmfa6.fsf@gitster.g> (Junio C. Hamano's message of "Wed, 01 Mar 2023 11:40:17 -0800")
Junio C Hamano <gitster@pobox•com> writes:
> Sergey Organov <sorganov@gmail•com> writes:
>
>> I figured the offender is --indent-heuristic that is described in the
>> manual as:
>>
>> Enable the heuristic that shifts diff hunk boundaries to make
>> patches easier to read. This is the default.
>>
>> but apparently rather makes patches harder to read, at least at some
>> conditions. Turning it off helps to get the expected result:
>
> As a heuristic, it is not surprising that it has some corner cases
> where it does not shine. I think the version that was eventually
> merged starts here
>
> https://lore.kernel.org/git/cover.1473068229.git.mhagger@alum.mit.edu/
>
> and we should be able to find a few links to the original
> observation that motivated the change, e.g.
>
> https://public-inbox.org/git/cover.1470259583.git.mhagger@alum.mit.edu/
Thanks a lot for the references!
From what I briefly read there it apparently follows that it'd shine at
regular C code, yet won't shine at preprocessor directives that are
usually out of regular alignment.
It'd be nice to improve this, but I'm not sure it's a simple thing to
fix, or even at all possible, though maybe it'd help to somehow favoring
chunks that start and end at the same alignment?
Or maybe it's just plain bug in the implementation?
Thanks,
-- Sergey Organov
prev parent reply other threads:[~2023-03-01 20:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-01 18:25 "git diff" surprising default output Sergey Organov
2023-03-01 19:40 ` Junio C Hamano
2023-03-01 20:28 ` Sergey Organov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sfeo2p38.fsf@osv.gnss.ru \
--to=sorganov@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=mhagger@alum$(echo .)mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox