rkarivuraj / coderev

Automatically exported from code.google.com/p/coderev
GNU General Public License v2.0
0 stars 0 forks source link

coderev.sh throws an error: sed: 1: "/tmp/coderev.fldrFs/com ...": command c expects \ followed by text #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. change dir working svn dir with changes
2. coderev.sh -w80

What is the expected output? What do you see instead?

sed: 1: "/tmp/coderev.fldrFs/com ...": command c expects \ followed by text

What version of the product are you using? On what operating system?

MacOSX 10.6.4
Subversion 1.6.5

Please provide any additional information below.

I'm looking into it. I have tracked it down to: 

coderev.sh:
354         sed -i '/^--.*--$/, $ d' $COMMENT_FILE

I don't know sed (yet). I'm assuming this is supposed to strip everything under 
the comment. Anyways, I'll read up on sed and see if I can submit a patch. 

BTW: Thank you very much for putting this together! I have been looking for 
something lightweight like this for months. 

Original issue reported on code.google.com by calsci.c...@gmail.com on 15 Oct 2010 at 3:27

GoogleCodeExporter commented 9 years ago
Forgot to add that I pulled this from svn r39. 

Original comment by calsci.c...@gmail.com on 15 Oct 2010 at 3:28

GoogleCodeExporter commented 9 years ago
Hi Chris,

The line you mentioned is actually Line 351

    351        sed -i '/^--.*--$/, $ d' $COMMENT_FILE

This is to strip anything started from line matches '--.*--$' to the end of 
comment file.  The error message is about a sed "c" command seems not related 
to the line.  Anyway I did not try this on Mac OS before so it is possible to 
have issues.

I don't have a Mac by hand so cannot debug this right now.  If you are 
interested, would you please try

1. Compose a file 'comments' with following content (just 2 lines)

blah blah, comments here
--Enter comments above.  This line and those below will be ignored--

2. Try the sed command and verify the result, the second line is supposed to be 
deleted

sed -i '/^--.*--$/, $ d' comments
cat comments

If you see the same error then this is the point.  Try remove the extra space 
before '$' and 'd' (I doubt there's compatibility issue here)

sed -i '/^--.*--$/,$d' comments
cat comments

Please let me know the result.

Workaround: use the '-m' option to input comments directly.

Thanks,
Matt

Original comment by matt...@gmail.com on 16 Oct 2010 at 6:50

GoogleCodeExporter commented 9 years ago
This tool is moved to github.  This issue is fixed there.

https://github.com/ymattw/coderev/commit/cbd3b419dfb6f6341cef881252e56b644bbf69a
c

The fix is quite easy:

~/ws/coderev $ git diff 70d7 cbd3
diff --git a/coderev.sh b/coderev.sh
index e34891e..a316782 100755
--- a/coderev.sh
+++ b/coderev.sh
@@ -357,7 +357,7 @@ This line and those below will be ignored--"
             fi
         }
         ${EDITOR} $COMMENT_FILE
-        sed -i '/^--.*--$/, $ d' $COMMENT_FILE
+        sed -i -e '/^--.*--$/, $ d' $COMMENT_FILE
     }
     CODEDIFF_OPT+=" -F $COMMENT_FILE"
 else

Original comment by matt...@gmail.com on 12 Jan 2013 at 1:46