ozeias (owner)

Fork Of

Revisions

gist: 114801 Download_button fork
public
Public Clone URL: git://gist.github.com/114801.git
Embed All Files: show embed
Hack sink and ship.sh #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Variation on Hashrocket's script for managing the git process
# as documented here: http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
# Create shell scripts out of each of these, put them in your path (~/bin for example)
# chmod 755 them and use like this:
#
# This version of hack is totally different than Hackrockets. I feel that hack implies
# that you are getting started, not finishing up. sink is Hashrockets hack.
#
# $ hack branch_name
# Test and Implement until done
# $ sink && rake
# $ ship
#
# An editor will be displayed with all of the commit messages allowing you to make one giant
# combined commit (merge --squash). Add the story (from xp) to the top and save.
#
# If any step fails, the && will prevent the next step from moving executing
# btw, sink == sync, sync is taken and I like the double entendre anyway
 
# CHANGELOG
# Implementing squash in ship
# Making changes so that the commands are more error proof
 
# hack
 
#!/bin/sh -x
git checkout master
git pull origin master
git checkout -b $1 master
 
# sink
 
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
git checkout master
git pull origin master
git checkout ${CURRENT}
git rebase master ${CURRENT}
 
# ship
 
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
git checkout master
git merge --squash ${CURRENT} && git commit -a -v && git push origin master