MR config could be created programatically
Thomas Koch
thomas at koch.ro
Tue Feb 7 11:03:19 CET 2012
Hi,
deprecating my previous email and revealing to be incredibly lazy; Why not
create this repetitious mr config automatically?
#!/bin/sh
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
VCSH_MR_CONFIG_OVERRIDES=$XDG_CONFIG_HOME/vcsh/mr
VCSH_REMOTE_BASE=ssh://koch.ro/git/vcsh
VCSH_LOCAL_REPO_BASE=$XDG_CONFIG_HOME/vcsh/repo.d
for REPODIR in $(find .config/vcsh/repo.d -name "*.git" -type d)
do
REPO=$(basename $REPODIR .git)
if [ -r $VCSH_MR_CONFIG_OVERRIDES/$REPO ]
then
cat $VCSH_MR_CONFIG_OVERRIDES/$REPO
else
echo [${VCSH_LOCAL_REPO_BASE}/${REPO}.git]
echo checkout = vcsh clone ${VCSH_REMOTE_BASE}/${REPO}.git ${REPO}
echo update = vcsh run ${REPO} git pull
echo push = vcsh run ${REPO} git push
echo status = vcsh run ${REPO} git status
echo gc = vcsh run ${REPO} git gc
echo
fi
done
Notes:
- configuration can still be overriden by files in .config/vcsh/mr/REPO
- I've moved mr config to .config/vcsh/mr instead of .config/mr. I think the
latte namespace should be reserved to mr. What if I'm a committer of awesome
and want to configure the awesome git repo under .config/mr/awesome?
- VCSH should have a command or option to vcsh init to setup the remote
config of a git repo.
Thank you for VCSH,
Thomas Koch, http://www.koch.ro
More information about the vcs-home
mailing list