3 # this script works on a specialized type of git checkout that has been configured
4 # to push to a "downstream" repository, while still pulling from its normal origin.
5 # the downstream destination might be a github or sourceforge repository that is
6 # loaded from a personal repository or server.
8 # it is assumed that you have already added your ssh key to your github account.
10 # to set up the repository for relaying downstream, just do the normal checkout
11 # or clone on it from the real origin. for example:
13 # $ git clone git://feistymeow.org/feisty_meow feisty_relay
15 # change into that new directory:
17 # $ pushd feisty_relay
19 # and then add the downstream remote repository:
21 # # github example of add:
22 # $ git remote add downstream git@github.com:fredhamster/feisty_meow.git
24 # # sourceforge example of add:
25 # $ git remote add downstream ssh://fred_t_hamster@git.code.sf.net/p/feistymeow/trunk
27 # once the repository has been created, you can synch all updates that
28 # have been checked into the origin repository with the downstream version
29 # by running this command:
31 # push_repo_downstream ~/relay_repo_folder
33 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
34 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
36 # turn off occasionally troublesome setting before checkin.
42 if [ -z "$dir" ]; then
46 pushd "$dir" &>/dev/null
47 test_or_die "changing to directory: $dir"
48 tempfile=$(generate_rev_ctrl_filelist)
49 test_or_die "generating revision control file list"
51 perform_revctrl_action_on_file "$tempfile" do_careful_git_update
52 test_or_die "doing a careful update on: $tempfile"
54 # seems to be needed to cause a merge to be resolved.
55 git pull downstream master
56 # -m "unfortunate merge"
57 test_or_die "running the git pull downstream master"
59 # send our little boat down the stream to the dependent repository.
60 git push --tags downstream master
61 test_or_die "running the git push downstream master"