Frage

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!

War es hilfreich?

Lösung

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

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top