From: Junio C Hamano <gitster@pobox.com>
To: Sergei Organov <osv@javad.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: Tue, 20 Nov 2007 12:21:24 -0800 [thread overview]
Message-ID: <7vr6ikk6rf.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <87ejekzpx3.fsf@osv.gnss.ru> (Sergei Organov's message of "Tue, 20 Nov 2007 22:18:32 +0300")
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. The number of preimage
lines recorded in the hunk header of course does not initially
count it, but you are asking the diff editing mode to help you
edit the patch.
In diff editing mode, you can not only edit the contents of
postimage lines, but also add and delete the preimage and
postimage lines, and the diff editimg mode recounts the lines
and adjusts the number of lines recorded in the hunk header when
you do it. It is very handy if it worked reliably (and often
it does).
But if you edit the last hunk of the format-patch output, unless
the editor very carefully keeps track of what you edited and
what was in the original, it is understandable that it would
mistake the signature delimiter line as the last preimage line
that is "^- $", and ends up miscounting the length of the hunk.
The signature delimiter was there from the beginning in the
patch file, but outside of the hunk in question. We could argue
that it is a bug to mistake that as a preimage line added by the
user (after all the editor knows what was modified and what was
from the beginning), but it still is understandable.
next prev parent reply other threads:[~2007-11-20 20:21 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 [this message]
2007-11-23 17:53 ` Sergei Organov
2007-11-23 19:48 ` Junio C Hamano
2007-11-23 20:18 ` Sergei Organov
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=7vr6ikk6rf.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=ask@develooper.com \
--cc=git@vger.kernel.org \
--cc=osv@javad.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 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).