File: colordiff-git.patch

package info (click to toggle)
apt-listdifferences 1.20161219
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 148 kB
  • sloc: python: 118; sh: 18; makefile: 11
file content (69 lines) | stat: -rw-r--r-- 2,454 bytes parent folder | download
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
--- /usr/bin/colordiff	2015-10-26 14:50:33.000000000 +0000
+++ colordiff-git	2015-11-15 15:59:32.576272729 +0000
@@ -7,6 +7,10 @@
 #                                                                      #
 # Copyright (C)2002-2015 Dave Ewart (davee@sungate.co.uk)              #
 #                                                                      #
+# colordiff-git modifications                                          #
+#                                                                      #
+# Copyright (C)2013-2015 Michael Gilbert (mgilbert@debian.org)         #
+#                                                                      #
 ########################################################################
 #                                                                      #
 # This program is free software; you can redistribute it and/or modify #
@@ -52,14 +56,15 @@
 $colour{darkred}     = "\033[0;31m";
 $colour{darkmagenta} = "\033[0;35m";
 $colour{darkblack}   = "\033[0;30m";
+$colour{bold}        = "\033[0;1m";
 $colour{off}         = "\033[0;0m";
 
 # Default colours if /etc/colordiffrc or ~/.colordiffrc do not exist
-my $plain_text = $colour{white};
-my $file_old   = $colour{red};
-my $file_new   = $colour{blue};
-my $diff_stuff = $colour{magenta};
-my $cvs_stuff  = $colour{green};
+my $plain_text = "";
+my $file_old   = $colour{darkred};
+my $file_new   = $colour{darkgreen};
+my $diff_stuff = $colour{darkcyan};
+my $cvs_stuff  = $colour{bold};
 
 # Locations for personal and system-wide colour configurations
 my $HOME   = $ENV{HOME};
@@ -161,18 +166,10 @@
     return 'unknown';
 }
 
-my $enable_verifymode;
+my $enable_verifymode = 1;
 my $specified_difftype;
 my $enable_fakeexitcode;
 my $color_mode = "auto";
-GetOptions(
-    # --enable-verifymode option is for testing behaviour of colordiff
-    # against standard test diffs
-    "verifymode" => \$enable_verifymode,
-    "fakeexitcode" => \$enable_fakeexitcode,
-    "difftype=s" => \$specified_difftype,
-    "color=s" => \$color_mode
-);
 
 $_ = $specified_difftype;
 if (defined $_ and not /^diff[cuy]?|(deb|w)diff$/) {
@@ -503,7 +500,13 @@
         }
     }
     elsif ($diff_type eq 'diffu') {
-        if (/^-/) {
+        if (/^---/) {
+            print "$cvs_stuff";
+        }
+        elsif (/^\+\+\+/) {
+            print "$cvs_stuff";
+        }
+        elsif (/^-/) {
             print "$file_old";
         }
         elsif (/^\+/) {