Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Telling stories through your
commits
BY JOEL CHIPPINDALE AT LRUG IN JANUARY 2015
CC BY-SA 4.0
Not about Ruby
Not even about git
Managing complexity
by Cory Doctorow (CC BY-SA)
Your commit history is…
Kept forever
Always up to date
Searchable
$ git log --grep='Commit contents'
$ git log -S 'Diff contents'
$ git blame
“Every line of code is always
documented”
- Mislav Marohnić
from http://mislav.uniqpath.com/2014/02/hidden-documentation/
5 Principles
by Umberto Rotundo (CC BY)
1. Make atomic commits
by lupusphotos (CC BY)
$ git log --shortstat
commit: [REDACTED]
Author: [REDACTED]
Date: [REDACTED]
bug fixes and wp 4.0.1 update
1377 files chan...
What if this commit had
been split up?
21dfe89 Fix category page redirects
e275479 Fix deletion of author avatars
d824e02 Fix H2 headers on mobile
f8e36d4 Fix fo...
Minimum viable commit
Avoid ‘and’ in commit messages
Make atomic commits
so that you can
make sense of your commits
2. Write good commit messages
by Ginny (CC BY-SA)
What does good look like?
Short one line title
Longer description of what the change
does (if the title isn’t enough).
An explanation of why the cha...
Short one line title
Longer description of what the change
does (if the title isn’t enough).
An explanation of why the cha...
Short one line title
Longer description of what the change
does (if the title isn’t enough).
An explanation of why the cha...
Short one line title
Longer description of what the change
does (if the title isn’t enough).
An explanation of why the cha...
Short one line title
Longer description of what the change
does (if the title isn’t enough).
An explanation of why the cha...
Correct the colour of FAQ link in course notice footer
PT: https://www.pivotaltracker.com/story/show/84753832
In some emai...
Write good commit messages
(including why and the context)
so that you can
make sense of your commits
3. Revise history before sharing
by hoodedfang (CC BY-NC)
$ git rebase --interactive
Remove, reorder, edit,
merge and split commits
324d079 Fix typo in "Add Foo"
ab2189d Remove Bar
2a11e7d Add Foo
$ git rebase --interactive master
1bd241c Remove Bar
773e345 Add Foo
Rewrite history before sharing
so that your collaborators can
make sense of your commits
4. Use single purpose branches
by Jon Bennet (CC BY)
When you take a diversion
move the work off the branch
Use single purpose branches
so that you can
make sense of your current work
5. Keep your history linear
Rebase before you merge
$ git merge --no-ff
Keep your history linear
so that you can
make sense of it
1. Make atomic commits
2. Write good commit messages
3. Revise history before sharing
4. Use single purpose branches
5. Ke...
by beglen (CC BY)
Questions?
@joelchippindale
joel.chippindale@futurelearn.com
futurelearn.com/blog
CC BY-SA 4.0
Telling stories through your commits
Telling stories through your commits
Telling stories through your commits
Telling stories through your commits
Telling stories through your commits
Upcoming SlideShare
Loading in …5
×

Telling stories through your commits

1,428 views

Published on

Joel Chippindale, CTO at FutureLearn, shares some of the ways that you can improve how you develop code and communicate with your team through your commits.

This was given at LRUG's January meeting

Published in: Software
  • Be the first to comment

