summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8c7b866)
raw | patch | inline | side by side (parent: 8c7b866)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Mon, 2 May 2005 04:42:53 +0000 (21:42 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Mon, 2 May 2005 04:42:53 +0000 (21:42 -0700) |
Now that git does pretty reliable date parsing, we might as well get
the date from the email itself. Of course, it's still questionable
whether the date on the email is all that relevant, but it's certainly
no worse than taking the commit date.
the date from the email itself. Of course, it's still questionable
whether the date on the email is all that relevant, but it's certainly
no worse than taking the commit date.
applypatch | patch | blob | history | |
mailinfo.c | patch | blob | history |
diff --git a/applypatch b/applypatch
index 97274a158ef9ae7ead580ac7811f44221256d8fa..500720171f0ba29b9e34e2a7049969e00a3cc254 100755 (executable)
--- a/applypatch
+++ b/applypatch
export AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' .dotest/info)"
export AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' .dotest/info)"
+export AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' .dotest/info)"
export SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' .dotest/info)"
if [ -n "$signoff" -a -f "$signoff" ]; then
diff --git a/mailinfo.c b/mailinfo.c
index c1dcac130530174ec5335d2c752d76403ad1d3ad..13c1e951ac2d24cb9ecaeb743406a5318ccd5d9c 100644 (file)
--- a/mailinfo.c
+++ b/mailinfo.c
static FILE *cmitmsg, *patchfile, *filelist;
static char line[1000];
+static char date[1000];
static char name[1000];
static char email[1000];
static char subject[1000];
return 1;
}
+static void handle_date(char *line)
+{
+ strcpy(date, line);
+}
+
static void handle_subject(char *line)
{
strcpy(subject, line);
cont = 0;
return;
}
+ if (!memcmp(line, "Date:", 5) && isspace(line[5])) {
+ handle_date(line+6);
+ cont = 0;
+ return;
+ }
if (!memcmp(line, "Subject:", 8) && isspace(line[8])) {
handle_subject(line+9);
cont = 1;
if (isspace(*line)) {
switch (cont) {
case 0:
- fprintf(stderr, "I don't do 'From:' line continuations\n");
+ fprintf(stderr, "I don't do 'Date:' or 'From:' line continuations\n");
break;
case 1:
add_subject_line(line);
{
char *sub = cleanup_subject(subject);
cleanup_space(name);
+ cleanup_space(date);
cleanup_space(email);
cleanup_space(sub);
- printf("Author: %s\nEmail: %s\nSubject: %s\n\n", name, email, sub);
+ printf("Author: %s\nEmail: %s\nSubject: %s\nDate: %s\n\n", name, email, sub, date);
FILE *out = cmitmsg;
do {