11# !/usr/bin/perl
22
3+ #
4+ # src/tools/git_changelog
35#
46# Display all commits on active branches, merging together commits from
57# different branches that occur close together in time and with identical
1820# for the portion of the history we imported from CVS, we expect that they
1921# will be.
2022#
21- # Even though we don't use timestamps to order commits, it is used to
23+ # Even though we don't use timestamps to order commits, they are used to
2224# identify which commits happened at about the same time, for the purpose
2325# of matching up commits from different branches.
2426#
@@ -29,9 +31,13 @@ require Date::Calc;
2931require Getopt::Long;
3032require IPC::Open2;
3133
34+ # Adjust this list when the set of active branches changes.
3235my @BRANCHES = qw( master REL9_0_STABLE REL8_4_STABLE REL8_3_STABLE
3336 REL8_2_STABLE REL8_1_STABLE REL8_0_STABLE REL7_4_STABLE) ;
3437
38+ # Might want to make this parameter user-settable.
39+ my $timestamp_slop = 600;
40+
3541my $since ;
3642Getopt::Long::GetOptions(' since=s' => \$since ) || usage();
3743usage() if @ARGV ;
@@ -114,7 +120,7 @@ sub push_commit {
114120 my $ts = parse_datetime($c -> {' date' });
115121 my $cc ;
116122 for my $candidate (@{$all_commits {$ht }}) {
117- if (abs($ts - $candidate -> {' timestamp' }) < 600
123+ if (abs($ts - $candidate -> {' timestamp' }) < $timestamp_slop
118124 && !exists $candidate -> {' branch_position' }{$c -> {' branch' }})
119125 {
120126 $cc = $candidate ;
@@ -149,7 +155,7 @@ sub parse_datetime {
149155
150156sub usage {
151157 print STDERR <<EOM ;
152- Usage: git-topo-order [--since=SINCE]
158+ Usage: git_changelog [--since=SINCE]
153159EOM
154160 exit 1;
155161}
0 commit comments