10th php indonesia surabaya meetup
DESCRIPTION
PHP Project Management With Git Subtree Split strategyTRANSCRIPT
![Page 1: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/1.jpg)
PHP Project ManagementPengenalan GIT Subtree Strategy
Taufan Adhitya2014-03-01 - Unitomo
![Page 2: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/2.jpg)
● Full time Father● Part time Lead Developer @Bizgym● Heinekken Caffeine Fans● Enterpreneur wanna-be● https://github.com/toopay
who is this guy?
![Page 3: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/3.jpg)
Apa yang akan kita bahas?
1. Mengenali tanda-tanda Project/Aplikasi Monolitik
2. Penggunaan Git Subtree Dalam Project Berskala Besar
![Page 4: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/4.jpg)
Mengenali tanda-tanda Project/Aplikasi Monolitik
![Page 5: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/5.jpg)
Mono(poli)tik??
Generally, a monolithic design is given when a software provides its functionality centralised in one huge boilerplate.
![Page 6: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/6.jpg)
Masalah buat loe?
● However, in case of providing a lot of functionality such an approach may lead to unclear or sleazy code as there is no clear separation to other areas of the software.
![Page 7: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/7.jpg)
Masalah buat loe?
● It is hard to manipulate or change existing code, also extensions may be hard to realize. So, developers are well advised to implement more flexible code when a certain dimension of functionality is reached.
![Page 8: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/8.jpg)
Tendensi Monolitik yang umum
● analysis paralysis● cargo cult programming● death march
![Page 9: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/9.jpg)
Penggunaan Git Subtree Dalam Project Berskala Besar
![Page 10: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/10.jpg)
GIT : Global Information Tracker
CLONEPULLREBASE
MERGEDIFFCOMMITPUSH
Git For Dummy
![Page 11: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/11.jpg)
GIT Mantra :
Sekarang aku bisa meng-undo kesalahanAku adalah Time-Traveler
![Page 12: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/12.jpg)
Ketika project bertendensi monolitik
Apa yang bisa kita lakukan dengan GIT?
![Page 13: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/13.jpg)
Git Submodule To The Rescue
Submodules allow foreign repositories to be embedded within a dedicated subdirectory of the source tree, always pointed at a particular commit.
![Page 14: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/14.jpg)
ARRGGGHH!!! And you call this as helpful idea?
![Page 15: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/15.jpg)
![Page 16: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/16.jpg)
Kenapa Git Submodule bisa menjadi Ide yang buruk?● Submodule sejatinya adalah clone baru dari
repository● Artinya kita harus memastikan sub-module
selalu update● Perubahan pada submodule tidak dapat
mengikuti git workflow (push tidak dapat dilakukan secara langsung)
![Page 17: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/17.jpg)
GIT now become….
Goddamn Idiotic Truckload of sh*t
![Page 18: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/18.jpg)
Wait…. Wait…
![Page 19: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/19.jpg)
Apa itu Git Subtree
The idea of the subtree merge is that you have two projects, and one of the projects maps to a subdirectory of the other one and vice versa.
![Page 20: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/20.jpg)
GIT Subtree In 5 lines
$ git remote add -f Bproject /path/to/B <1>$ git merge -s ours --no-commit Bproject/master <2>$ git read-tree --prefix=dir-B/ -u Bproject/master <3>$ git commit -m "Merge B project as our subdirectory" <4>$ git pull -s subtree Bproject master <5>
![Page 21: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/21.jpg)
GIT Subtree In 5 lines ● Name the other project "Bproject", and fetch.● Prepare for the later step to record the result as a
merge.● Read "master" branch of Bproject to the subdirectory
"dir-B".● Record the merge result.● Maintain the result with subsequent merges using
"subtree"
![Page 22: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/22.jpg)
![Page 23: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/23.jpg)
Subtree Strategy Benefits
● Share code without hurt your current work-flow
● All revisions history are intact● Provide clean, two-way communication
between shared code/repo
![Page 24: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/24.jpg)
Who uses this strategy?
● Symfony2● Zend Framework2● Laravel4● … and many more
● And probably you, in the near future!
![Page 25: 10th php indonesia surabaya meetup](https://reader034.vdocuments.net/reader034/viewer/2022051400/5593e99a1a28abe5538b46ca/html5/thumbnails/25.jpg)
Thats it!
Question Time!