git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jack Adrian Zappa <adrianh.bsc@gmail.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: git-mailing-list <git@vger.kernel.org>
Subject: Re: Getting an odd diff
Date: Mon, 2 May 2022 14:04:14 -0400	[thread overview]
Message-ID: <CAKepmahchaMVvOoWhnHzeBzKoYEHvmMJgHJ6fNBJ6C8bKMDjrA@mail.gmail.com> (raw)
In-Reply-To: <1c11f705-596f-9e51-8017-2b59cac5f19d@kdbg.org>

On Sat, Apr 30, 2022 at 3:16 AM Johannes Sixt <j6t@kdbg.org> wrote:
> I am a bit reluctant to diagnose what exactly is happening here because
> your word regex is outside the design space. It is definitely not a good
> idea to declare whitespace and even line breaks as part of a word. And
> in fact, when you remove the trailing (\\r\\n?|\\n\\r?)?, you get a more
> sensible word diff:
>
> var result =[-((-] resx.State == ResultState.Succeeded[-) &&-]
> [-string.IsNullOrEmpty(res.ErrorCode) )-] ? (byte)0 : (byte)1;
>
> But if I were you, I would remove all subexpressions that match any form
> of whitespace.

Interesting... IIRC, the reason for the leading and trailing line
breaks in the regex is to stop the diff from messing up the alignment
of multiple edited lines.  I don't remember the exact sequence I was
seeing, but removing them doesn't appear to mess up the alignment so
badly anymore.  Still, I'm surprised that removing that trailing line
break capture would have caused the issue seen here.  For now, I'll
remove the captures and if I see what I was seeing before, I'll report
back to the group.

Thanks,


Jaz

      reply	other threads:[~2022-05-02 18:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 12:33 Getting an odd diff Jack Adrian Zappa
2022-04-30  7:16 ` Johannes Sixt
2022-05-02 18:04   ` Jack Adrian Zappa [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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKepmahchaMVvOoWhnHzeBzKoYEHvmMJgHJ6fNBJ6C8bKMDjrA@mail.gmail.com \
    --to=adrianh.bsc@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).