Telling stories through your commits

  1. 1. Telling stories through your commits BY JOEL CHIPPINDALE AT LRUG IN JANUARY 2015 CC BY-SA 4.0
  2. 2. Not about Ruby
  3. 3. Not even about git
  4. 4. Managing complexity by Cory Doctorow (CC BY-SA)
  5. 5. Your commit history is…
  6. 6. Kept forever
  7. 7. Always up to date
  8. 8. Searchable
  9. 9. $ git log --grep='Commit contents'
  10. 10. $ git log -S 'Diff contents'
  11. 11. $ git blame
  12. 12. “Every line of code is always documented” - Mislav Marohnić from http://mislav.uniqpath.com/2014/02/hidden-documentation/
  13. 13. 5 Principles by Umberto Rotundo (CC BY)
  14. 14. 1. Make atomic commits by lupusphotos (CC BY)
  15. 15. $ git log --shortstat commit: [REDACTED] Author: [REDACTED] Date: [REDACTED] bug fixes and wp 4.0.1 update 1377 files changed, 175405 insertions(+), 248 deletions(-)
  16. 16. What if this commit had been split up?
  17. 17. 21dfe89 Fix category page redirects e275479 Fix deletion of author avatars d824e02 Fix H2 headers on mobile f8e36d4 Fix footer floating bug d972537 Fix blog author avatar upload d26e788 Remove unused author pages 7b91091 Fix blog feed 2f05036 Fix mixed content warnings ed21e18 WordPress 4.0.1 update
  18. 18. Minimum viable commit
  19. 19. Avoid ‘and’ in commit messages
  20. 20. Make atomic commits so that you can make sense of your commits
  21. 21. 2. Write good commit messages by Ginny (CC BY-SA)
  22. 22. What does good look like?
  23. 23. Short one line title Longer description of what the change does (if the title isn’t enough). An explanation of why the change is being made. Perhaps a discussion of context and/or alternatives that were considered.
  24. 24. Short one line title Longer description of what the change does (if the title isn’t enough). An explanation of why the change is being made. Perhaps a discussion of context and/or alternatives that were considered.
  25. 25. Short one line title Longer description of what the change does (if the title isn’t enough). An explanation of why the change is being made. Perhaps a discussion of context and/or alternatives that were considered.
  26. 26. Short one line title Longer description of what the change does (if the title isn’t enough). An explanation of why the change is being made. Perhaps a discussion of context and/or alternatives that were considered.
  27. 27. Short one line title Longer description of what the change does (if the title isn’t enough). An explanation of why the change is being made. Perhaps a discussion of context and/or alternatives that were considered.
  28. 28. Correct the colour of FAQ link in course notice footer PT: https://www.pivotaltracker.com/story/show/84753832 In some email clients the colour of the FAQ link in the course notice footer was being displayed as blue instead of white. The examples given in PT are all different versions of Outlook. Outlook won't implement CSS changes that include `!important` inline[1]. Therefore, since we were using it to define the colour of that link, Outlook wasn't applying that style and thus simply set its default style (blue, like in most browsers). Removing that `!important` should fix the problem. [1] https://www.campaignmonitor.com/blog/post/3143/ outlook-2007-and-the-inline-important-declaration/
  29. 29. Write good commit messages (including why and the context) so that you can make sense of your commits
  30. 30. 3. Revise history before sharing by hoodedfang (CC BY-NC)
  31. 31. $ git rebase --interactive
  32. 32. Remove, reorder, edit, merge and split commits
  33. 33. 324d079 Fix typo in "Add Foo" ab2189d Remove Bar 2a11e7d Add Foo
  34. 34. $ git rebase --interactive master
  35. 35. 1bd241c Remove Bar 773e345 Add Foo
  36. 36. Rewrite history before sharing so that your collaborators can make sense of your commits
  37. 37. 4. Use single purpose branches by Jon Bennet (CC BY)
  38. 38. When you take a diversion move the work off the branch
  39. 39. Use single purpose branches so that you can make sense of your current work
  40. 40. 5. Keep your history linear
  41. 41. Rebase before you merge
  42. 42. $ git merge --no-ff
  43. 43. Keep your history linear so that you can make sense of it
  44. 44. 1. Make atomic commits 2. Write good commit messages 3. Revise history before sharing 4. Use single purpose branches 5. Keep your history linear
  45. 45. by beglen (CC BY)
  46. 46. Questions? @joelchippindale joel.chippindale@futurelearn.com futurelearn.com/blog CC BY-SA 4.0

×