File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,18 @@ static int bisect_list = 0;
4040static int verbose_header = 0 ;
4141static int abbrev = DEFAULT_ABBREV ;
4242static int show_parents = 0 ;
43+ static int show_timestamp = 0 ;
4344static int hdr_termination = 0 ;
4445static const char * commit_prefix = "" ;
4546static enum cmit_fmt commit_format = CMIT_FMT_RAW ;
4647
4748static void show_commit (struct commit * commit )
4849{
49- printf ("%s%s" , commit_prefix , sha1_to_hex (commit -> object .sha1 ));
50+ if (show_timestamp )
51+ printf ("%lu " , commit -> date );
52+ if (commit_prefix [0 ])
53+ fputs (commit_prefix , stdout );
54+ fputs (sha1_to_hex (commit -> object .sha1 ), stdout );
5055 if (show_parents ) {
5156 struct commit_list * parents = commit -> parents ;
5257 while (parents ) {
@@ -335,6 +340,10 @@ int main(int argc, const char **argv)
335340 show_parents = 1 ;
336341 continue ;
337342 }
343+ if (!strcmp (arg , "--timestamp" )) {
344+ show_timestamp = 1 ;
345+ continue ;
346+ }
338347 if (!strcmp (arg , "--bisect" )) {
339348 bisect_list = 1 ;
340349 continue ;
You can’t perform that action at this time.
0 commit comments