diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-08-03 21:01:27 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-03 21:01:27 +0300 |
commit | d939af12bd96db7ad3e671a0585ad8570aa7e9d3 (patch) | |
tree | 5772ac1192ed299db657ffcfbc71c318521db653 /ref-filter.c | |
parent | 980a3d3dd742d534b394b04e578c2de5e3ee4793 (diff) | |
parent | e4f031e34b08e3217c10942e682920a6939308a0 (diff) |
Merge branch 'jk/date-mode-format'
Teach "git log" and friends a new "--date=format:..." option to
format timestamps using system's strftime(3).
* jk/date-mode-format:
strbuf: make strbuf_addftime more robust
introduce "format" date-mode
convert "enum date_mode" into a struct
show-branch: use DATE_RELATIVE instead of magic number
Diffstat (limited to 'ref-filter.c')
-rw-r--r-- | ref-filter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ref-filter.c b/ref-filter.c index 6e09da88ca..f38dee4f60 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -362,7 +362,7 @@ static void grab_date(const char *buf, struct atom_value *v, const char *atomnam char *zone; unsigned long timestamp; long tz; - enum date_mode date_mode = DATE_NORMAL; + struct date_mode date_mode = { DATE_NORMAL }; const char *formatp; /* @@ -374,7 +374,7 @@ static void grab_date(const char *buf, struct atom_value *v, const char *atomnam formatp = strchr(atomname, ':'); if (formatp != NULL) { formatp++; - date_mode = parse_date_format(formatp); + parse_date_format(formatp, &date_mode); } if (!eoemail) @@ -385,7 +385,7 @@ static void grab_date(const char *buf, struct atom_value *v, const char *atomnam tz = strtol(zone, NULL, 10); if ((tz == LONG_MIN || tz == LONG_MAX) && errno == ERANGE) goto bad; - v->s = xstrdup(show_date(timestamp, tz, date_mode)); + v->s = xstrdup(show_date(timestamp, tz, &date_mode)); v->ul = timestamp; return; bad: |