annotate: resurrect raw timestamps.
For scripted use this is quite useful. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Mar 2, 2006 at 01:50 UTC
d920e18f53b94389562280c6920bf4e095129ea3
1 file changed
+7
-2
git-annotate.perl
+7
-2
@@ -15,6 +15,8 @@ sub usage() {
15
print STDERR 'Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ]
16
-l, --long
17
Show long rev (Defaults off)
18
+ -t, --time
19
+ Show raw timestamp (Defaults off)
20
-r, --rename
21
Follow renames (Defaults on).
22
-S, --rev-file revs-file
@@ -26,9 +28,10 @@ sub usage() {
28
exit(1);
29
}
30
29
-our ($help, $longrev, $rename, $starting_rev, $rev_file) = (0, 0, 1);
31
+our ($help, $longrev, $rename, $rawtime, $starting_rev, $rev_file) = (0, 0, 1);
32
33
my $rc = GetOptions( "long|l" => \$longrev,
34
+ "time|t" => \$rawtime,
35
"help|h" => \$help,
36
"rename|r" => \$rename,
37
"rev-file|S=s" => \$rev_file);
@@ -411,8 +414,10 @@ sub git_commit_info {
414
}
415
416
sub format_date {
417
+ if ($rawtime) {
418
+ return $_[0];
419
+ }
420
my ($timestamp, $timezone) = split(' ', $_[0]);
415
-
421
return strftime("%Y-%m-%d %H:%M:%S " . $timezone, gmtime($timestamp));
422
}
423