summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 991ea94)
raw | patch | inline | side by side (parent: 991ea94)
author | Simon Gerber <simugerber@student.ethz.ch> | |
Wed, 14 Apr 2010 13:00:57 +0000 (15:00 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 19 Apr 2010 00:53:30 +0000 (20:53 -0400) |
[ jf: updated documentation and added NEWS entry ]
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
NEWS | patch | blob | history | |
manual.txt | patch | blob | history | |
tig.c | patch | blob | history | |
tigrc.5.txt | patch | blob | history |
index 815f246ee897cdab99db03a0c43fb18f2aeed043..b3eeb497a9ab2262817b2927edd8398e94fb3ae4 100644 (file)
--- a/NEWS
+++ b/NEWS
flag).
- Abbreviation of author names can now be configured and toggled.
- Mark detached heads with [HEAD].
flag).
- Abbreviation of author names can now be configured and toggled.
- Mark detached heads with [HEAD].
+ - Add support for displaying dates in local time.
Bug fixes:
Bug fixes:
diff --git a/manual.txt b/manual.txt
index cfc26c67840b68d5054767f2b12a11375a228cb3..41d9bf9797e0f7d12e69decf638cef30ed0a4d2d 100644 (file)
--- a/manual.txt
+++ b/manual.txt
|v |Show version.
|o |Open option menu
|. |Toggle line numbers on/off.
|v |Show version.
|o |Open option menu
|. |Toggle line numbers on/off.
-|D |Toggle date display on/off/relative.
+|D |Toggle date display on/off/short/relative/local.
|A |Toggle author display on/off/abbreviated.
|g |Toggle revision graph visualization on/off.
|F |Toggle reference display on/off (tag and branch names).
|A |Toggle author display on/off/abbreviated.
|g |Toggle revision graph visualization on/off.
|F |Toggle reference display on/off (tag and branch names).
index 05379fbc4d59bba134ad9c893b167423d02be460..7cdd3eaa3371202ed2016eec4cb2e9ec03545295 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -519,6 +519,7 @@ utf8_length(const char **start, size_t skip, int *width, size_t max_width, int *
#define DATE_INFO \
DATE_(NO), \
DATE_(DEFAULT), \
#define DATE_INFO \
DATE_(NO), \
DATE_(DEFAULT), \
+ DATE_(LOCAL), \
DATE_(RELATIVE), \
DATE_(SHORT)
DATE_(RELATIVE), \
DATE_(SHORT)
}
}
}
}
- gmtime_r(&time->sec, &tm);
+ if (date == DATE_LOCAL) {
+ time_t date = time->sec + time->tz;
+ localtime_r(&date, &tm);
+ }
+ else {
+ gmtime_r(&time->sec, &tm);
+ }
return strftime(buf, sizeof(buf), DATE_FORMAT, &tm) ? buf : NULL;
}
return strftime(buf, sizeof(buf), DATE_FORMAT, &tm) ? buf : NULL;
}
diff --git a/tigrc.5.txt b/tigrc.5.txt
index ef93d27bef930806a8bba18088e3d4942a66eaec..c54adec5c395868be40b956d3e28e74f44f81b01 100644 (file)
--- a/tigrc.5.txt
+++ b/tigrc.5.txt
How to display author names. If set to "abbreviated" author initials
will be shown. Can be toggled.
How to display author names. If set to "abbreviated" author initials
will be shown. Can be toggled.
-'show-date' (mixed) ["relative" | "short" | "default" | bool]::
+'show-date' (mixed) ["relative" | "short" | "default" | "local" | bool]::
Whether and how to show date. If set to "relative" a relative date will be
used, e.g. "2 minutes ago". If set to "short" no time information is
Whether and how to show date. If set to "relative" a relative date will be
used, e.g. "2 minutes ago". If set to "short" no time information is
- shown. Can be toggled.
+ shown. If set to "local", localtime(3) is used. Can be toggled.
'author-width' (int)::
'author-width' (int)::