Ms. Manners' Guide to Excruciatingly Correct Github Pull Requests

Posted on March 23, 2016 by Tommy McGuire
Labels: software development, link

File this one with stuff I will need to know in the future but will probably have forgotten again.

Pony and Rust (and probably every other project that I haven't interacted with) using Github and pull requests want those pull requests to consist of a single commit. From Steve Klabnik, here's a short post on How to squash commits in a GitHub pull request, how to convert the messy stream-of-consciousness style of normal development into a neat and tidy package. It may even sort of work for most people.

For me, however, I ended up with a bunch of "merge from upstream/master" commits where I'd pulled in current updates. To create a decent pull request, I

  1. creating a new branch off of upstream/master,
  2. on the original working branch, ran git diff upstream/master > /tmp/patch to get the changes I wanted, editing it to clear out anything I didn't want, like that extra newline in packages/builtin/primitive.pony,
  3. on the new branch, applied the patch and committed it with a simple, yet beautiful, message, and
  4. pushed it to Github and created the pull request.

You know what they say, if all you have is a hammer, everything else is a usable nail.

And in other news, here is How to Write a Git Commit Message.

active directory applied formal logic ashurbanipal authentication books c c++ comics conference continuations coq data structure digital humanities Dijkstra eclipse virgo electronics emacs goodreads haskell http java job Knuth ldap link linux lisp math naming nimrod notation OpenAM osgi parsing pony programming language protocols python quote R random REST ruby rust SAML scala scheme shell software development system administration theory tip toy problems unix vmware yeti
Member of The Internet Defense League
Site proudly generated by Hakyll.