in reply to Re: Using grep on windows
in thread Using grep on windows

Well now i know i have a long way to go..... Now the problem is all commits are getting rejecting even those which have a valid issue number at the start of the log message. Like CNR12345

Replies are listed 'Best First'.
Re^3: Using grep on windows
by ikegami (Patriarch) on Oct 27, 2009 at 20:58 UTC
    Is "CNR12345" at the very start of a line? That's what my regex pattern checks for.
      yes.. but it will reject all commits even if it has a CNR Log mesasge is like this CNR12345 Whatever message
      yes it is at the start of the comment. But it doesn't work even if u put log message manually. Here is the comment in the log message "CNR12345 commit to hook check"
        You are mistaken.
        my $commitlog = "CNR12345 commit to hook check"; my ($cnr_number) = $commitlog =~ /^(CNR[0-9]+)/m or die("You must enter a valid CNR\n"); print("CNR number is $cnr_number\n");
        $ perl a.pl CNR number is CNR12345