Frage

I am trying to teach good engineering practices to my team, and in particular, walking them through the basics of PRs and code reviews on GitHub. One of my team members has sent me a request to review his PR, but has added a commit message without any detail, and so I would like to kick it back to him for a better commit message. There doesn't seem to be a way to do this directly in GitHub. I could just add a "Request Changes" with a general comment on the commit message and ask him to fix it, but how should I tell him to do this? I know it's possible to do this as a git commit --amend followed by a git push --force, but the docs also say that this is really bad practice for a commit that's already been pushed, and I don't want to teach any bad habits. What's the best way to fix this?

War es hilfreich?

Lösung

You are correct, there is no way to change the commit message without redoing the commit and presumably the branch has now been shared for code review purposes.

You could get them to redo the work in a new branch and do a new PR on that, but it sounds super unproductive.

Presumably as the team is new to the process, mistakes will be made. You are just going to have to let this one slide.

Also, although commit messages are useful, really you shouldn't be relying on them for documentation. I would not include them in code review. Ask the dev to add comments to the code, update the documentation, link to the ticket etc etc

Lizenziert unter: CC-BY-SA mit Zuschreibung
scroll top