From: Sergei Organov <osv@javad.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Ask Bjørn Hansen" <ask@develooper.com>, git@vger.kernel.org
Subject: Re: [PATCH] Don't add To: recipients to the Cc: header
Date: Fri, 23 Nov 2007 23:18:03 +0300 [thread overview]
Message-ID: <87hcjcra10.fsf@osv.gnss.ru> (raw)
In-Reply-To: <7vejegu4in.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Fri\, 23 Nov 2007 11\:48\:48 -0800")
Junio C Hamano <gitster@pobox.com> writes:
> Sergei Organov <osv@javad.com> writes:
>
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>>> Sergei Organov <osv@javad.com> writes:
>>>
>>>> Junio C Hamano <gitster@pobox.com> writes:
>>>> [...]
>>>>> Oops, forgot to say "no need to resend". I asked only because I
>>>>> wanted an independent datapoint for Emacs diff mode breakage.
>>>>
>>>> I bet I can damage any patch using any editor ;)
>>>>
>>>> More interesting is what version of Emacs it was?
>>>
>>> To be fair and honest, I do not think there is a simple fix for
>>> this, although it probably is possible to fix it.
>>>
>>> What is causing the "breakage" is the fact that format-patch
>>> output ends with the signature delimiter line "^-- $" that
>>> immediately follows the patch text.
>>
>> Exactly. What causes breakage is the fact that the '-' character (as
>> well as '+', ' ', '!', '#', and '\'), being the first symbol of a line
>> has special meaning in the diff format.
>
> That is correct only if they appear inside a hunk. The number
> of preimage and postimage lines in a hunk is recorded on the
> hunk header line --- tools are given enough information to tell
> a line that begins with a SP (or '+' or '-') outside a patch
> from another such line that is inside the patch.
Yeah, it's one valid interpretation. Here is another one:
"The chunk range for the original should be the sum of all contextual
and deletion (including changed) chunk lines. The chunk range for the
new file should be a sum of all contextual and addition (including
changed) chunk lines. If chunk size information does not correspond
with the number of lines in the hunk, then the diff could be
considered invalid and be rejected."
taken from here: <http://www.answers.com/topic/diff?cat=technology>
The above implies that a tool should be able to determine the "end of
hunk" without using the hunk header information. This is rather hard to
do with current format-patch output, and it's impossible to do if there
are no "unchanged context" lines at all (i.e., format-patch -U0).
> The diff editing mode of Emacs, at least the version that caused
> this issue, however did not make use of that information.
> That's the breakage. Not format-patch output.
IMHO it's rather useless to argue about it without strict definition of
correct format of a patch (do you have one?). However, it's easy to add
an empty line for format-patch and very difficult, if not impossible,
for Emacs to handle this without such a line.
Therefore I repeat my question: are there any objections to add such an
empty line by format-patch?
--
Sergei.
next prev parent reply other threads:[~2007-11-23 20:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 11:00 [PATCH] Don't add To: recipients to the Cc: header Ask Bjørn Hansen
2007-11-19 11:05 ` Ask Bjørn Hansen
2007-11-20 7:52 ` Junio C Hamano
2007-11-20 9:36 ` Ask Bjørn Hansen
2007-11-20 19:04 ` Junio C Hamano
2007-11-20 19:18 ` Sergei Organov
2007-11-20 20:21 ` Junio C Hamano
2007-11-23 17:53 ` Sergei Organov
2007-11-23 19:48 ` Junio C Hamano
2007-11-23 20:18 ` Sergei Organov [this message]
2007-11-23 23:54 ` Junio C Hamano
2007-11-26 13:48 ` Sergei Organov
2007-11-26 16:53 ` Junio C Hamano
2007-11-26 18:29 ` Sergei Organov
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=87hcjcra10.fsf@osv.gnss.ru \
--to=osv@javad.com \
--cc=ask@develooper.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.