Vladimir's Bauble

git

This is an email sent to Transcript Associates team on 1/27/2015 There aren't several philosophical approaches to using git, but there are certain principles which everyone has to learn and practice: 1. Frequently merge the code from the origin repo into your local repo, so that any merge conflicts are caught as soon as possible. By frequently I mean many times per day, every day. 2. Never push incomplete/broken code to the origin repo. The origin repo should always be in a stable state, ready to be deployed. Only push code you've thoroughly tested and know to be bug-free. 3. Push your changes to the origin repo frequently. If you're working on a large project which involves many changes throughout the system, then rather than having a single huge commit, see if you can break it into self-sufficient pieces and commit them individually. For example, I'm currently working on a new Users page, but in the process I ended up refactoring some things and committed them immediately, so the recent commit history looks something like: commit 631816cc1e672d0c36797683606e73e0fc24a9c0 Author: Vladimir Kornea Date: Thu Jan 22 08:29:07 2015 -0500 Make HtmlPageShell::unauthorized() behave the same as an allow_feature() fail. This involves refactoring jtHTTPRequest::writeMenu() to getMenuMarkup() so it can be called from StandardPageShell. Also made all methods of jtHTTPRequest static and stopped needlessly instantiating the class. commit 367506ab24db5892b9d9de1027fd49c2ffc81fd0 Author: Vladimir Kornea Date: Thu Jan 22 07:46:34 2015 -0500 Set limit to number of AJAX errors reported per page https://trello.com/c/BreSelP8 commit 27d09fbc0de1f1456725d4648745d3047971013f Author: Vladimir Kornea Date: Wed Jan 21 13:02:08 2015 -0500 UserModel: adds setPermissions(), sendWelcomeEmail(), sendResetPasswordEmail() and updates related files: ajax/jobs.php, ajax/users.php, includes/change_password.php, lib/custom.php 4. Name your commits descriptively, you are writing for people to read them and understand them. 5. Take your time to get to know git so you can do all this. This deserves its own mention because git is difficult to learn, and you might be tempted to skate by with a superficial understanding of it. It took hours to figure this out initially, but now I do something like it all the time: http://www.kornea.com/git-commit-to-different-branch 6. Feel free to ask me for help. Try Google and Stackoverflow first, of course, but some things can be surprisingly difficult to find about git, and odds are I already know how to do it.
Copyright Vladimir Kornea