aboutsummaryrefslogtreecommitdiff
path: root/git-annotate.perl
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-02 01:50:09 -0800
committerJunio C Hamano <junkio@cox.net>2006-03-02 01:50:09 -0800
commitd920e18f53b94389562280c6920bf4e095129ea3 (patch)
tree661eae8f531da401101efccb540c3b524081e34a /git-annotate.perl
parentec579767e719278c4a98a038da41a4cb7344e505 (diff)
downloadgit-d920e18f53b94389562280c6920bf4e095129ea3.tar.gz
git-d920e18f53b94389562280c6920bf4e095129ea3.tar.xz
annotate: resurrect raw timestamps.
For scripted use this is quite useful. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-annotate.perl')
-rwxr-xr-xgit-annotate.perl9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-annotate.perl b/git-annotate.perl
index cd476c762..08d479f4b 100755
--- a/git-annotate.perl
+++ b/git-annotate.perl
@@ -15,6 +15,8 @@ sub usage() {
print STDERR 'Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ]
-l, --long
Show long rev (Defaults off)
+ -t, --time
+ Show raw timestamp (Defaults off)
-r, --rename
Follow renames (Defaults on).
-S, --rev-file revs-file
@@ -26,9 +28,10 @@ sub usage() {
exit(1);
}
-our ($help, $longrev, $rename, $starting_rev, $rev_file) = (0, 0, 1);
+our ($help, $longrev, $rename, $rawtime, $starting_rev, $rev_file) = (0, 0, 1);
my $rc = GetOptions( "long|l" => \$longrev,
+ "time|t" => \$rawtime,
"help|h" => \$help,
"rename|r" => \$rename,
"rev-file|S=s" => \$rev_file);
@@ -411,8 +414,10 @@ sub git_commit_info {
}
sub format_date {
+ if ($rawtime) {
+ return $_[0];
+ }
my ($timestamp, $timezone) = split(' ', $_[0]);
-
return strftime("%Y-%m-%d %H:%M:%S " . $timezone, gmtime($timestamp));
}