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

Do not squash commits #1723

Merged
merged 1 commit into from Sep 24, 2016
Merged

Do not squash commits #1723

merged 1 commit into from Sep 24, 2016

Conversation

drbrain
Copy link
Member

@drbrain drbrain commented Sep 24, 2016

Description:

Squashing commits may be helpful for small pull requests where the total
change is around 10—20 lines or two or three hunks. With such a small
patch it's easy to infer intent in the future.

For larger patches it becomes increasingly difficult to determine why
the change was made when a single commit contains dozens of hunks where
none of them are related.

This is especially important after either:

  • Enough time has passed that you don't remember why you made the patch
  • The patch was made by a maintainer that is no longer active
  • The patch was made by a contributor that is no longer interested

In these situations, when an issue is found related to the patch the
person working in the area has to infer the purpose of the patch from
the context they have. The new work won't necessarily be a bug in the
original patch. It may add functionality that incidentally became an
important feature for some of our users, and the new work wishes to
change something related to that change.

The new work may be a bug fix that has a subtle interaction, so
determining if the first patch was a buggy (even if unintentionally so)
change, or more importantly how the change is buggy, will be difficult
to determine the less context we have.

By aggressively squashing commits we remove the commit messages that
contain that very important context. I see no reason to forbid
squashing commits in a way that makes the intent of the patch more
clear. On the other hand, encouraging it via a check-box on our PR form
may cause the loss of this important context when we need it.


Tasks:

  • Describe the problem / feature
  • Get code review from coworkers / friends

I will abide by the code of conduct.

Squashing commits may be helpful for small pull requests where the total
change is around 10—20 lines or two or three hunks.  With such a small
patch it's easy to infer intent in the future.

For larger patches it becomes increasingly difficult to determine why
the change was made when a single commit contains dozens of hunks where
none of them are related.

This is especially important after either:
* Enough time has passed that you don't remember why you made the patch
* The patch was made by a maintainer that is no longer active
* The patch was made by a contributor that is no longer interested

In these situations, when an issue is found related to the patch the
person working in the area has to infer the purpose of the patch from
the context they have.  The new work won't necessarily be a bug in the
original patch.  It may add functionality that incidentally became an
important feature for some of our users, and the new work wishes to
change something related to that change.

The new work may be a bug fix that has a subtle interaction, so
determining if the first patch was a buggy (even if unintentionally so)
change, or more importantly how the change is buggy, will be difficult
to determine the less context we have.

By aggressively squashing commits we remove the commit messages that
contain that very important context.  I see no reason to forbid
squashing commits in a way that makes the intent of the patch more
clear.  On the other hand, encouraging it via a check-box on our PR form
may cause the loss of this important context when we need it.
@segiddins
Copy link
Member

👍🏻 from me

@bronzdoc
Copy link
Member

@homu r+

@homu
Copy link
Contributor

homu commented Sep 24, 2016

📌 Commit f22239e has been approved by bronzdoc

homu added a commit that referenced this pull request Sep 24, 2016
Do not squash commits

# Description:

Squashing commits may be helpful for small pull requests where the total
change is around 10—20 lines or two or three hunks.  With such a small
patch it's easy to infer intent in the future.

For larger patches it becomes increasingly difficult to determine why
the change was made when a single commit contains dozens of hunks where
none of them are related.

This is especially important after either:
* Enough time has passed that you don't remember why you made the patch
* The patch was made by a maintainer that is no longer active
* The patch was made by a contributor that is no longer interested

In these situations, when an issue is found related to the patch the
person working in the area has to infer the purpose of the patch from
the context they have.  The new work won't necessarily be a bug in the
original patch.  It may add functionality that incidentally became an
important feature for some of our users, and the new work wishes to
change something related to that change.

The new work may be a bug fix that has a subtle interaction, so
determining if the first patch was a buggy (even if unintentionally so)
change, or more importantly how the change is buggy, will be difficult
to determine the less context we have.

By aggressively squashing commits we remove the commit messages that
contain that very important context.  I see no reason to forbid
squashing commits in a way that makes the intent of the patch more
clear.  On the other hand, encouraging it via a check-box on our PR form
may cause the loss of this important context when we need it.

______________

# Tasks:

- [x] Describe the problem / feature
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
@homu
Copy link
Contributor

homu commented Sep 24, 2016

⌛ Testing commit f22239e with merge 23f3d51...

@homu
Copy link
Contributor

homu commented Sep 24, 2016

☀️ Test successful - status

@homu homu merged commit f22239e into master Sep 24, 2016
@drbrain drbrain deleted the drbrain/no-squashed-commits branch September 24, 2016 20:17
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.

None yet

4 participants