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

Add option/templates to configure automatic commit messages #11509

Open
1 task done
MarkusAmshove opened this issue May 19, 2020 · 2 comments
Open
1 task done

Add option/templates to configure automatic commit messages #11509

MarkusAmshove opened this issue May 19, 2020 · 2 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@MarkusAmshove
Copy link
Contributor

  • Gitea version (or commit ref): 1.12.0-rc1
  • Git version: 2.20.1
  • Operating system: Debian 10
  • Database (use [x]):
    • SQLite

Description

We currently employ a pre-receive hook to check commit messages for mentions of a mandatory issue tracker id and otherwise reject commits.

The mandatory form we're using is: "Issue #{issueid}: {message}".

I'm going to show off two places where this bites (or will bite) us, there might however be a few more around Gitea.

Merge messages

This is one place where this is a bit annoying but can be worked around:

image

See that the title of the PR is already formed into a commit message which would be valid, so we can copy paste it into the merge box.
However, if someone messes this up (which is easy, e.g. when facing the PR workflow the first few times), we get an invalid message.

In this place I could think of a simple template as in {{ .pull.title }} (pseudocode).

Update Branch

This is pretty new, that's the reason why I'm using the RC :-)

If I use the new "Update branch" button (which I can't seem to disable) I'm not prompted for a message:

image

Gitea is creating an automatic merge message which is invalid to our expected commit messages:

image

In this case, a template I would use is in the form of Issue #{{.head.branch_name}}: Merge branch '{{.base.branch}}' into {{.head.branch_name}} (also Pseudocode)

This place in particular was mentioned in the discussion of the Update branch button

While the branch protection for outdated branches (against their base) and the mention of it in the PR will be super helpful and a welcoming addition for us, the Update branch button (which can't be disabled by option) is dangerous in our case :-)

@MarkusAmshove
Copy link
Contributor Author

@lafriks could you label this issue? :-)

@techknowlogick techknowlogick added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label May 29, 2020
@lunny
Copy link
Member

lunny commented Feb 10, 2022

related with #18177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

3 participants