My favorites
▼
|
Sign in
gerrit
Gerrit Code Review
Project Home
Downloads
Wiki
Issues
Source
Export to GitHub
New issue
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
1272
attachment: gitlog2asciidoc.pl
(1.4 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/perl
# This script generates a release note in asciidoc format
# The input parameters are <since> and <until> parameters of git log
# Synopsis: gitlog2asciidoc <since> <until>
#
# Example
# input:
# commit 49fe6e31b8ca82cc689990ab78f29a1fc96c5405
# Author: Conley Owens <cco3@android.com>
# Date: Thu Feb 23 10:49:37 2012 -0800
#
# add queryChanges method to QueryProcessor
#
# This change refactors some of the logic in the `query` method of
# Query processor into a `queryChanges` method. This is useful for
# client code that simply wants to read the results instead of writing
# a JSON or otherwise formatted list of data.
#
# Expected Output:
# * add queryChanges method to QueryProcessor
my $prio = shift;
my $curr = shift;
my @changes;
open(I,'-|','git','log','--reverse','--pretty=raw','--no-merges',"$prio..$curr");
while (<I>) {
die "Invalid line: $_" unless /^commit /;
while (<I>) {
chop;
last unless length($_) > 0;
}
my ($subject, $bug);
while (<I>) {
chop;
last unless s/^ {4}//;
if (!defined($subject)) {
$subject = $_;
next;
}
if (/^Bug:\s*(GERRIT-\d+|issue \d+)/) {
$bug = $1;
next;
}
}
push(@changes, [$subject, $bug]);
}
close I;
foreach my $change (@changes) {
my ($subject, $bug) = @$change;
my $s = sprintf "*%s %s",
$bug ? " $bug" : '',
$subject;
$s = substr($s, 0, 69) . "..." if length($s) > 70;
print $s, "\n";
}
Powered by
Google Project Hosting