문제

Is there a way to use a heredoc as the message via the svn command?

I tried this:

$ echo <<TEXT | svn commit -m - 
  > line one input
  > line two input
  >TEXT

In my repository it just writes the dash as the message.

I tried searching around and didn't find a way of doing a multi-line input other than writing in the \n characters, but it would be great if I could just regular multi-lined text that I've already typed up as the input.

Is it possible using a different method or is it just wishful thinking?

Thanks!

도움이 되었습니까?

해결책

You can set an environment variable which will allow svn to open up your desired text editor to enter your commit message.

SVN_EDITOR

Look here for more info

다른 팁

If you really want to use a here document you need to use the -F option. But your other problem is you're using echo which doesn't take any input on stdin. You want cat.

So the following will work:

cat <<TEXT | svn commit -F -

If you're doing this interactively I think you'll prefer Jon Taylor's answer.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top