Linux v4.9 rebase
This commit is contained in:
parent
5de569a890
commit
68eebd5c34
76 changed files with 6052 additions and 5405 deletions
34
remove-binary-diff.pl
Executable file
34
remove-binary-diff.pl
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/perl -w
|
||||
# A script to remove those terrible binary diffs from the patches which
|
||||
# screw up everything and rain on my parade.
|
||||
|
||||
use strict;
|
||||
|
||||
my @args=@ARGV;
|
||||
my @current_patch;
|
||||
my $is_binary = 0;
|
||||
my $cnt = 0;
|
||||
|
||||
while(my $row = <>) {
|
||||
# diff marks the start of a new file to check
|
||||
if ($row =~ /^diff --git.*?(\S+)$/) {
|
||||
if (!$is_binary) {
|
||||
foreach my $line (@current_patch) {
|
||||
print $line;
|
||||
}
|
||||
}
|
||||
$is_binary = 0;
|
||||
@current_patch = ();
|
||||
} elsif ($row =~ /Binary files (.)* differ$/) {
|
||||
$is_binary = 1;
|
||||
} elsif ($row =~ /GIT binary patch/) {
|
||||
$is_binary = 1;
|
||||
}
|
||||
push (@current_patch, $row);
|
||||
}
|
||||
|
||||
if (!$is_binary) {
|
||||
foreach my $line (@current_patch) {
|
||||
print $line;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue