Red Hat Bugzilla – Bug 486103
git-send-email adds incorrect CC and corrupts commit message
Last modified: 2013-01-10 05:30:30 EST
Description of problem:
I have generated a patch and would like to send it using git-send-email, but git-send-email incorrectly parses my *.diff.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. see add-comment.diff file I want to submit below
2. # git-send-email --firstname.lastname@example.org --email@example.com --subject="Add some comment" --smtp-server=smtp.corp.redhat.com add-comment.diff
(non-mbox) Adding cc: Hello, from line 'Hello,'
OK. Log says:
Subject: Add some comment
Date: Wed, 18 Feb 2009 13:54:38 +0100
X-Mailer: git-send-email 126.96.36.199
Result: 250 2.0.0 n1ICschF002417 Message accepted for delivery
And there is missing first row of my message in the resulting email. Also please note that "Hello," string in the CC and RCPT TO.
Should send whole diff without modifying CC.
Maybe I'm doing something wrong, but man-page just says it should be "file|directory..." - I have found '--cc-cmd' option, but do not know how to use it to turn this off.
$ cat add-comment.diff
this is some patch...
And here goes some comment.
And here goes another comment.
diff -up ./api.c.orig ./api.c
--- ./api.c.orig 2009-02-16 10:55:07.000000000 +0100
+++ ./api.c 2009-02-16 10:58:28.000000000 +0100
@@ -48,6 +48,15 @@
#define VERSION(ver) #ver
+/* added X */
This should probably be in the git-send-email manpage, but there are two formats for the files accepted. As stated at the top of the git-send-email script:
# 1. mbox format files (ignoring most headers and MIME formatting - this is designed for sending patches)
# 2. The original format support by Greg's script:
# first line of the message is who to CC,
# and second line is the subject of the message.
So, in your case, send-email finds that the file is not in mbox format, and tries to use the second format. As your file starts with "Hello," this is used as the Cc.
I'll try to work up a documentation patch to clarify this and submit upstream.
I see, thank you - I can do the patch if you want. Is editing man page enough (I see other docs in /usr/share/doc/git-email-188.8.131.52/)?
No need, I whipped one up the other night and Junio applied it to git¹. This will filter back to Fedora at least for rawhide and F11. I don't know that it's worth carrying a patch for git-1.6.0.x in F10 for or not. If you think it is, please re-open.