Skip to content

Commit

Permalink
annotate: resurrect raw timestamps.
Browse files Browse the repository at this point in the history
For scripted use this is quite useful.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Mar 2, 2006
1 parent ec57976 commit d920e18
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions git-annotate.perl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ()
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
Expand All @@ -26,9 +28,10 @@ ()
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);
Expand Down Expand Up @@ -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));
}

Expand Down

0 comments on commit d920e18

Please sign in to comment.