[hipl-dev] Re: [Branch ~hipl-core/hipl/trunk] Rev 6262: Merge lp:~stefan.goetz/hipl/commitguard-whitespace

  • From: Stefan Götz <stefan.goetz@xxxxxx>
  • To: hipl-dev@xxxxxxxxxxxxx
  • Date: Wed, 01 Feb 2012 11:54:11 +0100

Hi Diego,

>> +command=
>> +    if ! tr -d '\r' < '{}' | diff -u '{}' - > /dev/null; then
> 
> Piping into diff seems like overkill if you just want to detect errors:
> 
>     if $SVNLOOK cat -t "$TXN" "$REPOS" "$file" | grep -q '^M$' 2> /dev/null; 
> then                                                                          
>                   

grep '^M$' doesn't work for me - I just tested it on a file I converted
to DOS line breaks with unix2dos on a current Ubuntu but grep doesn't
detect the ^M characters.

I'd definitely prefer a simple grep expression, but couldn't find any
that works - any other ideas?

Stefan

Other related posts: