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 .gitmessage template and git hook #3288

Closed
wants to merge 1 commit into from

Conversation

geyslan
Copy link
Member

@geyslan geyslan commented Jun 28, 2023

1. Explain what the PR does

25e4800 chore(git): add .gitmessage template and git hook (2023/jun/28) Geyslan Gregório <geyslan@gmail.com>

To use this template, after a fresh clone, create a symlink:
  ln -s ../../git-hooks/prepare-commit-msg .git/hooks/prepare-commit-msg

2. Explain how to test it

git commit shows default commit msg appended with .gitmessage template.

3. Other comments

To use this template, after a fresh clone, create a symlink:
  ln -s ../../git-hooks/prepare-commit-msg .git/hooks/prepare-commit-msg
@geyslan geyslan self-assigned this Jun 28, 2023
@geyslan geyslan changed the title chore(git): add .gitmessage template and git hook add .gitmessage template and git hook Jun 28, 2023
@rafaeldtinoco
Copy link
Contributor

I personally don't like having git hooks and other attempts we had in the past to do such a long test as a "template" failed. I'll let @yanivagman to decide this one.

@geyslan
Copy link
Member Author

geyslan commented Jun 29, 2023

I personally don't like having git hooks and other attempts we had in the past to do such a long test as a "template" failed. I'll let @yanivagman to decide this one.

I understand. My proposal is to let the template available but don't force the contributor to use it (considering that it's just a commented template for guidance), so we could add a doc about its existence.

@josedonizetti
Copy link
Contributor

I also don't like git hooks, would prefer we validate it on our CI instead, i think it will more useful, if the templated is not enforced, in my view most people won't use it and it will get obsolete.

@geyslan
Copy link
Member Author

geyslan commented Jul 25, 2023

I don't think we should enforce formatting (even in CI), just suggest it. I'm going to convert this into a contribution doc (suggesting) the formatting. WDYT?

@rafaeldtinoco
Copy link
Contributor

in my view most people won't use it and it will get obsolete.

+1 on that.

I'm going to convert this into a contribution doc (suggesting) the formatting. WDYT?

I believe we should ENFORCE the git log subject formatting to this:

# <type>(scope): <description>
#
# (optional body)
#
# (optional footer(s))
#
# Type can be:
#	feat:     A new feature
#	fix:      A bug fix
#	docs:     Documentation changes
#	style:    Code style changes (formatting, indentation, etc.)
#	refactor: Code restructuring that neither fixes a bug nor adds a feature
#	perf:     Performance improvements
#	test:     Adding or modifying tests
#	build:    Changes to the build system or dependencies
#	chore:    Other changes that don't modify src or test files
#	revert:   Reverts a previous commit

and forget about the rest. We should enforce as a PR check IMO.

@geyslan
Copy link
Member Author

geyslan commented Jul 25, 2023

Ok, so closing this PR.

@geyslan geyslan closed this Jul 25, 2023
@geyslan geyslan deleted the chore-git-msg branch July 31, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants