-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsccs2git-r.patch
106 lines (100 loc) · 2.51 KB
/
sccs2git-r.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
--- sccs2git-r Sun Aug 17 22:53:41 2014
+++ sccs2git-r-noignore Mon Aug 18 16:38:33 2014
@@ -1,4 +1,4 @@
-#!/pro/bin/perl
+#!/usr/bin/perl
# This is the recursive version of sccs2git
# Combining all SCCS repos to one single git repo
@@ -41,7 +41,9 @@ my $mark;
# use a best guess at user, hostname, etc. FIXME: add authors map :)
use Time::Local;
use Net::Domain;
-my $domain = Net::Domain::hostdomain () || "procura.nl";
+my $domain = "ucbvax.Berkeley.EDU";
+$ENV{TZ} = "US/Pacific";
+POSIX::tzset();
my %tzoffset;
my $tzoffset = sub {
use integer;
@@ -52,6 +54,14 @@ my $tzoffset = sub {
. sprintf "%02d%02d", $off_h, $off_m;
};
+open(my $fh, '<', 'map') or die "could not open 'map' file";
+my %authors = ();
+while (<$fh>) {
+ if ($_ =~ m/([^ ]*) (.*) <.*$/) {
+ $authors{$1} = $2;
+ }
+}
+
# Submit in the same sequence as the original
my %sccs;
my %file;
@@ -94,9 +104,24 @@ foreach my $c (sort keys %sccs) {
printf STDERR "%-20s %3d %6s %s %s %s\n", $fn, $rev, $vsn,
$stamp, $delta{date}, $delta{"time"};
+ my $realname = $delta{committer};
+ if (defined($authors{$delta{committer}})) {
+ $realname = $authors{$delta{committer}};
+ }
+ # bill joy's last commit Wed Dec 10 20:01:30 1980 -0800
+ # bill jolitz's first commit Mon Mar 12 15:47:40 1990 -0800
+ if ($delta{committer} eq "bill") {
+ my @dt = localtime($delta{stamp});
+ if ($dt[5] < 85) {
+ $realname = $authors{wnj};
+ } else {
+ $realname = $authors{william};
+ }
+ }
+
print { $gfi } "commit ", $branchname, "\n";
- print { $gfi } "committer ", $delta{committer},
- " <", $delta{committer}, "@", $domain, "> ",
+ print { $gfi } "committer ", $realname,
+ " <", $delta{committer}, "> ",
$delta{stamp}, " ", $tzoffset->($delta{stamp}), "\n";
# tradition is to save all potentially useful but
@@ -123,44 +148,6 @@ close $gfi;
system "git", "checkout";
system "git", "reset", "--hard";
-
-open my $gi, ">", ".gitignore";
-print $gi <<EOG;
-SCCS
-core
-old
-save
-*.log
-*.out
-*.sv
-*.t[gb]z
-*.zip
-EOG
-
-exists $sccs_ext{as} and print $gi <<EOG;
-*.[af]o
-*.[af]q
-*.al
-*.bk
-*.fa
-*.hz
-EOG
-
-exists $sccs_ext{c} and print $gi <<EOG;
-*.[oa]
-a.out
-EOG
-
-exists $sccs_ext{ic} and print $gi <<EOG;
-*.ec
-*.u
-udir
-EOG
-
-close $gi;
-
-system "git", "add", ".gitignore";
-system "git", "commit", "-m", "Add default ignore list";
@fail and print STDERR join "\n ",
"The following files could not be converted and were skipped:", @fail, "\r";