-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit.collapse
executable file
·22 lines (20 loc) · 1.33 KB
/
git.collapse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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.collapse 5 2011-03-09 14:16:28 tonk $: #
# $Revision:: 5 $: #
# $Author:: Ton Kersten <[email protected]> $: #
# $Date:: 2011-03-09 14:18:49 +0100 (Wed, 09 Mar 2011) $: #
# $Hash:: $: #
#------------------------------------------------------------------------------#
# 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" "")"
sed -e 's!\([[:space:]]*\$[H]ash::\).*\$:!\1 '"${spc:0:${len}}"'\$:!' \
-e 's!\([[:space:]]*\$[N]SId\).*\$!\1\$!' \
-e 's!\([[:space:]]*\$[U]RL::\).*\$:!\1\$:!'