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

Revise CONTRIBUTING.md #34

Merged
merged 3 commits into from
Apr 25, 2024
Merged

Revise CONTRIBUTING.md #34

merged 3 commits into from
Apr 25, 2024

Conversation

thatplguy
Copy link
Collaborator

  • Adds a getting started section
  • Consolidates code contribution steps into actionable steps with inline guidance
  • Moves general guidance later in the document

 - Adds a getting started section
 - Consolidates code contribution steps into actionable steps with inline guidance
 - Moves general guidance later in the document
@thatplguy thatplguy linked an issue Apr 17, 2024 that may be closed by this pull request
Copy link
Collaborator

@podhrmic podhrmic left a comment

Choose a reason for hiding this comment

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

Just a few comments/changes. I personally would prefer seeing more explicit git commands one can follow, but that is a matter of preference.

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Show resolved Hide resolved
CONTRIBUTING.md Outdated

- Merge regularly from the main branch.

- Rebasing from the main branch (`git pull --rebase origin main`) is not recommended. See [the "Merging" section in these guidelines](https://gitlab-ext.galois.com/program-analysis/guidance/-/blob/master/BestPractices.org?ref_type=heads#:~:text=updating%20a%20submodule.-,Versioning,-Versioning%20should%20follow) for the reasoning.
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the past the most difficult for me was to resolve merge conflicts - perhaps we should add explicit commands to run to do so? I actually don't know what you recommend, if rebasing is discouraged.

Choose a reason for hiding this comment

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

Yes, I agree - I prefer rebasing since it shows you the conflicts in smaller, more manageable chunks, with related conflicts usually grouped together. If your branch has two different commits that both conflict with main, rebase will show you the conflicts from one, then the conflicts from the other, whereas merge gives you all the conflicts from both mixed together.

Somewhat related, I'm also a fan of Gitlab's "semi-linear history" mode, where you always rebase (and then run CI) before merging. It produces a nice readable history, made up of a single linear sequence of commits grouped by PR, and trivially satisfies the "not rocket science" rule for CI. Unfortunately, it seems like Github doesn't support this mode.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also have a (mild) preference for rebasing, and I think this project's other development practices are conducive to it: informative, atomic, and bisect-friendly commits on frequent, short-lived branches are made substantially more useful by maintaining a linear history.

Separately, I'd suggest using https://gitlab-ext.galois.com/program-analysis/guidance/-/blob/78d2d6229f027579384c39a76cf28026b03279a7/BestPractices.org as a link here instead, since it is more permanent and doesn't try (and fail, at least on Safari) to highlight an irrelevant-to-this-recommendation portion of that document.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TBH, I also prefer rebasing. Let's settle on that for this project. Overall, here's the guidance I most care about:

  • No commit on the main branch should break the build. If you commit work-in-progress code on your branch, rebase (git rebase -i) prior to merging or "squash and merge".
  • Avoid force-pushing to shared branches. If you must, prefer git push --force-with-lease over git push --force (for reasons).

Ideally, structure commits into minimal independent changes. For example,

  • Add logging util to capture timing
  • Add new core algorithm, disabled by default
  • Add flag to use new core algorithm

is preferable to

  • Add new core algorithm with flag to enable

is preferable to

  • First attempt at core algorithm
  • Fix logging
  • Refactor logging fix
  • Fix up algorithm
  • WIP
  • Finish alg
  • Add flag

See What goes into a commit for more details.

Also, thank you @samcowger – I'll update the link.

CONTRIBUTING.md Show resolved Hide resolved
CONTRIBUTING.md Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
@podhrmic
Copy link
Collaborator

@thatplguy should we just wait until you push updates/changes here as discussed?

@thatplguy
Copy link
Collaborator Author

Yes, just pushed changes and requested another round of reviews.

Copy link
Collaborator

@podhrmic podhrmic left a comment

Choose a reason for hiding this comment

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

LGTM except the one Coding principles section

CONTRIBUTING.md Outdated Show resolved Hide resolved
Co-authored-by: Michal Podhradsky <[email protected]>
@podhrmic podhrmic merged commit 9645db9 into main Apr 25, 2024
@podhrmic podhrmic deleted the 33-revise-contribution-guidelines branch April 25, 2024 23: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.

Revise contribution guidelines
4 participants