forked from Airblader/i3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep each release note in a single file
To avoid annoying merge conflicts. Perl script is provided for convenience and simple format checking in PRs.
- Loading branch information
Showing
6 changed files
with
103 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fix crash with "layout default" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Acquire the WM_Sn selection when starting as required by ICCCM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
use v5.10; | ||
use Getopt::Long; | ||
|
||
my @template = ( | ||
' | ||
┌──────────────────────────────┐ | ||
│ Release notes for i3 v4.21 │ | ||
└──────────────────────────────┘ | ||
This is i3 v4.21. This version is considered stable. All users of i3 are | ||
strongly encouraged to upgrade. | ||
┌────────────────────────────┐ | ||
│ Changes in i3 v4.21 │ | ||
└────────────────────────────┘ | ||
', | ||
' | ||
┌────────────────────────────┐ | ||
│ Bugfixes │ | ||
└────────────────────────────┘ | ||
'); | ||
|
||
my $print_urls = 0; | ||
my $result = GetOptions('print-urls' => \$print_urls); | ||
|
||
sub read_changefiles { | ||
my $dirpath = shift; | ||
opendir my $dir, $dirpath or die "Cannot open directory $dirpath: $!"; | ||
my @files = readdir $dir; | ||
closedir $dir; | ||
|
||
my $s = ''; | ||
for my $filename (@files) { | ||
next if $filename eq '.'; | ||
next if $filename eq '..'; | ||
next if $filename eq '0-example'; | ||
|
||
die "Filename $filename should start with a number (e.g. the pull request number)" unless ($filename =~ /^\d+/); | ||
|
||
$filename = $dirpath . '/' . $filename; | ||
open my $in, '<', $filename or die "can't open $filename: $!"; | ||
my @lines = <$in>; | ||
close $in or die "can't close $filename: $!"; | ||
|
||
my $content = trim(join("\n ", map { trim($_) } @lines)); | ||
die "$filename can't be empty" unless length($content) > 0; | ||
|
||
my $commit = `git log --diff-filter=A --pretty=format:"%H" $filename`; | ||
$commit = trim($commit) if defined($commit); | ||
die "$filename: git log failed to find commit" if ($?) || (length($commit) == 0); | ||
|
||
my $url = ''; | ||
if ($print_urls) { | ||
my $pr = find_pr($commit); | ||
my $url = 'https://github.com/i3/i3/commit/' . $commit; | ||
$url = 'https://github.com/i3/i3/pull/' . $pr if defined($pr); | ||
$url = $url . "\n"; | ||
} | ||
|
||
$s = $s . ' • ' . $content . "\n" . $url; | ||
} | ||
return $s; | ||
} | ||
|
||
sub find_pr { | ||
my $hash = shift; | ||
my $result = `git log --merges --ancestry-path --oneline $hash..next | grep 'Merge pull request' | tail -n1`; | ||
return unless defined($result); | ||
|
||
return unless ($result =~ /Merge pull request .([0-9]+)/); | ||
return $1; | ||
} | ||
|
||
sub trim { | ||
(my $s = $_[0]) =~ s/^\s+|\s+$//g; | ||
return $s; | ||
} | ||
|
||
# Expected to run for i3's git root | ||
my $changes = read_changefiles('release-notes/changes'); | ||
my $bugfixes = read_changefiles('release-notes/bugfixes'); | ||
|
||
print $template[0] . $changes . $template[1] . $bugfixes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters