managing remotes collaboratively with mr

Yaroslav Halchenko lists at onerussian.com
Sat Apr 30 02:15:31 CEST 2011


just my 0.1 cents since now it is not recommended way per se since iirc
mr got proper actions (RTFM ;-) ) to be defined to run for such purposes, but
for one of the projects I have done following:
https://github.com/nipy/nipy-suite/blob/master/.mrconfig

[DEFAULT]
lib =
    export NIPY=git://github.com/nipy
    git_assure_remote() {
        remote="$1"
        url="$2"
        git remote | grep -q "^$remote$" || {
            echo I: Adding remote $remote
            git remote add "$remote" "$url"
            git fetch "$remote"
        }
    }
    git_assure_gh_clones() {
        # Since all clones on github are uniformly organized
        # we can shortcut it
        project=$1
        shift
        for login in $*; do
            git_assure_remote $login git://github.com/$login/$project.git
        done
    }

....
[nibabel]
checkout = git clone "${NIPY}/nibabel.git"
update =
       git_fetch_all
       git_assure_gh_clones nibabel hanke matthew-brett


Cheers

On Fri, 29 Apr 2011, micah anderson wrote:
> But what if someone adds a new remote? Because I put things in the
> .mrconfig as a 'post_checkout' the new remote will not be added to the
> git repository. I could add the remotes twice, in a post_checkout (for
> the new person who wants to get them all) and then also as a pre_update,
> but that seems a bit ugly.

> Thanks for any ideas, or better ways to do this!
> micah
-- 
=------------------------------------------------------------------=
Keep in touch                                     www.onerussian.com
Yaroslav Halchenko                 www.ohloh.net/accounts/yarikoptic


More information about the vcs-home mailing list