1
1
# !/usr/bin/perl
2
2
3
+ #
4
+ # src/tools/git_changelog
3
5
#
4
6
# Display all commits on active branches, merging together commits from
5
7
# different branches that occur close together in time and with identical
18
20
# for the portion of the history we imported from CVS, we expect that they
19
21
# will be.
20
22
#
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
22
24
# identify which commits happened at about the same time, for the purpose
23
25
# of matching up commits from different branches.
24
26
#
@@ -29,9 +31,13 @@ require Date::Calc;
29
31
require Getopt::Long;
30
32
require IPC::Open2;
31
33
34
+ # Adjust this list when the set of active branches changes.
32
35
my @BRANCHES = qw( master REL9_0_STABLE REL8_4_STABLE REL8_3_STABLE
33
36
REL8_2_STABLE REL8_1_STABLE REL8_0_STABLE REL7_4_STABLE) ;
34
37
38
+ # Might want to make this parameter user-settable.
39
+ my $timestamp_slop = 600;
40
+
35
41
my $since ;
36
42
Getopt::Long::GetOptions(' since=s' => \$since ) || usage();
37
43
usage() if @ARGV ;
@@ -114,7 +120,7 @@ sub push_commit {
114
120
my $ts = parse_datetime($c -> {' date' });
115
121
my $cc ;
116
122
for my $candidate (@{$all_commits {$ht }}) {
117
- if (abs($ts - $candidate -> {' timestamp' }) < 600
123
+ if (abs($ts - $candidate -> {' timestamp' }) < $timestamp_slop
118
124
&& !exists $candidate -> {' branch_position' }{$c -> {' branch' }})
119
125
{
120
126
$cc = $candidate ;
@@ -149,7 +155,7 @@ sub parse_datetime {
149
155
150
156
sub usage {
151
157
print STDERR <<EOM ;
152
- Usage: git-topo-order [--since=SINCE]
158
+ Usage: git_changelog [--since=SINCE]
153
159
EOM
154
160
exit 1;
155
161
}
0 commit comments