Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve MergeCommit rule to focus on remote and non-base branches #6

Open
tombruijn opened this issue Jul 14, 2021 · 0 comments
Open
Labels
bug Something isn't working

Comments

@tombruijn
Copy link
Member

tombruijn commented Jul 14, 2021

This build should not have failed for merging develop into the main branch: https://appsignal.semaphoreci.com/jobs/a4882761-bd18-4b28-8b1e-afbb13ce7d05

ba5fe03: Merge branch 'develop'
  MergeCommit: Rebase branches on the base branch, rather than merging the base branch with a merge commit.

Can I add some accepted branch names that are accepted? Can I find out what is the base branch? Or should the rule be limited now on merge commits made by git pull

@tombruijn tombruijn added the bug Something isn't working label Jul 14, 2021
tombruijn added a commit that referenced this issue Jul 15, 2021
It's difficult to determine what type of merge the merge commit is
about. I want to warn about local branch merges into feature branches,
not about merges into the repository's main branch. Since Git has no
config for a "main" branch for a local repository this is difficult to
determine.

For this reason I'm narrowing the commits this rule triggers
on to only merges from remotes. I do want to trigger on local merges too
in the future, but those commits will be ignored for now. The tracking
issue for this is #6.

## Background

I notice two kind of merge commits being created by Git.

This subject is being created when I merge a local branch into the
repository's local "main" or "master" branches.

> Merge branch 'branch'

The following subject is created when a local branch is into another
local branch (that is not "main" or "master").

> Merge branch 'branch' into other

Perhaps this gives some hint for the future about how to distinguish
between the different types of merges, but I can't rely on it now, in
case a repository uses a different type of "main" branch name like
"trunk".
tombruijn added a commit that referenced this issue Jul 15, 2021
It's difficult to determine what type of merge the merge commit is
about. I want to warn about local branch merges into feature branches,
not about merges into the repository's main branch. Since Git has no
config for a "main" branch for a local repository this is difficult to
determine.

For this reason I'm narrowing the commits this rule triggers
on to only merges from remotes. I do want to trigger on local merges too
in the future, but those commits will be ignored for now. The tracking
issue for this is #6.

## Background

I notice two kind of merge commits being created by Git.

This subject is being created when I merge a local branch into the
repository's local "main" or "master" branches.

> Merge branch 'branch'

The following subject is created when a local branch is into another
local branch (that is not "main" or "master").

> Merge branch 'branch' into other

Perhaps this gives some hint for the future about how to distinguish
between the different types of merges, but I can't rely on it now, in
case a repository uses a different type of "main" branch name like
"trunk".
tombruijn added a commit that referenced this issue Jul 15, 2021
It's difficult to determine what type of merge the merge commit is
about. I want to warn about local branch merges into feature branches,
not about merges into the repository's main branch. Since Git has no
config for a "main" branch for a local repository this is difficult to
determine.

For this reason I'm narrowing the commits this rule triggers
on to only merges from remotes. I do want to trigger on local merges too
in the future, but those commits will be ignored for now. The tracking
issue for this is #6.

## Background

I notice two kind of merge commits being created by Git.

This subject is being created when I merge a local branch into the
repository's local "main" or "master" branches.

> Merge branch 'branch'

The following subject is created when a local branch is into another
local branch (that is not "main" or "master").

> Merge branch 'branch' into other

Perhaps this gives some hint for the future about how to distinguish
between the different types of merges, but I can't rely on it now, in
case a repository uses a different type of "main" branch name like
"trunk".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant