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
|
description: gitify colordiff
author: Michael Gilbert <mgilbert@debian.org>
--- a/colordiff 2012-12-28 09:35:44.000000000 +0000
+++ b/colordiff-git 2013-08-15 03:38:00.255714484 +0000
@@ -7,6 +7,10 @@
# #
# Copyright (C)2002-2012 Dave Ewart (davee@sungate.co.uk) #
# #
+# colordiff-git modifications #
+# #
+# Copyright (C) 2013 Michael Gilbert (mgilbert@debian.org) #
+# #
########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
@@ -53,14 +57,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};
@@ -160,13 +165,8 @@
my $enable_verifymode;
my $specified_difftype;
-GetOptions(
- # --enable-verifymode option is for testing behaviour of colordiff
- # against standard test diffs
- "verifymode" => \$enable_verifymode,
- "difftype=s" => \$specified_difftype
- # TODO - check that specified type is valid, issue warning if not
-);
+
+$enable_verifymode = 1;
if (defined $enable_verifymode) {
# When in verify mode, to ensure consistent output we don't source
@@ -435,7 +435,13 @@
}
}
elsif ($diff_type eq 'diffu') {
- if (/^-/) {
+ if (/^---/) {
+ print "$cvs_stuff";
+ }
+ elsif (/^\+\+\+/) {
+ print "$cvs_stuff";
+ }
+ elsif (/^-/) {
print "$file_old";
}
elsif (/^\+/) {
|