[opensuse-buildservice] [PATCH] vc: added -t <text> option in order to support a template
This can be used to create a new changes entry based on a predefined description text. Basically, this is a combination of the default behavior and the -m option. (Rationale: move the functionality which was added in commit b6ccac1ebd9cac5998118a7bb119508ade6b47fe (and reverted in commit d61f21fe0e582736b84c0107439a8bcea3b00244) to osc) --- vc | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/vc b/vc index bf57343..06a29e9 100755 --- a/vc +++ b/vc @@ -39,21 +39,29 @@ fi while [ -n "$1" ]; do case "$1" in -m) - if [ $just_edit ]; then - echo "You cannot use -m and -e together!" + if [ -n "$just_edit" -o -n "$template" ]; then + echo "-m, -e and -t are mutually exclusive!" exit 1 fi message="$2" shift 2 ;; -e) - if [ -n "${message}" ]; then - echo "You cannot use -m and -e together!" + if [ -n "${message}" -o -n "$template" ]; then + echo "-m, -e and -t are mutually exclusive!" exit 1 fi just_edit=true shift 1 ;; + -t) + if [ -n "${message}" -o -n "$just_edit" ]; then + echo "-m, -e and -t are mutually exclusive!" + exit 1 + fi + template="$2" + shift 2 + ;; --help) echo "Usage: $0 [-m MESSAGE|-e] [filename[.changes]|path [file_with_comment]]" echo @@ -131,7 +139,11 @@ set +e cat "$content" echo elif [ ! $just_edit ]; then - echo "- " + if [ -n "$template" ]; then + echo -e "- $template" + else + echo "- " + fi echo fi cat $changelog -- 1.7.3.4 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Thursday 2014-03-06 11:08, Marcus Huewe wrote:
+ if [ -n "$just_edit" -o -n "$template" ]; then + echo "-m, -e and -t are mutually exclusive!" exit 1 fi
Speaking of which: why _are_ -m and -e exclusive? -m gives the message and -e invokes the editor. To me, that's not a conflict. Git can do it, so osc should too. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On 2014-03-06 13:30:56 +0100, Jan Engelhardt wrote:
On Thursday 2014-03-06 11:08, Marcus Huewe wrote:
+ if [ -n "$just_edit" -o -n "$template" ]; then + echo "-m, -e and -t are mutually exclusive!" exit 1 fi
Speaking of which: why _are_ -m and -e exclusive? -m gives the message and -e invokes the editor. To me, that's not a conflict. Git can do it, so osc should too.
-e opens the editor without adding a "header". -m just adds a message (+ header) to the file and does not invoke the editor I can also add support for "-e -m <text>": - add header + text - invoke editor (that is what -t <text> is doing). Any opinions? Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (3)
-
Jan Engelhardt
-
Marcus Huewe
-
Marcus Hüwe