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

Re: [RFC] gitweb.perl t9500 t9501

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 23, 2009, 02:09 UTC
Message-ID
<7v3a7j2scq.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4C812C4E-815B-478D-AEB1-3F1DEC5D3641@mailservices.uwaterloo.ca>
Mark A Rada <marada@uwaterloo.ca> writes:
> I have not been telling git-format-patch to use a specific width for
> the diffstat, is the standard width supposed to be 70?
Perhaps there is some misconception here.

We try to keep our _code_ to fit in standard 80-column terminal. We also keep lines in the _log message_ shorter than 70-something so that after indentation by various programs (e.g. shortlog) and a few levels of quoting in the e-mail are added, the lines will still stay below 80-columns. These are standard practices.

And you may need to find a good place to break lines in your _code_, and your _log message_, to stay below that limit.

But that all happens inside your editor, before you touch format-patch nor your MUA.

The patch contents may contain long lines, such as
    diff --git a/filename-that-is-long b/filename-that-is-long
or
    @@ -old,lines +new,lines @@ original contents that is long

that is neither _code_ nor _log message_. They could easily go beyond 80-column, but that is normal, and they do not have any 70-column limit for you to worry about. They follow a different rule, namely, if format-patch (or "diff" in general) outputs something on a single line, that has to stay on a single line. "patch" expects each of these on a single line. Do not break them.

So make sure that you do not let your MUA perform any line-wrapping at random place in the message after you formatted your commits via format-patch, and you will be Ok.

Previous: Mark A RadaNext: Mark A Rada
Message 8 of 10 in “What's cooking in git.git (Aug 2009, #03; Thu, 20)”
  1. Junio C HamanoAug 21, 2009
  2. Paolo BonziniAug 21, 2009
  3. Junio C HamanoAug 21, 2009
  4. Mark A RadaAug 21, 2009
  5. Jakub NarebskiAug 21, 2009
  6. Junio C HamanoAug 21, 2009
  7. [RFC] gitweb.perl t9500 t9501Mark A Rada, Aug 22, 2009
  8. Junio C HamanoAug 23, 2009
  9. Mark A RadaAug 23, 2009
  10. Junio C HamanoAug 21, 2009

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.