Skip to content

Commit fe63e70

Browse files
authored
Merge pull request #1 from meinto/master
Rebase
2 parents bcdbb9d + 26d6690 commit fe63e70

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ glow init
107107
"projectName": "my-project",
108108
"gitPath": "/usr/local/bin/git",
109109
"useBuiltInGitBindings": false,
110+
"mergeRequest.squashCommits": true
110111
}
111112
```
112113

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.4
1+
2.3.5

formula/glow.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
class Glow < Formula
33
desc ""
44
homepage ""
5-
version "2.3.3"
5+
version "2.3.5"
66
bottle :unneeded
77

88
if OS.mac?
9-
url "https://github.com/meinto/glow/releases/download/v2.3.3/glow_2.3.3_darwin_x86_64.tar.gz"
10-
sha256 "2c3438a9821441a959bc17eb43a42055605859880bc7dbed8b342aa976f80869"
9+
url "https://github.com/meinto/glow/releases/download/v2.3.5/glow_2.3.5_darwin_x86_64.tar.gz"
10+
sha256 "12101247edece27ae57dca585b11b70c29549e4e0b392928dda9e76009783ce6"
1111
elsif OS.linux?
1212
if Hardware::CPU.intel?
13-
url "https://github.com/meinto/glow/releases/download/v2.3.3/glow_2.3.3_linux_x86_64.tar.gz"
14-
sha256 "ac07b9942beb6cfeb7b4d05f90fff684bd7a9dccceba96f0c9eb605aa56da361"
13+
url "https://github.com/meinto/glow/releases/download/v2.3.5/glow_2.3.5_linux_x86_64.tar.gz"
14+
sha256 "8c08b5b23ceb4b6cb7e2727c03bc20eb7db08ddeb93a80b844233f990a899786"
1515
end
1616
end
1717

gitprovider/gitlab_adapter.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
"github.com/meinto/glow"
1313
"github.com/pkg/errors"
14+
"github.com/spf13/viper"
1415
)
1516

1617
type gitlabAdapter struct {
@@ -27,7 +28,7 @@ func (a *gitlabAdapter) Close(b glow.Branch) error {
2728
targets := b.CloseBranches(branchList)
2829

2930
for _, t := range targets {
30-
err := a.createMergeRequest(b, t)
31+
err := a.createMergeRequest(b, t, true)
3132
if err != nil {
3233
return errors.Wrap(err, "error creating merge request")
3334
}
@@ -41,24 +42,26 @@ func (a *gitlabAdapter) Publish(b glow.Branch) error {
4142
remoteBranchExists := a.gitService.RemoteBranchExists(b.ShortBranchName())
4243
if b.CanBePublished() && remoteBranchExists == nil {
4344
t := b.PublishBranch()
44-
return a.createMergeRequest(b, t)
45+
return a.createMergeRequest(b, t, false)
4546
}
4647
return errors.Wrap(remoteBranchExists, "cannot be published")
4748
}
4849

49-
func (a *gitlabAdapter) createMergeRequest(source glow.Branch, target glow.Branch) error {
50+
func (a *gitlabAdapter) createMergeRequest(source glow.Branch, target glow.Branch, removeSourceBranch bool) error {
5051
type Payload struct {
5152
SourceBranch string `json:"source_branch"`
5253
TargetBranch string `json:"target_branch"`
5354
Title string `json:"title"`
5455
RemoveSourceBranch bool `json:"remove_source_branch"`
56+
Squash bool `json:"squash"`
5557
}
5658

5759
data := Payload{
5860
SourceBranch: source.ShortBranchName(),
5961
TargetBranch: target.ShortBranchName(),
6062
Title: fmt.Sprintf("Merge %s in %s", source.ShortBranchName(), target.ShortBranchName()),
61-
RemoveSourceBranch: false,
63+
RemoveSourceBranch: removeSourceBranch,
64+
Squash: viper.GetBool("mergeRequest.squashCommits"),
6265
}
6366
payloadBytes, err := json.Marshal(data)
6467
if err != nil {

glow.config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"gitProviderDomain": "https://api.github.com",
44
"gitProvider": "github",
55
"projectNamespace": "meinto",
6-
"projectName": "glow"
6+
"projectName": "glow",
7+
"mergeRequest.squashCommits": true
78
}

0 commit comments

Comments
 (0)