git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
Cc: <git@vger.kernel.org>
Subject: Re: Antw: [EXT] Re: Help understanding unexpected diff output
Date: Tue, 14 Jul 2020 11:53:43 -0700	[thread overview]
Message-ID: <xmqqr1tekjwo.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <5F0D7252020000A10003A03E@gwsmtp.uni-regensburg.de> (Ulrich Windl's message of "Tue, 14 Jul 2020 10:52:34 +0200")

"Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de> writes:

>> I would imagine that the answer would still be a very similar looking
>> 
>>     ‑‑‑ a/0/...
>>     +++ b/0/...
>>     @@ ‑5,12 +5,6 @@
>>      olcDatabase: {1}hdb
>>      olcDbDirectory: /var/lib/ldap
>>      olcSuffix: dc=... 
>>     ‑olcAccess: {0} ...
>>     ‑olcAccess: {1} ...
>>     ‑olcAccess: {2} ...
>>     ‑olcAccess: {3} ...
>>     ‑olcAccess: {4} ...
>>     ‑olcAccess: {5} ...
>>     olcLimits: {0}dn.exact=....
>>      olcRootDn: cn=Admin,dc=...
>>      olcRootPW: {SSHA}yZ...
>>     @@ ‑52,6 +46,12 @@
>>      entryUUID: ...
>>      creatorsName: cn=config
>>      createTimestamp: ...
>>     ‑entryCSN: ...
>>     +olcAccess: {0} ...
>>     +olcAccess: {1} ...
>>     +olcAccess: {2} ...
>>     +olcAccess: {3} ...
>>     +olcAccess: {4} ...
>>     +olcAccess: {5} ...
>>     +entryCSN: ...
>>      modifiersName: cn=config
>>     ‑modifyTimestamp: ...
>>     +modifyTimestamp: ...
>> 
>> with identical "olcAccess: {$n}" lines removed from earlier part the
>> file and added to the end of the file.
>> 
>> So I am not sure what you are asking.  It would not be correct to show
>> something like
>
> According to my eyes (just using Emacs to make sure) those olcAccess lines
> "numbered" 0 to 3, and 5 should be "context lines" as they are not changed.

And the "slightly different" example I asked you about has {4} in
both blocks identical, you are arguing that these 6 lines all should
appear as context?

It certainly is possible but then the patch would look quite
different.  As "olcAccess: {0}" line in the preimage (i.e. a/)
appears at line 8, but that same line appears in the postimage
(i.e. b/) at line 49, such a patch that match these two olcAccess
blocks as unchanged MUST delete many lines that come after
"olcAccess: {5}" in the preimage (i.e. starting at line 14 with
olcLimits, line ending at entryCSN: at line 55 must be removed,
because they used to appear immediately after "olcAccess: {5}" in
the preimage a/, but in the postimage b/, none of tme appear after
the "olcAccess: {5}" that you claim to be common and unchanged (in
the postimage, instead you have only four lines that has"entryCSN:",
"modiferName", etc. before the end of the file).

Of course, these lines in the line range 14-55 actually are the ones
that did not change, as we can see above, so if you insist that you
must keep the 6-line "olcAccess" block as common and unchanged,
because your desired patch is deleting them from the pre-image after
"olcAccess: {5}" line, your desired patch must be adding them back
to the postimage somewhere (namely, before "olcAccess: {0}" line).

Such a patch is also a valid one in that it expresses the difference
between a/ and b/ in terms of a sequence of "delete these lines from
here" and "insert these lines to here", but it would be far less
interesting than what we see above.  Instead of "we deleted 6 lines
near the beginning of the file" plus "then added 6 lines near the
end--ah, these 6 lines by the way are identical", you would instead
say "we deleted the block of lines 14-55 that appear immediately
after olcAccess:{5}" plus "we inserted the identical block of lines
immediately before olcAccess{0}".  And you'd complain in the
opposite way: "These lines are identical but appear in different
locations in the preimage and the postimage -- why aren't they shown
as context lines?"

  reply	other threads:[~2020-07-14 19:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 10:34 Help understanding unexpected diff output Ulrich Windl
2020-07-13 15:12 ` Junio C Hamano
2020-07-14  8:52   ` Antw: [EXT] " Ulrich Windl
2020-07-14 18:53     ` Junio C Hamano [this message]
2020-10-23 14:24     ` Philip Oakley

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=xmqqr1tekjwo.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Ulrich.Windl@rz.uni-regensburg.de \
    --cc=git@vger.kernel.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.
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 NNTP newsgroup(s).