On Tue, Jan 19, 2016 at 5:45 AM, Brett Cannon <br...@python.org> wrote:
> I don't quite follow this. If you do a ff + rebase for the final commit how
> does that affect the hash of the final commit? Or what if you take a patch,
> apply it, and as part of the `git commit` command you specify the author on
> the command-line? I understand how it would change things if we were
> updating a pre-existing Git repository, but I'm only talking about future
> commits and not necessarily trying to retroactively do this for the direct
> migration of a repository.

Not sure what you mean by a rebase here. There's two possibilities:

1) The PR is based on what's exactly the current branch head. In that
case, you can do a fast-forward.

2) The PR is *not* based on the current branch head (because something
else got pushed already). A fast-forward is not possible.

In case #2, the normal two options are either a merge commit (GitHub's
default, and non-linear history), or rebasing the PR's commits on top
of the current branch head, which is pretty much a matter of turning
them into patch files and applying those patches as if they'd just
been committed. This creates new commit hashes with the committer
name/email and date set by the person who does the rebase - and then
allows them to be fast-forwarded into the main branch.

In case #1, though, there is no rebase necessary. You can have linear
history by fast-forwarding. But in that case, the committer would be
the person who put it onto the PR, not the one who pushed it to the
official repo. To ensure that the committer field is *always* updated,
you would need to rebase (or amend, aka "mini rebase") the commits,
seemingly unnecessary in git terms, but important for repo integrity.

It wouldn't be hard to write a pre-receive hook that validates the
commits and ensures that everyone listed in the Committer field is,
indeed, a valid committer.

ChrisA
_______________________________________________
core-workflow mailing list
core-workflow@python.org
https://mail.python.org/mailman/listinfo/core-workflow
This list is governed by the PSF Code of Conduct: 
https://www.python.org/psf/codeofconduct

Reply via email to