Skip to content

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

Merged
merged 7 commits into from
Feb 24, 2022
Merged

Conversation

patiencedaur
Copy link
Contributor

Fixes #1884

@github-actions github-actions bot temporarily deployed to branch-team-git-workflow February 16, 2022 08:57 Inactive
Comment on lines 44 to 46
* Use the imperative mood.
* Start with a capital letter, don't add ending punctuation.
* Try to stick to 50 characters or so.
Copy link
Member

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?

Commit messages
---------------

* In your commit message, convey the nature of the change and possibly the reason why it was made.
Copy link
Member

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.

Copy link
Contributor Author

@patiencedaur patiencedaur Feb 18, 2022

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.

@github-actions github-actions bot temporarily deployed to branch-team-git-workflow February 16, 2022 12:12 Inactive
@patiencedaur patiencedaur force-pushed the patiencedaur/team-git-workflow branch from c6d5a0c to 582fb7d Compare February 16, 2022 12:19
@github-actions github-actions bot temporarily deployed to branch-team-git-workflow February 16, 2022 12:21 Inactive
@NickVolynkin
Copy link
Contributor

I propose adding https://xkcd.com/1296/ as an illustration )

@patiencedaur
Copy link
Contributor Author

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.

@github-actions github-actions bot temporarily deployed to branch-team-git-workflow February 22, 2022 07:34 Inactive
* Resolves #1234
* Fixes #1234

If your PR closes more than one issue, add such a line for each issue.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be one line, but with full phrases.

Resolves #10, resolves #123, resolves octo-org/octo-repo#100

Commit messages
---------------

* One-line commit messages are sufficient for documentation changes. Try keeping it 50 characters or less.
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor Author

@patiencedaur patiencedaur Feb 22, 2022

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.
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

@github-actions github-actions bot temporarily deployed to branch-team-git-workflow February 22, 2022 09:23 Inactive
@github-actions github-actions bot temporarily deployed to branch-team-git-workflow February 22, 2022 09:29 Inactive
@github-actions github-actions bot temporarily deployed to branch-team-git-workflow February 22, 2022 09:50 Inactive
@github-actions github-actions bot temporarily deployed to branch-team-git-workflow February 24, 2022 12:55 Inactive
@patiencedaur patiencedaur merged commit f02a7e1 into latest Feb 24, 2022
@patiencedaur patiencedaur deleted the patiencedaur/team-git-workflow branch February 24, 2022 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[5pt] Team guide: git workflow
3 participants