Comment location parameters are checked after invoking editor
krobelus opened this issue · 0 comments
krobelus commented
In the git-appraise repo, I did
$ git appraise comment -f .travis.yml -l 10 bd714f195655
and composed a review comment in my editor. After I was done I got
Unable to comment on the given location: Line number 10 does not exist in file ".travis.yml"
This was just my off-by-one error, I should have used -l 9
.
Unfortunately, .git/APPRAISE_COMMENT_EDITMSG
was deleted despite the error, so I had to write it again.
I think we should either check for errors upfront, or preserve APPRAISE_COMMENT_EDITMSG
in case of errors.
(I pushed my review to my fork, I'm not sure if that will reach the PR here?)