4

I try to write a bash script which should commit to a svn repo. Everything works fine until the point where I try to commit. The commit command opens the editor and the script ends with an error that the commit message was left in svn-commit.tmp

I try a couple of things but none will work

commit_msg="$1"
svn commit -m "$commit_msg"

and

commit_msg="$1"
svn commit -m '$commit_msg'

and

commit_msg=$1
svn commit -m '$commit_msg'

and all with the -q and --non-interactiveoperators. Even svn commit -m "woohoo" opens the editor and the script ends with the error.

Any ideas why it is impossible to commit within a bash script without opening the editor?

4
  • Does the editor also open if you run svn commit -m "..." from command line? Commented Feb 2, 2013 at 19:06
  • No, only if I use svn commit in a bash script. Commented Feb 2, 2013 at 19:25
  • 1
    What do you get from type svn? Commented Feb 2, 2013 at 19:42
  • Can you provide the exact script you are using (or at least a portion of it up to the svn commit call that fails)? Commented Feb 2, 2013 at 19:43

2 Answers 2

3

You should use the --non-interactive option on the svn command:

svn commit --non-interactive -m '$commit_msg'
Sign up to request clarification or add additional context in comments.

1 Comment

My english is very bad, I know. But "... and all with the -q and --non-interactive operators" could be a hint that I already tried it. Sorry, no success.
1

After I tried svn ci instead of svn commit, everything was fine. My first thought was a buggy version of svn. Asking the Great Dump (aka Google) I found the solution:: In my .bash_profile was a code snippt that forced the svn commit always to open the editor while svn ci worked as expected.

I don't know exactly where the code snippet came from, but windows users have to fight a lot of mysterious behaviours.

Thanks all for your help.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.