Bug 486103 - git-send-email adds incorrect CC and corrupts commit message
git-send-email adds incorrect CC and corrupts commit message
Product: Fedora
Classification: Fedora
Component: git (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Todd Zullinger
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-02-18 08:07 EST by Jan Hutař
Modified: 2013-01-10 05:30 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-02-20 09:01:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Hutař 2009-02-18 08:07:24 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):

How reproducible:

Steps to Reproduce:
1. see add-comment.diff file I want to submit below
2. # git-send-email --from=jhutar@redhat.com --to=jhutar@redhat.com --subject="Add some comment" --smtp-server=smtp.corp.redhat.com add-comment.diff

Actual results:
(non-mbox) Adding cc: Hello, from line 'Hello,'
OK. Log says:
Server: smtp.corp.redhat.com
MAIL FROM:<jhutar@redhat.com>
RCPT TO:<jhutar@redhat.com>,<Hello,>
From: jhutar@redhat.com
To: jhutar@redhat.com
Cc: Hello,
Subject: Add some comment
Date: Wed, 18 Feb 2009 13:54:38 +0100
Message-Id: <1234961678-13589-1-git-send-email-jhutar@redhat.com>
X-Mailer: git-send-email

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.

Expected results:
Should send whole diff without modifying CC.

Additional info:
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 */
  * blabla
Comment 1 Todd Zullinger 2009-02-18 21:58:54 EST
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.
Comment 2 Jan Hutař 2009-02-20 06:08:20 EST
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-
Comment 3 Todd Zullinger 2009-02-20 09:01:58 EST
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.

¹ http://git.kernel.org/?p=git/git.git;a=commitdiff;h=c4ba87a6e

Note You need to log in before you can comment on or make changes to this bug.