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

Git Commit Format #585

Closed
rettichschnidi opened this issue Apr 12, 2021 · 6 comments
Closed

Git Commit Format #585

rettichschnidi opened this issue Apr 12, 2021 · 6 comments

Comments

@rettichschnidi
Copy link
Contributor

The Eclipse Foundation Project Handbook specifies how a Git commit must look like in order to be acceptable.

The following rule is mandatory, could be checked automatically but is currently now:

  • Summary is max. 72 characters

The following rule is not mandatory ("should"), but when implementing the above as a checked in CI, I'd like to enforce it too:

  • Existence of a description
@sbernard31
Copy link
Contributor

I will no write too much commit so this is clearly a decision on your side but I'm not sure making the description mandatory is a good idea. Sometime there is nothing much to say than just the summary.

@rettichschnidi
Copy link
Contributor Author

rettichschnidi commented Apr 12, 2021

I know Zephyr has this rule. While sometimes worked around (e.g. zephyrproject-rtos/zephyr@22a82bc), it seems to me that such a rule encourages greatly to come up with helpful commit messages. 72 characters are most often not enough to describe the motivation behind a commit.

For example, most of the last 20 commit messages in https://github.com/zephyrproject-rtos/zephyr/commits/zephyr-v2.5.0 makes me feel like I have a shot at understand the commits intention thanks to the additional information in the body.

@mlasch
Copy link
Contributor

mlasch commented Apr 12, 2021

From personal experience I can say, that being forced to write a description is sometimes annoying. However it forces yourself to think again about the commit. Also the workaround mentioned by @rettichschnidi works for small changes. I would support such a rule.

@qleisan
Copy link

qleisan commented Apr 12, 2021

Naming and explaining is usually the hardest part, but very important. I'm for (although I will regret it :)

rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

In addition, it checks for the Signed-off-by tag. This simplifies to
detect missing signatures even before creating a PR.
Please note: gitlint 0.15.1 is required to detect the tags created by
Git.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 21, 2021
…aaay too long commit message subject

This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

In addition, it checks for the Signed-off-by tag. This simplifies to
detect missing signatures even before creating a PR.
Please note: gitlint 0.15.1 is required to detect the tags created by
Git.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 21, 2021
…aaay too long commit message subject

This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

In addition, it checks for the Signed-off-by tag. This simplifies to
detect missing signatures even before creating a PR when being executed
locally.
Please note: gitlint 0.15.1 is required to detect the tags created by
Git.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

In addition, it checks for the Signed-off-by tag. This simplifies to
detect missing signatures even before creating a PR when being executed
locally.
Please note: gitlint 0.15.1 is required to detect the tags created by
Git.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

In addition, it checks for the Signed-off-by tag. This simplifies to
detect missing signatures even before creating a PR when being executed
locally.

Please note:
 - gitlint 0.15.1 is required to detect the tags created by Git.
 - Using the gitlint-ignore tag in a commit message allows to suppress
   gitlint findings for a specific commit.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

In addition, it checks for the Signed-off-by tag. This simplifies to
detect missing signatures even before creating a PR when being executed
locally.

Please note:
 - gitlint 0.15.1 is required to detect the tags created by Git.
 - Using the gitlint-ignore tag in a commit message allows to suppress
   gitlint findings for a specific commit.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 21, 2021
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 21, 2021
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 21, 2021
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 21, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

Please note:
 - Using the gitlint-ignore tag in a commit message allows to suppress
   gitlint findings for a specific commit.
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

Additional rules:
- Enforce at least 20 characters in the commit body
- Disallow the word "fixup" in the title messages. Intended to prevent
  accidents like d31d026.

Please note:
 - Using the gitlint-ignore tag in a commit message allows to suppress
   gitlint findings for a specific commit.
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

Non-default rules:
- Enforce at least 20 characters in the commit body
- Disallow the word "fixup" in the title messages. Intended to prevent
  accidents like d31d026.

In case any of those rules get in the way, use the "gitlint-ignore" tag
in the commit message to suppress gitlint findings for this specific
commit. To configure a rule permanently, adapt .gitlint.
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

Non-default rules:
- Enforce at least 20 characters in the commit body
- Disallow the word "fixup" in the title messages. Intended to prevent
  accidents like d31d026.

In case any of those rules get in the way, use the "gitlint-ignore" tag
in the commit message to suppress gitlint findings for this specific
commit. To configure a rule permanently, adapt .gitlint.

The GitHub Action runs only on PRs, not after each push. The idea is to
prevent annoyance when working on code, using WIP or other non-compliant
commit messages.
@rettichschnidi
Copy link
Contributor Author

After all those force-pushes, I think the PR #590 is now in a good shape and ready to be reviewed.

rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

Non-default rules:
- Enforce at least 20 characters in the commit body
- Disallow the word "fixup" in the title messages. Intended to prevent
  accidents like d31d026.

In case any of those rules get in the way, use the "gitlint-ignore" tag
in the commit message to suppress gitlint findings for this specific
commit. To configure a rule permanently, adapt .gitlint.

The GitHub Action runs only on PRs, not after each push. The idea is to
prevent annoyance when working on code, using WIP or other non-compliant
commit messages.
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

Non-default rules:
- Enforce at least 20 characters in the commit body
- Disallow the word "fixup" in the title messages. Intended to prevent
  accidents like d31d026.

In case any of those rules get in the way, use the "gitlint-ignore" tag
in the commit message to suppress gitlint findings for this specific
commit. To configure a rule permanently, adapt .gitlint.

The GitHub Action runs only on PRs, not after each push. The idea is to
prevent annoyance when working on code, using WIP or other non-compliant
commit messages.
rettichschnidi added a commit that referenced this issue Apr 21, 2021
This is a fairly default configuration, which, among other stuff,
checks for the subject line being 72 or less characters as required by
the Eclipse project handbook.

Non-default rules:
- Enforce at least 20 characters in the commit body
- Disallow the word "fixup" in the title messages. Intended to prevent
  accidents like d31d026.

In case any of those rules get in the way, use the "gitlint-ignore" tag
in the commit message to suppress gitlint findings for this specific
commit. To configure a rule permanently, adapt .gitlint.

The GitHub Action runs only on PRs, not after each push. The idea is to
prevent annoyance when working on code, using WIP or other non-compliant
commit messages.
@rettichschnidi
Copy link
Contributor Author

Just merged PR #590, which covers this issue.

rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 21, 2021
This was used for debugging purposes and is no longer needed.
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 21, 2021
This workflow does not have gitlint installed, and does not need it.
Therefore it should not try to invoke it.

This error could get introduced because SonarCloud scan are running only
on master for now. See 866e505 for
details.
rettichschnidi added a commit that referenced this issue Apr 22, 2021
This was used for debugging purposes and is no longer needed.
rettichschnidi added a commit that referenced this issue Apr 22, 2021
This workflow does not have gitlint installed, and does not need it.
Therefore it should not try to invoke it.

This error could get introduced because SonarCloud scan are running only
on master for now. See 866e505 for
details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants