Skip to content

Commit 7954d73

Browse files
committed
add write-stream-info
1 parent fc3b5ab commit 7954d73

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

git-write-stream-info

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/sh
2+
3+
. git-sh-setup
4+
5+
git_branch()
6+
{
7+
git branch | grep '*' | sed 's/..//'
8+
}
9+
10+
date=$(date +%Y-%m-%d--%H-%M)
11+
12+
where=$GIT_DIR/streams
13+
14+
if test ! -d $where
15+
then
16+
mkdir $where
17+
fi
18+
19+
if test -z $1
20+
then
21+
from=svn
22+
else
23+
from=$1
24+
fi
25+
26+
if test -z $2
27+
then
28+
to=$(git_branch)
29+
else
30+
to=$2
31+
fi
32+
33+
file_name=$from-$to---$date
34+
file=$where/$file_name
35+
last=$where/last
36+
37+
echo "git log $from^..$to:" > $file
38+
git log --name-status --decorate --color $from^..$to >> $file
39+
echo "" >> $file
40+
echo "---" >> $file
41+
echo "" >> $file
42+
echo "git stash list:" >> $file
43+
git stash list | ruby -p -e '$_.sub!(/stash\@\{0\}/){|rev| "#{rev.chomp}:#{`git rev-parse #{rev}`.chomp}"}' >> $file
44+
45+
if [ -f "$last" ]; then
46+
rm $last
47+
fi
48+
ln -s $file_name $last

0 commit comments

Comments
 (0)