Skip to content

Commit

Permalink
Added remove, track-branch and filemerge
Browse files Browse the repository at this point in the history
  • Loading branch information
dentarg committed Mar 21, 2009
1 parent 6ba3184 commit a79bb0f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
26 changes: 26 additions & 0 deletions git-filemerge
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
if test $# = 0; then
OLD=`git write-tree`
elif test "$1" = --cached; then
OLD=HEAD
NEW=`git write-tree`
shift
fi
if test $# -gt 0; then
OLD="$1"; shift
fi
test $# -gt 0 && test -z "$CACHED" && NEW="$1"
TMPDIR1=`mktemp -d`
git archive --format=tar $OLD | (cd $TMPDIR1; tar xf -)
if test -z "$NEW"; then
TMPDIR2=$(git rev-parse --show-cdup)
test -z "$cdup" && TMPDIR2=.
else
TMPDIR2=`mktemp -d`
git archive --format=tar $NEW | (cd $TMPDIR2; tar xf -)
fi

opendiff $TMPDIR1 $TMPDIR2 | cat
rm -rf $TMPDIR1
test ! -z "$NEW" && rm -rf $TMPDIR2

2 changes: 2 additions & 0 deletions git-remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
git ls-files --deleted -z | xargs -0 git rm
4 changes: 4 additions & 0 deletions git-track-branch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

branch_name=$1
git checkout --track -b ${branch_name} origin/${branch_name}

0 comments on commit a79bb0f

Please sign in to comment.