]> git.madduck.net Git - code/myrepos.git/blob - mrconfig.complex

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

another example of fixups hook
[code/myrepos.git] / mrconfig.complex
1 # An example config file for the mr(1) command.
2 #
3 # This is fairly close to the config file used by the author
4 # although slightly cut down.
5
6 [DEFAULT]
7 # Include all available libs.
8 include = cat /usr/share/mr/* 2>/dev/null || true
9 # Teach mr to run a few git and svn specific commands.
10 svn_cleanup = svn cleanup "$@"
11 git_gc = git gc "$@"
12 git_tag = git tag -l
13 svn_tag = svn ls "$(LC_ALL=C svn info . | grep -i ^URL: | cut -d ' ' -f 2 | sed -e 's/trunk/tags/')"
14 # I prefer to git-svn rebase to fetch
15 git_svn_update = git svn rebase
16 # This hack is here because git pull stupidly outputs tag info to stderr.
17 # Shut it up but let real errors through, for use in cron.
18 quietupdate = mr -s -n update 3>&1 1>/dev/null 2>&3 | egrep -v '(storing tag|tag: )' || true
19 # Tests used below.
20 # - anon checks whether this is an anonymous checkout, by testing what url
21 #   $HOME uses
22 # - full checks whether I probably want a full checkout (quite large),
23 #   if not, the checkout is minimal
24 # - on checks whether the given host basename is one of the listed
25 #   values. A value can also have a username in it, ie "joey@dodo".
26 # - mylaptop only succeeds if it's on my main development laptop, which 
27 #   gets lots of extra cruft
28 lib = 
29         hostname="$(hostname)"
30         whoami="$(whoami)"
31         anon() {
32                 ( GIT_CONFIG=$HOME/.git/config git config remote.origin.url || cat .git/remotes/origin ) | grep -q 'git://'
33         }
34         full() {
35                 test "$whoami" = joey && ! anon
36         }
37         on() {
38                 for host in $@; do
39                         if [ "${host%@*}" != "${host#*@}" ]; then
40                                 if [ "$whoami" != "${host%@*}" ]; then
41                                         continue
42                                 fi
43                                 host="${host#*@}"
44                         fi
45                         if [ "$hostname" = "$host" ]; then
46                                 return 0
47                         fi
48                 done
49                 return 1
50         }
51         mylaptop() {
52                 on joey@gnu
53         }
54
55 # The root of my home directory.
56 [.]
57 order = 1
58 checkout =
59         if anon; then
60                 git clone git://git.kitenet.net/joey/home joey
61         else
62                 git clone ssh://git.kitenet.net/srv/git/kitenet.net/joey/home joey
63         fi
64
65 [Maildir]
66 # Dummy target to create Maildir. Doesn't run offlineimap since I have that
67 # cronned on machines where I want it.
68 update = :
69 skip = ! full
70 checkout = mkdir Maildir Maildir/cur Maildir/new Maildir/tmp; chmod 700 Maildir
71 status = :
72
73 [mail]
74 checkout = git clone ssh://joey@git.kitenet.net/srv/git/joey/private/mail
75 # I use mairix to index my mail archive; keep its index up-to-date.
76 fixups = if [ "$(which mairix)" ]; then ionice -c 3 mairix -Q; fi
77 skip = ! mylaptop
78
79 [tmp]
80 # This is a dummy target, all it does is run fixups at the end of
81 # an update.
82 fixups = $HOME/bin/fixups
83 checkout = mkdir -p $HOME/tmp
84 status = :
85 order = 25
86
87 [.etc]
88 order = 2
89 checkout = 
90         if anon; then
91                 git clone git://git.kitenet.net/joey/home-etc .etc
92         else
93                 git clone ssh://git.kitenet.net/srv/git/kitenet.net/joey/home-etc .etc
94         fi
95
96 [.cron]
97 checkout =
98         if anon; then
99                 git clone git://git.kitenet.net/joey/cron .cron
100         else
101                 git clone ssh://git.kitenet.net/srv/git/kitenet.net/joey/cron .cron
102         fi
103
104 [packages/perl]
105 order = 30
106 checkout = svn co svn+ssh://joeyh@svn.debian.org/svn/pkg-perl/trunk perl
107 skip = ! mylaptop || ([ "$1" = update ] && ! hours_since "$1" 12)
108
109 [linux-2.6]
110 order = 20
111 checkout = git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
112 skip = ! mylaptop || ([ "$1" = update ] && ! hours_since "$1" 12)
113 push = error "as if!"
114
115 [/etc]
116 # I use etckeeper to keep /etc in git. But it only works if I'm root, 
117 # and if it's not already in etc, skip it.
118 skip = ! test -d /etc/.git || ! test "$(whoami)" = root
119
120 [dpkg]
121 # A merge of the upstream dpkg git repo and my own personal branch.
122 checkout = 
123         git clone git://git.debian.org/git/dpkg/dpkg.git &&
124         cd dpkg &&
125         git remote add kite ssh://git.kitenet.net/srv/git/kitenet.net/dpkg &&
126         git fetch kite &&
127         git checkout -b sourcev3 kite/sourcev3
128 update = git pull origin master && git pull kite sourcev3
129 commit = git commit -a && git push kite
130 push = git push kite
131 skip = ! mylaptop
132
133 [html/www.debian.org]
134 # Still in CVS..urk!
135 checkout = cvs -d ':ext:joeyh@cvs.debian.org:/cvs/webwml' co -d www.debian.org webwml
136 # cvs sucks sufficiently that I prefer to run these commands by hand,
137 # and only rarely
138 update = echo "skipping cvs update (too slow)"
139 status = echo "skipping cvs status (too ugly)"
140 skip = ! mylaptop || ! full