What's the done thing regarding making updates to a PR on someone else's project? Do a git reset, make the changes, re-commit and force push? Or make a following commit and let the maintainers squash and merge?

Question's not clear to me: is it your PR? Why so you want to reset, can't you just fix stuff in a new commit?
Maybe looking at PRs and reviews in some big projects on GitHub would help you...

@tfardet My PR on somebody else's repository. I often see the maintainers of projects asking people submitting PRs to squash their commits, so I wondered if that was something to do at the end of a PR (following reviews and updates), or for each commit (and therefore instead of pushing subsequent commits).

But yep your last idea - looking at larger projects will definitely help. I'll do that!

@mcol ok, I get it: the idea of squashing is to keep the git history as readable as possible (nobody cares that I misspelled something 3 times in a row and failed to correct it properly) by having a single commit for the new feature implemented in the PR.

@mcol I think, GitHub now allows admin to directly squash while preserving the information about the developer's contribution (check again), the advantage of doing it that way is that it avoids useless merge commits.
If that does not work, to preserve the visibility of the contributor and the readability of the commit list, you squash and they merge (otherwise only the admin appears as author of the automatically squashed commit).

@tfardet Yeah I suppose the most logical way would be to add follow-up commits during revision, without squashing, and have the admin squash at the end during merge, while preserving authorship information. Though that would have to be implemented by the git repository host. I wonder how others do it. Perhaps they don't care about preserving the PR revision history, so just have the contributor squash for merge.

Sign in to participate in the conversation

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.