-
Notifications
You must be signed in to change notification settings - Fork 43
Add git workflow guidelines #2688
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
Conversation
doc/contributing/docs/git.rst
Outdated
* Use the imperative mood. | ||
* Start with a capital letter, don't add ending punctuation. | ||
* Try to stick to 50 characters or so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIU it is about commit message titles?
doc/contributing/docs/git.rst
Outdated
Commit messages | ||
--------------- | ||
|
||
* In your commit message, convey the nature of the change and possibly the reason why it was made. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my experience (and our commit message guidelines supports it) the reason is the most important thing. It is what you often can't deduce from the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be so for code, but it's a bit different for docs. Text often speaks for itself. Cases when a commit message needs more than one line are extremely rare in my practice.
c6d5a0c
to
582fb7d
Compare
I propose adding https://xkcd.com/1296/ as an illustration ) |
I appreciate the idea, but it may be unfitting since we're leaning towards formal language in our docs. |
doc/contributing/docs/git.rst
Outdated
* Resolves #1234 | ||
* Fixes #1234 | ||
|
||
If your PR closes more than one issue, add such a line for each issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc/contributing/docs/git.rst
Outdated
Commit messages | ||
--------------- | ||
|
||
* One-line commit messages are sufficient for documentation changes. Try keeping it 50 characters or less. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There can be a second line with "Resolves #...". In fact, a commit is often made before opening a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you squash commits at merge, the resulting message will be a sum of commit messages. So the first commit should have the "resolves" string. Otherwise, there's a risk that this line won't be in the resulting commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the best practice is to write a good commit message first, and then to open a PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, a commit is often made before opening a PR.
Do you mean this process: First you implement changes locally, then you push the branch with the commit, which prompts to create the PR?
the first commit should have the "resolves" string
You mean that the first commit message in the branch must have a second line with the "Resolves" string? Currently we don't do that, I think. But we do include the "resolves" string in the PR description when creating the PR. Do you think we really need to introduce this practice?
Merging | ||
------- | ||
|
||
Merge when your document is ready and good enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Always squash commits
- Make sure the commit message mentions all relevant issues with "resolves" or "fixes"
- Make sure you've attributed all participants with Co-authored-by
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
Fixes #1884