Closed glaubitz closed 4 years ago
Hi,
this is not possible. osc just transfers the string "Initial build\n + Version 1.2.3".
For osc vc -m
it transfers it to build/vc
build/vc echoes the string with echo -e
into the changes file
From the man page of echo:
-e enable interpretation of backslash escapes
For osc checkin -m the string is given as a query parameter to the API and the API does not interpret newline characters here.
The API does support multi-line commit messages though. So I'm not sure why it shouldn't accept multiline commit messages on the command line.
Huh? Then I will further investigate. My last information that it does not interpret newline characters
Ah,. It is the backend that does not interpret the newlines
Note that the change was reverted. The proper way to have multiline commit logs is using new line characters:
coolo@localhost#product-builder>python3.10 ~/prod/osc/osc-wrapper.py ci -m "Hallo^MIhr"
Sending product-builder.changes
Transmitting file data .
Committed revision 10.
coolo@localhost#product-builder>osc log | head
----------------------------------------------------------------------------
r10 | coolo | 2022-07-08 08:02:06 | 9d6d9d5e097192374b7b4ff3500ab931 | unknown |
Hallo
Ihr
Your assumption that \n in command line arguments is creating new lines is just wrong:
coolo@localhost#product-builder>echo "Hallo\nIhr"
Hallo\nIhr
osc vc is just strange.
Why revert it when this little change could have just been implented?
If improvements from the community are later reverted anyway, you’re not really encouraging community members to make contributions in the future. At least I am a little less motivated now to submit patches.
I made this change because osc’s behavior is inconsistent. It should accept message files for all commands and not just some.
¯_(ツ)_/¯
Message files is a different topic - we're talking about \n
in -m
arguments. And it wasn't reverted for fun but because the fix broke all of unicode
It is possible to add multi-line changelog entries with
osc vc
using:results in:
The same unfortunately does not work with
osc checkin
:as this results in: