Re: [RFC] format-patch: Ensure that author and commit time are not lost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Björn Gustavsson <bgustavsson@xxxxxxxxx> writes:

> 'git format-patch' encodes the author of the commit in the From: header
> and the time of the commit in the Date: header.  Depending on how the
> email is sent, however, those headers can be lost before the email
> reaches its destination.
>
> Therefore, if the sender of the email (i.e. the configuration options
> user.name and user.email) are different from the author of a commit,
> insert From: and Date: headers at the beginning of the body of the
> commit message.

I think you are addressing a very valid issue, but I suspect that you are
doing so at a wrong place in the "patch mail-out" workflow.

> +static int sender_is_not_author(const char *message)
> +{
> +	const char **msg_p = &message;
> +
> +	for (;;) {
> ...
> +	}
> +}

This new function is not about "Is the _sender_ the same as the author?",
but is about "Is the person who is running format-patch the same as the
author?".  There is a big difference.

What you want to catch is really "Does the MUA that sends out the final
message have the name of the author on its 'From: ' header?", and that 
depends on how the output from format-patch command is processed in the
downstream of the workflow.

You may read the file into your MUA edit session.  You would typically
edit the first three lines out and move Subject: to the MUA's subject line.
You can choose to keep From:/Date: when you do so.  This happens to be the
way I work, by the way.

The output may not even be used by a MUA; you may upload it to web based
thingy like Bugzilla or FrySpray.  The recipient will download the whole
thing and there is no need to edit.

I would expect the right solution would be to give send-email an ability
to either (1) use "Sender:" to record the operator of the MUA while
keeping "From: " taken from the payload, or (2) duplicate "From: " as an
in-body header when it sends out.

It is a separate issue if that ability should be on by default or
controlled by an option, of course.  But I do not think it should be in
the format-patch.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]