-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitdot
More file actions
executable file
·41 lines (37 loc) · 1.13 KB
/
gitdot
File metadata and controls
executable file
·41 lines (37 loc) · 1.13 KB
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
#!/usr/bin/perl
print "digraph {\n";
print " node [shape=box];\n";
print " rankdir=TB;\n";
@lines = `git log --all --pretty=format:"%h:%p:%an" @ARGV`;
foreach $line (@lines) {
$line =~ s/\r|\n//g;
($commit, $parents, $author) = split(/:/, $line);
print " \"$commit\" [label=\"$commit\\n$author\"];\n";
@parents = split(/ /, $parents);
foreach $parent (@parents) {
$parent = "none" if ($parent eq "");
print " \"$commit\" -> \"$parent\";\n";
}
}
@lines = `git tag`;
foreach $tag (@lines) {
$tag =~ s/\r|\n//g;
@morelines = `git log -1 $tag --pretty=format:"%h:%an" @ARGV`;
foreach $commit (@morelines) {
$commit =~ s/\r|\n//g;
($commit, $author) = split(/:/, $commit);
print " \"$commit\" [label=\"$tag\\n$author\"];\n";
}
}
@lines = `git branch -a`;
foreach $tag (@lines) {
$tag =~ m/^..(.*)(\r|\n)/;
$tag = $1;
@morelines = `git log -1 $tag --pretty=format:"%h:%an" @ARGV`;
foreach $commit (@morelines) {
$commit =~ s/\r|\n//g;
($commit, $author) = split(/:/, $commit);
print " \"$commit\" [label=\"$tag\\n$author\"];\n";
}
}
print "}\n";