Upload
taufan-aditya
View
1.257
Download
1
Embed Size (px)
DESCRIPTION
PHP Project Management With Git Subtree Split strategy
Citation preview
PHP Project ManagementPengenalan GIT Subtree Strategy
Taufan Adhitya2014-03-01 - Unitomo
● Full time Father● Part time Lead Developer @Bizgym● Heinekken Caffeine Fans● Enterpreneur wanna-be● https://github.com/toopay
who is this guy?
Apa yang akan kita bahas?
1. Mengenali tanda-tanda Project/Aplikasi Monolitik
2. Penggunaan Git Subtree Dalam Project Berskala Besar
Mengenali tanda-tanda Project/Aplikasi Monolitik
Mono(poli)tik??
Generally, a monolithic design is given when a software provides its functionality centralised in one huge boilerplate.
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.
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.
Tendensi Monolitik yang umum
● analysis paralysis● cargo cult programming● death march
Penggunaan Git Subtree Dalam Project Berskala Besar
GIT : Global Information Tracker
CLONEPULLREBASE
MERGEDIFFCOMMITPUSH
Git For Dummy
GIT Mantra :
Sekarang aku bisa meng-undo kesalahanAku adalah Time-Traveler
Ketika project bertendensi monolitik
Apa yang bisa kita lakukan dengan GIT?
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.
ARRGGGHH!!! And you call this as helpful idea?
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)
GIT now become….
Goddamn Idiotic Truckload of sh*t
Wait…. Wait…
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.
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>
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"
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
Who uses this strategy?
● Symfony2● Zend Framework2● Laravel4● … and many more
● And probably you, in the near future!
Thats it!
Question Time!