Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
annotate: resurrect raw timestamps.
author
Junio C Hamano
<junkio@cox.net>
Thu, 2 Mar 2006 09:50:09 +0000
(
01:50
-0800)
committer
Junio C Hamano
<junkio@cox.net>
Thu, 2 Mar 2006 09:50:09 +0000
(
01:50
-0800)
For scripted use this is quite useful.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-annotate.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
ec57976
)
diff --git
a/git-annotate.perl
b/git-annotate.perl
index cd476c76297daa9ce99718b429835debd2d76ed1..08d479f4b9b0d4911543ce35714bef13adbb8d20 100755
(executable)
--- a/
git-annotate.perl
+++ b/
git-annotate.perl
@@
-15,6
+15,8
@@
()
print STDERR 'Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ]
-l, --long
Show long rev (Defaults off)
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
-r, --rename
Follow renames (Defaults on).
-S, --rev-file revs-file
@@
-26,9
+28,10
@@
()
exit(1);
}
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,
my $rc = GetOptions( "long|l" => \$longrev,
+ "time|t" => \$rawtime,
"help|h" => \$help,
"rename|r" => \$rename,
"rev-file|S=s" => \$rev_file);
"help|h" => \$help,
"rename|r" => \$rename,
"rev-file|S=s" => \$rev_file);
@@
-411,8
+414,10
@@
sub git_commit_info {
}
sub format_date {
}
sub format_date {
+ if ($rawtime) {
+ return $_[0];
+ }
my ($timestamp, $timezone) = split(' ', $_[0]);
my ($timestamp, $timezone) = split(' ', $_[0]);
-
return strftime("%Y-%m-%d %H:%M:%S " . $timezone, gmtime($timestamp));
}
return strftime("%Y-%m-%d %H:%M:%S " . $timezone, gmtime($timestamp));
}