Skip to content

Instantly share code, notes, and snippets.

@kosaki
Created August 14, 2014 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kosaki/2e617729d03dd789c0f2 to your computer and use it in GitHub Desktop.
Save kosaki/2e617729d03dd789c0f2 to your computer and use it in GitHub Desktop.
#!/bin/zsh
# see https://github.com/shyouhei/ruby/wiki/committerhowto
# see http://shyouhei.tumblr.com/post/997747981/ruby-svn-git-gateway
# see http://blogs.atlassian.com/2013/12/git-svn-tips-and-tricks/
./yum-install-if-not-exist.sh git subversion git-svn screen
./install-gtags.sh
./install-gnulib.sh
mkdir -p ~/src
cd ~/src
if [ ! -d ruby ]
then
git clone git@github.com:ruby/ruby.git
(cd ruby; gtags &)
fi
cd ruby
# setup git-svn
grep svn-remote .git/config > /dev/null
if [ "$?" != 0 ]
then
echo git svn init
git svn init -s --prefix=origin/ svn+ssh://svn@ci.ruby-lang.org/ruby
echo git svn fetch
git svn fetch --quiet --parent # --parent dramatically improve fetch speed
# refrect svnignore to git
echo update .git/info/exclude
git svn show-ignore >> .git/info/exclude
# http://d.hatena.ne.jp/nurse/20100413
# use merge-changelog driver in gnulib
# your ~/.gitconfig must have [merge "merge-changelog"] section (see above URL)
echo update .git/info/attributes
echo ChangeLog merge=merge-changelog >> .git/info/attributes
fi
# add "PB memo" comment as git note
# http://www.callcc.net/diary/20111212.html#p01
grep k-tsj .git/config > /dev/null
if [ "$?" != 0 ]
then
cat <<EOF >> .git/config
[core]
# デフォルトで参照するnotes。この設定はせずに"git log --show-notes=ruby-trunk-changes"とする方法もあり。
notesRef = refs/notes/ruby-trunk-changes
[remote "k-tsj"]
# notesのfetch先。
fetch = +refs/notes/*:refs/notes/*
url = git://github.com/k-tsj/ruby.git
EOF
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment