How I can use git flow release finish
in a manner that doesn't ask for merge commit messages? The -m
flag doesn't provide this, as I expected.
The goal of course is to be able to script this in such a way that doesn't require interaction.
How I can use git flow release finish
in a manner that doesn't ask for merge commit messages? The -m
flag doesn't provide this, as I expected.
The goal of course is to be able to script this in such a way that doesn't require interaction.
You can set the environment variable
export GIT_MERGE_AUTOEDIT=no
git flow release finish -m 'Merge Message' release_branch_name
unset GIT_MERGE_AUTOEDIT
It won't invoke the editor for when you merge.
If you switch to my fork git-flow AVH Edition you can set this option to only work for when you use git-flow.
unset GIT_MERGE_AUTOEDIT
to turn this off (at the end of your script because clearly if you're reading this question, you're trying to script git-flow) –
Duckett -m
merge message is also required, or else the editor will also be presented. And it must be specified before the name of the release branch in the command line arguments. –
Melisenda GIT_MERGE_AUTOEDIT=no git flow release finish -m 'Finished.' 1.0.0
–
Reidreidar I had trouble with the -m flag. However if you give a message without spaces, it worked. Must be a bug.
git flow release finish -m 'my_message_with_no_spaces' 1.2.3
flags:FATAL the available getopt does not support spaces in options
–
Reidreidar I've finished doing it:
git flow release finish -m "New release:$releaseVersion" -T
$releaseVersion -S $releaseVersion
where -m
is the commit message, -T
is tag message and -S
is squash commit. Now everything is going to work automatically :)
git flow
is (more or less) just a wrapper around git
commands. Pop open the git-flow-*.sh
of your choice, copy the git commands, and then mess with them. In this case, add --no-edit
to git merge
. This approach kills two birds with one stone: you can just copy these lines into your automation script.
Unfortunately there's no out-of-the-box way to achieve that with the current version of git-flow.
By looking at the source code, the git command used to merge is
git merge --no-ff
and there's no way to pass the --no-edit
flag to it.
A couple of things you could do:
You can pass the -m
flag to specify a tag message on the command line.
It is still possible for the merges to have conflicts, but the tag operation will not try to open an editor for the tag message.
git flow release finish -m "my awesome release" 1.2.3
https://github.com/nvie/gitflow/wiki/Command-Line-Arguments#git-flow-release-finish--fsumpkn-version
I don't know about git flow
, but if it supports standard git flags, you can use the --no-edit
flag to avoid merge commit messages in an automated setting.
Finally I get this works by this code:
export GIT_MERGE_AUTOEDIT=no
git flow release finish "$newVer" -m "$newVer" -T "$newVer"
unset GIT_MERGE_AUTOEDIT
© 2022 - 2024 — McMap. All rights reserved.