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

Re: [PATCH] diff --check: use colour

From
APAndy Parkins <andyparkins@gmail.com>
Date
Jan 26, 2007, 16:37 UTC
Message-ID
<200701261637.01199.andyparkins@gmail.com>
In-Reply-To
<17850.8953.478146.754550@lisa.zopyra.com>
On Friday 2007 January 26 15:49, Bill Lear wrote:
> I presume that I send the patch text to the list with the subject line
> that starts with [PATCH], some sensible topic (e.g., "document --check
> option to diff"), and then a short body of explanation and then,
> following my signature, the patch itself.

git-format-patch will make you an email of the correct form. Personally I do this (this is the IMAP server version, but it's similar for mbox)

 * make myself a branch from current master
 * write patch/patches, test (yeah, right ;-))
 * git-format-patch --stdout HEAD^ to check it looks good
 * git-format-patch --stdout HEAD^ | git-imap-send 
 * Go to Drafts mailbox, open it up, add any additional comments for the
   mailing list only underneath the "---" and before the diffstat.  Make sure
   you turn word wrap off as soon as you open the mail.  Word wrapping will
   ruin the patch.
 * Send.
 * Wait for huge feeling of disappointment because your patch is junk and
   gets savaged by the git-gurus (maybe this step is just for me though).

To make this all easy and automatic I also have the following in my .git/config:

[format]
        headers = "To: git@vger.kernel.org\n"
And the following in my ~/.gitconfig:
[imap]
    Folder = "INBOX.Drafts"
    Tunnel = "ssh -q mailhost /usr/bin/imapd ./IMAPmd 2> /dev/null"

And the following in my .git/hooks/commit-msg (make sure you set it executable) to automatically add the "Signed-Off-By" line to your commits:

SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"

I've also enabled the .git/hooks/pre-commit hook (chmod a+x) to make git check my patches before they get committed.

git-format-patch makes git mailing list friendly patches that match the guidelines given in Documentation/SubmittingPatches

Hope that helps.
Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
Previous: Jakub NarebskiNext: Jakub Narebski
Message 18 of 26 in “diff --check: use colour”
  1. diff --check: use colourJohannes Schindelin, Jan 24, 2007
  2. Junio C HamanoJan 24, 2007
  3. Johannes SchindelinJan 25, 2007
  4. Junio C HamanoJan 25, 2007
  5. Bill LearJan 25, 2007
  6. Johannes SchindelinJan 25, 2007
  7. Bill LearJan 26, 2007
  8. Jeff KingJan 26, 2007
  9. Andreas EricssonJan 26, 2007
  10. Andy ParkinsJan 26, 2007
  11. Bill LearJan 26, 2007
  12. Bill LearJan 26, 2007
  13. J. Bruce FieldsJan 26, 2007
  14. Bill LearJan 26, 2007
  15. Bill LearJan 26, 2007
  16. Jeff KingJan 26, 2007
  17. Jakub NarebskiJan 26, 2007
  18. Andy ParkinsJan 26, 2007
  19. Jakub NarebskiJan 26, 2007
  20. Junio C HamanoJan 26, 2007
  21. Johannes SchindelinJan 26, 2007
  22. Junio C HamanoFeb 18, 2007
  23. Johannes SchindelinFeb 18, 2007
  24. Junio C HamanoFeb 18, 2007
  25. Johannes SchindelinFeb 18, 2007
  26. diff --check: use colourJohannes Schindelin, Feb 18, 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.