ffranz
ffranz

Reputation: 124

git flow release finish -m gives different behavior in cmd and Git Bash

I am writing a Bash script for git-flow automation in Windows.

The issue is: when I call git flow release finish MYRELEASE -m "MESSAGE" from cmd it runs without asking for inputs (desired behaviour). But when I do the same from Git Bash (MINGW64) it asks for merge messages (launching vim), which I want to avoid.

I tried to set the git-config to git config --global core.mergeoptions --no-edit in both consoles, but the outcome is the same: Git Bash always asks for mergemessages.

UPDATE:
The output of git flow release finish 1.1.4 -m "v1.1.4" --showcommands in both consoles is

git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
git merge --no-ff release/1.1.4
Already up-to-date!
Merge made by the 'recursive' strategy.
git tag -a -m v1.1.4 1.1.4 1.1.4
git checkout develop
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.
git merge --no-ff 1.1.4
Already up-to-date!
Merge made by the 'recursive' strategy.
git branch -d release/1.1.4
Deleted branch release/1.1.4 (was 0a774fe).

Summary of actions:
- Release branch 'release/1.1.4' has been merged into 'master'
- The release was tagged '1.1.4'
- Release tag '1.1.4' has been back-merged into 'develop'
- Release branch 'release/1.1.4' has been locally deleted
- You are now on branch 'develop'

Upvotes: 2

Views: 682

Answers (1)

ffranz
ffranz

Reputation: 124

I just found the solution myself in an answer to a related question.
All you have to do is execute export GIT_MERGE_AUTOEDIT=no at the beginning of the script and unset GIT_MERGE_AUTOEDIT at the end of it.
I still don't know why the two consoles differ, but this fix produces the desired behavior, so it's good enough for me.

Upvotes: 2

Related Questions