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

Re: [PATCH v2 2/2] format-patch: warn if commit msg contains a patch delimiter

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 9, 2022, 16:47 UTC
Message-ID
<xmqqwnaclck0.fsf@gitster.g>
In-Reply-To
<CAHd-oW4Z-UbFWy=fj=L-CqiG9QP0x3ZLRg0icgK5Xgu=THd4Lw@mail.gmail.com>
Matheus Tavares <matheus.bernardino@usp.br> writes:
> Makes sense. Perhaps under a config option? The difficult part would
> be for the scissors; just indenting it with whitespaces wouldn't
> suffice, right?

It may be difficult not because of any mechanical reasons, but because we cannot guess WHY the author wrote it there in the log in the first place. It could be that the author writes explanatory text that is not to become part of the permanent history at the beginning, place scissors, and follow that with log for posterity, EXPECTING that all of them is output by format-patch and transmit to the receiving end without modified.

Another thing is a three-dash marker line in the log message. I myself did use them to leave a note for myself (which should be left outside the official history when it is sent to the list and then applied), and I would have been upset if it was stripped or the tool even warned against it---I knew what I was doing after all.

Compared to these two, an unindented "diff " and its output in the log has no reason to be pre-recoded in the commit message and make the rest of the message a part of the patch, so I am perfectly fine if we unconditionally "escaped" them. But I personally think scissors and three-dash lines should be left intact.

Previous: Matheus TavaresNext: Matheus Tavares
Message 9 of 13 in “format-patch: warn if commit msg contains a patch delimiter”
  1. format-patch: warn if commit msg contains a patch delimiterMatheus Tavares, Sep 4, 2022
  2. Ævar Arnfjörð BjarmasonSep 5, 2022
  3. René ScharfeSep 5, 2022
  4. 0/2 format-patch: warn if commit msg contains a patch delimiterMatheus Tavares, Sep 7, 2022
  5. 2/2 format-patch: warn if commit msg contains a patch delimiterMatheus Tavares, Sep 7, 2022
  6. Phillip WoodSep 7, 2022
  7. Junio C HamanoSep 7, 2022
  8. Matheus TavaresSep 9, 2022
  9. Junio C HamanoSep 9, 2022
  10. 1/2 patchbreak(), is_scissors_line(): work with a buf/len pairMatheus Tavares, Sep 7, 2022
  11. Phillip WoodSep 7, 2022
  12. Eric SunshineSep 8, 2022
  13. René ScharfeSep 7, 2022

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.