Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. set -x -e
  4.  
  5. # In the beginning there was nothing, just hopes, dreams,
  6. # a modest development budget.
  7.  
  8. mkdir -p demo
  9. cd demo
  10. git init .
  11.  
  12. # Then there was the initial commit
  13.  
  14. echo "hello app world" > app
  15. git add app
  16. git commit -m "initial commit"
  17.  
  18. # Then there was an MVP:
  19.  
  20. echo "mvp" >> app
  21. git add app
  22. git commit -m "implement mvp"
  23.  
  24. # The MVP was not Good, but it was released anyway.
  25.  
  26. # Our heroes had the discipline to tag the version they released:
  27.  
  28. git tag "release/0"
  29.  
  30. # A new feature was designed and developed incorporating the
  31. # knowledge gained from watching the users' optimistic attempts
  32. # to use the MVP
  33.  
  34. echo "amazing new feeture" >> app
  35. git add app
  36. git commit -m "add amazing new feature"
  37.  
  38. # The new version with the new feature was released.
  39. # Our brave heroes are getting some rhythm going now.
  40. # Look at that cycle time.
  41.  
  42. # Again, the release was tagged for traceability:
  43.  
  44. git tag "release/1"
  45.  
  46. # But alas: the amazing new feature injected a bug that was
  47. # not discovered before it was inflicted upon the users!
  48.  
  49. # Our brave heroes scramble to prepare a hotfix release:
  50.  
  51. git checkout "release/1"
  52. git checkout -b hotfix
  53. sed -i "s/feet/feat/g" app
  54. git add app
  55. git commit -m "apply emergency patch"
  56.  
  57. # The hotfix is ready on a feature branch.
  58.  
  59. # Our heroes merge the hotfix atop the existing "release/1" !
  60.  
  61. git merge "release/1"
  62.  
  63. # Again, for traceability, they tag the hotfix release:
  64.  
  65. git tag "release/1.1"
  66.  
  67. # Phew! Close one! Good work.
  68.  
  69.  
  70. # Now, within the context of the above example, here are some git trivia questions:
  71. #
  72. # Q1 (1 point) Does the commit pointed to by "release/1" contain the emergency fix? (Yes/No)
  73. #
  74. # Q2 (2 points) Explain the reasoning behind your answer to Q1.
  75. #
  76. # Q3 (1 point) Does the above behaviour make you happy? (Yes/No)
  77. #
  78. # Q4 (2 points) Explain what assumptions would need to change for you to give the
  79. # opposite answer to question Q1. Or explain why this is not possible.
  80. #
  81. # Q5 (1 point) Does the commit pointed to by "release/1.1" contain the emergency fix? (Yes/No)
  82. #
  83. # Q6 (2 point) Explain the reasoning behind your answer to Q5.
  84. #
  85. # Q7 (bonus 1 point) If you do these kinds of operations via the Github UI, rather than via the Git
  86. # command line interface, do you get the same result? Explain your reasoning.
  87. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement