lazygit
lazygit copied to clipboard
Finishing a Release (git flow) doesn't merge it into develop, only master
Describe the bug When I close a release using git flow, it merges into master but not into develop
To Reproduce Steps to reproduce the behavior:
- Use
i
to create a release - Make any commit
- Close the release
- It will merge into master, but not into develop
Expected behavior the release should merge into master and develop
Screenshots Irrelevant
Desktop (please complete the following information):
- OS: Arch Linux
- Lazygit v0.31.4
Any news on this?
Are you still affected by this on v0.37
?
Ok, I've tested now. The bug seems fixed.
+ git flow release finish 1.0.0
Switched to branch 'master'
Merge made by the 'ort' strategy.
CHANGELOG.md | 4 ++++
1 file changed, 4 insertions(+)
create mode 100644 CHANGELOG.md
Already on 'master'
Switched to branch 'develop'
Merge made by the 'ort' strategy.
CHANGELOG.md | 4 ++++
1 file changed, 4 insertions(+)
create mode 100644 CHANGELOG.md
Deleted branch release/1.0.0 (was e804465).
Summary of actions:
- Release branch 'release/1.0.0' has been merged into 'master'
- The release was tagged '1.0.0'
- Release tag '1.0.0' has been back-merged into 'develop'
- Release branch 'release/1.0.0' has been locally deleted
- You are now on branch 'develop'
Press enter to return to lazygit
Is there a way to include the -p
option in order to push the changes also on remote??
Based on a glance at the code, there doesn't seem to be a way to do that, I may be wrong tho.
Feel free to open up a feature request! :)
I'm not so expert in Go but I believe in the pkg/commands/git_commands/flow.go
it just needs somethin like this:
-func (self *FlowCommands) FinishCmdObj(branchName string) (oscommands.ICmdObj, error) {
+func (self *FlowCommands) FinishCmdObj(branchName string, willPush bool) (oscommands.ICmdObj, error) {
prefixes := self.config.GetGitFlowPrefixes()
// need to find out what kind of branch this is
prefix := strings.SplitAfterN(branchName, "/", 2)[0]
suffix := strings.Replace(branchName, prefix, "", 1)
branchType := ""
for _, line := range strings.Split(strings.TrimSpace(prefixes), "\n") {
if strings.HasPrefix(line, "gitflow.prefix.") && strings.HasSuffix(line, prefix) {
regex := regexp.MustCompile("gitflow.prefix.([^ ]*) .*")
matches := regex.FindAllStringSubmatch(line, 1)
if len(matches) > 0 && len(matches[0]) > 1 {
branchType = matches[0][1]
break
}
}
}
if branchType == "" {
return nil, errors.New(self.Tr.NotAGitFlowBranch)
}
+ if willPush {
+ return self.cmd.New("git flow " + branchType + " finish -pm " + suffix), nil
+ }
return self.cmd.New("git flow " + branchType + " finish " + suffix), nil
}
Something like that, yeah.
I'd just make it configurable through config.yml
, something like gitFlowFlags
, so it's backwards compatible, and in case that someone doesn't want to push, nothing unexpected will happen.
Yep, or maybe a prompt after choosing the "feature finish"/"release finish" option asking "push changes to remote".
P.S. I've opened a feature request with my personal account, this one is just for my workplace stuff.
#2472
Closing as fixed