git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Don't add To: recipients to the Cc: header

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 23, 2007, 23:54 UTC
Message-ID
<7vejegsejz.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<87hcjcra10.fsf@osv.gnss.ru>
Sergei Organov <osv@javad.com> writes:
> Yeah, it's one valid interpretation. Here is another one:
> ...
> taken from here: <http://www.answers.com/topic/diff?cat=technology>

Rants about how dangerous GNU patch liberally (mis)interprets a broken patch and git-apply is written deliberately more strict have been repeated on this list, and I would not steal it from Linus in this response.

Show 5 quoted lines
>> The diff editing mode of Emacs, at least the version that caused
>> this issue, however did not make use of that information.
>
> IMHO it's rather useless to argue about it without strict definition of
> correct format of a patch (do you have one?)

Yes. 2004 POSIX does not talk about unified context, but Austin group's SD5-XCU-ERN-103/120 has additions to define unified context and renames the traditional '-c' output to "copied context". Obviously it defines what the numbers on the hunk header lines mean quite precisely. GNU folks even managed to insert text that allows a completely empty line (not a line with a single SP on it) to express a context line that is empty, which means...

Show 6 quoted lines
> 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?

... there is a strong objection, if you are talking about adding an empty line before "-- \n" that is in front of the GIT version signature: such an empty line would not help at all. A broken implementation will just skip over such an empty line, counting it as a line common to both preimage and postimage, and will still miscount the e-mail signature separator "-- \n" as a line removed from the preimage.

Having said that, the _ONLY_ reason I made format-patch end its output with "-- \n" with GIT version was because I wanted to do an informal census of the user community by observing mailing list traffic of projects that use git. The tool has since matured, and census in such a form is not so important anymore.

If we wanted to have a workaround to this issue, we could simply remove these last two lines, and that would a be much better one than an extra blank line. I do not have a strong objection to such a change, but you would need to adjust the tests. The most depressing part of the whole exercise would be to make sure that the adjustments to the tests are correct.

Previous: Sergei OrganovNext: Sergei Organov
Message 11 of 14 in “Don't add To: recipients to the Cc: header”
  1. Don't add To: recipients to the Cc: headerAsk Bjørn Hansen, Nov 19, 2007
  2. Ask Bjørn HansenNov 19, 2007
  3. Junio C HamanoNov 20, 2007
  4. Ask Bjørn HansenNov 20, 2007
  5. Junio C HamanoNov 20, 2007
  6. Sergei OrganovNov 20, 2007
  7. Junio C HamanoNov 20, 2007
  8. Sergei OrganovNov 23, 2007
  9. Junio C HamanoNov 23, 2007
  10. Sergei OrganovNov 23, 2007
  11. Junio C HamanoNov 23, 2007
  12. Sergei OrganovNov 26, 2007
  13. Junio C HamanoNov 26, 2007
  14. Sergei OrganovNov 26, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.