Re: strange date generated by git-format-patch

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

 



Hi,

On Fri, 23 Feb 2007, Junio C Hamano wrote:

> "johan defries" <johandefries@xxxxxxxxx> writes:
> 
> > When I do
> >
> > #git-format-patch --stdout HEAD^|head -1 | grep --color "Mon Sep 17
> > 00:00:00 2001"
> >
> > I really get a hit. "Sept 17 2001"?? It's strange, because the
> > repository is so much younger.
> 
> That is just a fake random date to make the Unix-From line recognizable 
> by common MUA and does not have anything to do with your commit objects.

So how about this:
-- snipsnap --
[PATCH] pretty=email: use current date for "From <sha1>" lines

To keep MUAs happy, we have to provide a date in mbox files. These
dates are supposed to mark the date of arrival, so take "now"
instead of some made-up date.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@xxxxxx>
---
 log-tree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/log-tree.c b/log-tree.c
index ac86194..b6e1ad2 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -174,7 +174,7 @@ void show_log(struct rev_info *opt, const char *sep)
 		else
 			subject = "Subject: ";
 
-		printf("From %s Mon Sep 17 00:00:00 2001\n", sha1);
+		printf("From %s %s\n", sha1, show_date(time(NULL), 0, 0));
 		if (opt->message_id)
 			printf("Message-Id: <%s>\n", opt->message_id);
 		if (opt->ref_message_id)
-
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]