threads / discuss / 9982

git-send-email is omitting author and date lines

Subject: git-send-email is omitting author and date lines

## tl;dr

9 messages between Sep 23, 2007 and Sep 24, 2007.

replies: 8people: 4as markdown or json

Hanspeter Kunz· Sep 23, 2007, 22:13 UTC · lore
Hi,
sorry if this is a stupid question, but I'm new to git.

When sending a patch to myself using `git-send-email` I realized that the lines containing the author and the date (lines 5 and 6 in the patch file) were not in the sent email.

Is this on purpose? And if so, why?

Thanks, Hp.

Junio C Hamano· Sep 23, 2007, 23:29 UTC · re: Hanspeter Kunz · lore

Re: git-send-email is omitting author and date lines

Hanspeter Kunz <hp@edelkunz.ch> writes:
> When sending a patch to myself using `git-send-email` I realized that
> the lines containing the author and the date (lines 5 and 6 in the patch
> file) were not in the sent email.
Was the commit authored by yourself?
Hanspeter Kunz· Sep 23, 2007, 23:35 UTC · re: Junio C Hamano · lore

Re: git-send-email is omitting author and date lines

On Sun, 2007-09-23 at 16:29 -0700, Junio C Hamano wrote:
Show 7 quoted lines
> Hanspeter Kunz <hp@edelkunz.ch> writes:
> 
> > When sending a patch to myself using `git-send-email` I realized that
> > the lines containing the author and the date (lines 5 and 6 in the patch
> > file) were not in the sent email.
> 
> Was the commit authored by yourself?
yes. does this make a difference?
Johannes Schindelin· Sep 24, 2007, 00:30 UTC · re: Hanspeter Kunz · lore

Re: git-send-email is omitting author and date lines

Hi,
On Mon, 24 Sep 2007, Hanspeter Kunz wrote:
Show 10 quoted lines
> On Sun, 2007-09-23 at 16:29 -0700, Junio C Hamano wrote:
> > Hanspeter Kunz <hp@edelkunz.ch> writes:
> > 
> > > When sending a patch to myself using `git-send-email` I realized that
> > > the lines containing the author and the date (lines 5 and 6 in the patch
> > > file) were not in the sent email.
> > 
> > Was the commit authored by yourself?
> 
> yes. does this make a difference?

Yes, it does. The author is usually inferred from the sender of the mail, and therefore git-send-email strips that information from the message (IIRC).

Hth, Dscho

Hanspeter Kunz· Sep 24, 2007, 07:16 UTC · re: Johannes Schindelin · lore

Re: git-send-email is omitting author and date lines

On Mon, 2007-09-24 at 01:30 +0100, Johannes Schindelin wrote:
Show 18 quoted lines
> Hi,
> 
> On Mon, 24 Sep 2007, Hanspeter Kunz wrote:
> 
> > On Sun, 2007-09-23 at 16:29 -0700, Junio C Hamano wrote:
> > > Hanspeter Kunz <hp@edelkunz.ch> writes:
> > > 
> > > > When sending a patch to myself using `git-send-email` I realized that
> > > > the lines containing the author and the date (lines 5 and 6 in the patch
> > > > file) were not in the sent email.
> > > 
> > > Was the commit authored by yourself?
> > 
> > yes. does this make a difference?
> 
> Yes, it does.  The author is usually inferred from the sender of the mail, 
> and therefore git-send-email strips that information from the message 
> (IIRC).
Ah, I see. And this applies also to the date, I guess.

Many thanks, Hp.

martin f krafft· Sep 24, 2007, 11:08 UTC · re: Junio C Hamano · lore

Re: git-send-email is omitting author and date lines

also sprach Junio C Hamano <gitster@pobox.com> [2007.09.24.0029 +0100]:
> Was the commit authored by yourself?

Sorry for barking in here, but Hanspeter tried to submit a patch to me and that's when this issue arose.

Yes, he is the author of the commit, as in: user.name and user.email are the same for the commit and for the email, and this seems to be the reason the commit header is left out of the email, causing git-am to use the RFC822 From header instead:

  - patch by Jane, email sent From Jane: no separate From header
  - patch by Jane, email sent From Joe: separate From Jane header 

But information *does* get lost, namely the date. If I send a patch by email and it gets merged by the recipient, the date of the commit will be the date of the email, not the date of original commit, or when it was merged.

To be honest, I have no real preference on this, but it just seems strange that out of three dates:

  - original commit
  - email sent
  - commit merged

git-send-email/git-am cause the second to be used, which is the one that makes the *least* sense IMHO.

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
"i dislike arguments of any kind. they are always vulgar, and often
 convincing."
                                                        -- oscar wilde
 
spamtraps: madduck.bogus@madduck.net
Johannes Schindelin· Sep 24, 2007, 11:10 UTC · re: martin f krafft · lore

Re: git-send-email is omitting author and date lines

Hi,
On Mon, 24 Sep 2007, martin f krafft wrote:
> But information *does* get lost, namely the date. If I send a patch
> by email and it gets merged by the recipient, the date of the commit
> will be the date of the email, not the date of original commit, or
> when it was merged.

And that is perfectly okay, since as far as the public is concerned, this is the date of the patch.

Ciao, Dscho

martin f krafft· Sep 24, 2007, 17:30 UTC · re: Johannes Schindelin · lore

Re: git-send-email is omitting author and date lines

also sprach Johannes Schindelin <Johannes.Schindelin@gmx.de> [2007.09.24.1210 +0100]:
> And that is perfectly okay, since as far as the public is
> concerned, this is the date of the patch.
If you say so. I don't find this at all convincing.
-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
"if i am occasionally a little overdressed, i make up for it by being
 always immensely over-educated."
                                                        -- oscar wilde
 
spamtraps: madduck.bogus@madduck.net
Junio C Hamano· Sep 24, 2007, 18:43 UTC · re: martin f krafft · lore

Re: git-send-email is omitting author and date lines

martin f krafft <madduck@madduck.net> writes:
Show 5 quoted lines
> also sprach Johannes Schindelin <Johannes.Schindelin@gmx.de> [2007.09.24.1210 +0100]:
>> And that is perfectly okay, since as far as the public is
>> concerned, this is the date of the patch.
>
> If you say so. I don't find this at all convincing.

I think that is the reasoning for the current behaviour of send-email, but it is not unreasonable to have an option to always add in-body From: and Date: headers to send-email, with a blessing from a recent post from Linus to the kernel mailing list:

	http://article.gmane.org/gmane.linux.kernel/582450

Notice the part he says he appreciates Andrew's practice and talks about message being further forwarded by somebody else.

← back to recent threads