#!/bin/bash #------------------------------------------------------------------------------# # vi: set sw=4 ts=4 ai: ("set modeline" in ~/.exrc) # #------------------------------------------------------------------------------# #------------------------------------------------------------------------------# # V e r s i o n i n f o r m a t i o n # #------------------------------------------------------------------------------# # $Id:: git.expand 6 2011-03-09 14:16:37 tonk $: # # $Revision:: 6 $: # # $Author:: Ton Kersten $: # # $Date:: 2011-03-09 14:18:51 +0100 (Wed, 09 Mar 2011) $: # # $Hash:: a7cf322e43e58e4ed77ab58db4a876f32713c24f (tonk) $: # #------------------------------------------------------------------------------# # E n d o f v e r s i o n i n f o r m a t i o n # #------------------------------------------------------------------------------# len="${GIT_LEN:-66}" spc="$(printf "%80s" "")" who=${SUDO_USER:-${LOGNAME}} id1=$(git show -s --pretty=format:"%H (${who})") id2=$(git show -s --pretty=format:"%h %ci (%an)") id3=$(git show -s --pretty=format:"%h @%ct %aN%n") id1s="${id1}${spc}" id2s="${id2}${spc}" id3s="${id3}${spc}" sed -e 's!\([[:space:]]*\$[H]ash::\).*\$:!\1 '"${id1s:0:${len}}"'\$:!' \ -e 's!\([[:space:]]*\$[N]SId\).*\$!\1: '"${id2}"' \$!' \ -e 's!\([[:space:]]*\$[U]RL::\).*\$:!\1: '"${GIT_FNAME%% *} - ${id3}"' \$:!'