Mercurial > dotfiles.old
changeset 6:d35280c9b023
Add custom CLI tools
author | zegervdv <zegervdv@me.com> |
---|---|
date | Sun, 23 Feb 2014 18:52:12 +0100 |
parents | 8975f7375c41 |
children | 4f1add3c7606 |
files | bin/git-conflict bin/mkreport zshrc |
diffstat | 3 files changed, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/git-conflict Sun Feb 23 18:52:12 2014 +0100 @@ -0,0 +1,24 @@ +#!/usr/bin/env perl +# Find conflict markers in files +# 2013, Zeger Van de Vannet + +use Term::ANSIColor; + +my $files = `git ls-files`; + +my @files = split "\n", $files; + +for $file (@files) { + open FILE, "$file" or die $!; + my @lines = <FILE>; + for $i (keys @lines) { + if ($lines[$i] =~ /\<{2,}/) { + $linenr = $i + 1; + print color("blue"), "$file", color("reset"); + print ":"; + print color("yellow"), "$linenr ", color("reset"); + print "$lines[$i]"; + } + } + close FILE; +}