Git Aliases

Adding an alias to your git config to display a graphical branch view is as easy as issuing the following command:

$ git config --global alias.cglog log --graph \
 --pretty=format:%Cgreen%h%x09%Cblue%aN%x09%Cred%ad%x09%Creset%s --date=short

You could also manually add the following to your .gitconfig in the [alias] section:

[alias]
  cglog = log --graph --pretty=format:%Cgreen%h%x09%Cblue%aN%x09%Cred%ad%x09%Creset%s --date=short

Displays as:

Testing Email in Drupal with Behat

Adding the following to a FeatureContext.php will provide basic functionality to test for an email message sent to the current user and check for a partial subject match.  It changes the existing mail system to one that stores mail in Drupal's state allowing us to iterate through the messages sent without having to implement an email client.

Git auto-completion in bash

This was another one of those tips that I wish I had found long, long ago.  It gets tiring typing branch names over and over again, but thanks to git's bash auto-completion script I no longer have to.

The bash completion script is stored at /etc/bash_completion.d in Ubuntu, other distributions might store it in a different location.  Add the following lines to your ~/.bashrc file:

Teaching git to (rerere)resolve Merge Conflicts

Reuse Recorded Resolution

If only I knew about this sooner.  After repeatedly resolving the same merge conflicts over and over while merging in long-lived feature branches, I found rerere. Rerere saves your merge resolutions and automatically reapplies them the next time you encounter the same conflicts.  Once enabled it works behind the scenes without you needing to change the way you work.

To enable:

$ git config --global rerere.enabled true

Then merge in feature branch:

.vimrc

set tabstop=2
set shiftwidth=2
set autoindent
set smartindent
set expandtab

if has ("autocmd")
  augroup module
    autocmd BufRead,BufNewFile *.module  set filetype=php
    autocmd BufRead,BufNewFile *.install set filetype=php
    autocmd BufRead,BufNewFile *.test    set filetype=php
    autocmd BufRead,BufNewFile *.inv     set filetype=php
    autocmd BufRead,BufNewFile *.profile set filetype=php
    autocmd BufRead,BufNewFile *.view    set filetype=php
  augroup END
endif

syntax off

colorscheme elflord

 

Subscribe to