if $editor ends up being commit-log-editor, it will be called in an infinite loop. I managed to get this situation by swapping SVN_EDITOR and SVN_LOG_EDITOR - by mistake - in my .bashrc file.
Created attachment 49287 [details] Proposed fix: add a isCommitLogEditor routine and check the $editor variable against it
Comment on attachment 49287 [details] Proposed fix: add a isCommitLogEditor routine and check the $editor variable against it > +sub isCommitLogEditor($) > +{ > + my $editor = shift; > + printf $editor . "\n"; > + return $editor =~ m/commit-log-editor/; > +} Wouldn't it be enough to just do this check once and not for each time you call the subroutine?
(In reply to comment #2) > (From update of attachment 49287 [details]) > > > +sub isCommitLogEditor($) > > +{ > > + my $editor = shift; > > + printf $editor . "\n"; > > + return $editor =~ m/commit-log-editor/; > > +} > > Wouldn't it be enough to just do this check once and not for each time you call > the subroutine? No, as you can't predict whether $editor is the same each time you are called. The use case for that would be setting $SVN_LOG_EDITOR to commit-log-editor. If you cache the result, then you will fall all the way down to "/usr/bin/vi" when you could have used $EDITOR.
Kenneth, are you satisfied with my comment or would you prefer another approach?
Yes! r=me
Landed in r56540. Thanks!