Bug 486103 - git-send-email adds incorrect CC and corrupts commit message
Summary: git-send-email adds incorrect CC and corrupts commit message
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: git
Version: 10
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Todd Zullinger
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-18 13:07 UTC by Jan Hutař
Modified: 2013-01-10 10:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-02-20 14:01:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jan Hutař 2009-02-18 13:07:24 UTC
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):
git-1.6.0.6-1.fc10.x86_64
git-email-1.6.0.6-1.fc10.x86_64


How reproducible:
always


Steps to Reproduce:
1. see add-comment.diff file I want to submit below
2. # git-send-email --from=jhutar --to=jhutar --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>
RCPT TO:<jhutar>,<Hello,>
From: jhutar
To: jhutar
Cc: Hello,
Subject: Add some comment
Date: Wed, 18 Feb 2009 13:54:38 +0100
Message-Id: <1234961678-13589-1-git-send-email-jhutar>
X-Mailer: git-send-email 1.6.0.6

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 
Hello,

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-19 02:58:54 UTC
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 11:08:20 UTC
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-1.6.0.6/)?

Comment 3 Todd Zullinger 2009-02-20 14:01:58 UTC
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.