Skip to content

Instantly share code, notes, and snippets.

@arnaudjolly
Last active November 9, 2018 09:55
Show Gist options
  • Save arnaudjolly/13b665274699425ce772ad5fe6705cbd to your computer and use it in GitHub Desktop.
Save arnaudjolly/13b665274699425ce772ad5fe6705cbd to your computer and use it in GitHub Desktop.
Ptite démo d'un use case rencontré au taf (utilisant LearnGitBranchingJs.org)
{
"goalTreeString": "%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C1%22%2C%22id%22%3A%22master%22%2C%22remoteTrackingBranchID%22%3A%22o/master%22%7D%2C%22o/master%22%3A%7B%22target%22%3A%22C1%22%2C%22id%22%3A%22o/master%22%2C%22remoteTrackingBranchID%22%3Anull%7D%2C%22feature%22%3A%7B%22target%22%3A%22C5%27%22%2C%22id%22%3A%22feature%22%2C%22remoteTrackingBranchID%22%3A%22o/feature%22%7D%2C%22o/feature%22%3A%7B%22target%22%3A%22C6%22%2C%22id%22%3A%22o/feature%22%2C%22remoteTrackingBranchID%22%3Anull%7D%2C%22fixForMR%22%3A%7B%22target%22%3A%22C6%22%2C%22id%22%3A%22fixForMR%22%2C%22remoteTrackingBranchID%22%3A%22o/feature%22%7D%7D%2C%22commits%22%3A%7B%22C0%22%3A%7B%22parents%22%3A%5B%5D%2C%22id%22%3A%22C0%22%2C%22rootCommit%22%3Atrue%7D%2C%22C1%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C1%22%7D%2C%22C2%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C2%22%7D%2C%22C3%22%3A%7B%22parents%22%3A%5B%22C2%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C4%22%3A%7B%22parents%22%3A%5B%22C3%22%5D%2C%22id%22%3A%22C4%22%7D%2C%22C5%22%3A%7B%22parents%22%3A%5B%22C4%22%5D%2C%22id%22%3A%22C5%22%7D%2C%22C6%22%3A%7B%22parents%22%3A%5B%22C2%22%5D%2C%22id%22%3A%22C6%22%7D%2C%22C3%27%22%3A%7B%22parents%22%3A%5B%22C6%22%5D%2C%22id%22%3A%22C3%27%22%7D%2C%22C4%27%22%3A%7B%22parents%22%3A%5B%22C3%27%22%5D%2C%22id%22%3A%22C4%27%22%7D%2C%22C5%27%22%3A%7B%22parents%22%3A%5B%22C4%27%22%5D%2C%22id%22%3A%22C5%27%22%7D%7D%2C%22tags%22%3A%7B%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22feature%22%2C%22id%22%3A%22HEAD%22%7D%2C%22originTree%22%3A%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C1%22%2C%22id%22%3A%22master%22%2C%22remoteTrackingBranchID%22%3Anull%7D%2C%22feature%22%3A%7B%22target%22%3A%22C6%22%2C%22id%22%3A%22feature%22%2C%22remoteTrackingBranchID%22%3Anull%7D%7D%2C%22commits%22%3A%7B%22C0%22%3A%7B%22parents%22%3A%5B%5D%2C%22id%22%3A%22C0%22%2C%22rootCommit%22%3Atrue%7D%2C%22C1%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C1%22%7D%2C%22C2%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C2%22%7D%2C%22C6%22%3A%7B%22parents%22%3A%5B%22C2%22%5D%2C%22id%22%3A%22C6%22%7D%7D%2C%22tags%22%3A%7B%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22master%22%2C%22id%22%3A%22HEAD%22%7D%7D%7D",
"solutionCommand": "git checkout -b fixForMR o/feature;git commit;git push origin fixForMR:feature;git rebase fixForMR feature",
"startTree": "{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"o/master\":{\"target\":\"C1\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null},\"feature\":{\"target\":\"C5\",\"id\":\"feature\",\"remoteTrackingBranchID\":\"o/feature\"},\"o/feature\":{\"target\":\"C2\",\"id\":\"o/feature\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C3\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C4\"],\"id\":\"C5\"}},\"tags\":{},\"HEAD\":{\"target\":\"feature\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"feature\":{\"target\":\"C2\",\"id\":\"feature\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"}},\"tags\":{},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}}",
"name": {
"en_US": "Michou's rescue mission",
"fr_FR": "A la rescousse de Michou!"
},
"hint": {
"en_US": null
},
"startDialog": {
"en_US": {
"childViews": [
{
"type": "ModalAlert",
"options": {
"markdowns": [
"## Save Michou !",
"",
"",
"Michou made some commits on a branch and push it in order to create a Merge Request. The branch name is `feature`.",
"",
"He knows that this work will take a long time so he chooses to do it in multiple Merge Requests to ease the reviewer work.",
"",
"Confidant as usual, he simply continues his work and does some commits to prepare the next Merge Request that he secretly want to affect to another reviewer to share the fun.",
"",
"That's the starting point of this exercice."
]
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"## Shit happens",
"",
"The reviewer have comments on how the work is done and ask for a correction... ",
"",
"Your mission, if accepted, is to push the correction (represented by the `C6` commit that you'll create) on the remote branch used by the Merge Request.",
"",
"Once done and with the help of the `git rebase` command, you can apply the work you done before on top of the new commit.",
""
]
}
}
]
},
"fr_FR": {
"childViews": [
{
"type": "ModalAlert",
"options": {
"markdowns": [
"## A la rescousse de Michou!",
"",
"",
"Michou a quelques commits sur une branche qu'il pousse et soumet en Merge Request. Cette branche est la branche `feature` qui est poussée.",
"",
"Il sait que cela va être un gros travail et décide de faire plusieurs Merge Requests afin de faciliter la vie des relecteurs.",
"",
"Confiant, il continue donc à faire quelques commits locaux pour préparer la prochaine MergeRequest qu'il compte attribuer à un autre de ses collègues pour distribuer le fun.",
"",
"C'est le point de départ de ce niveau."
]
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"## Ce qui devait arriver arriva",
"",
"La relecture apporte des commentaires et demande une modification... ",
"",
"Votre mission est donc de pousser la modification demandée (représentée par un commit `C6` que vous créerez) sur la branche distante liée à la Merge Request de Michou.",
"",
"Une fois la modification poussée, à l'aide d'un `rebase`, réappliquez vos nouveaux commits sur le commit de la modification demandée.",
""
]
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment