Skip to content

Instantly share code, notes, and snippets.

@kytvi2p
Forked from chris-barry/monotone.sh
Created November 12, 2015 14:06
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 kytvi2p/853160e8f25f9c17d502 to your computer and use it in GitHub Desktop.
Save kytvi2p/853160e8f25f9c17d502 to your computer and use it in GitHub Desktop.
#!/bin/sh
# monotone.sh - Because monotone sucks
#
# free (adj.): unencumbered; not under the control of others
# Written by lazygravy in 2015 and released into the public domain
# with no warranty of any kind, either expressed or implied.
# It probably won't make your computer catch on fire, or eat
# your children, but it might. Use at your own risk.
#
#
# By default monotone kinda sucks and doesn't work like you think it should.
# These wrapper functions make it behave more like git, kinda.
# Reference: https://geti2p.net/en/get-involved/guides/monotone
#
# Note: Pulling and checking out code are intentionally done without a
# username set. This is so that everyone pulling is anonymous.
#
# This assumes that you are using one folder for all monotone resources, and
# that you are running the script from within one of the source folders.
#
# i2p
# - i2p.i2p <-- run script from here
# - i2p.www <-- or here
# - i2p.scripts
DB=i2p.mtn
SERVER="mtn://127.0.0.1:8998"
USERNAME=foo@mail.i2p
USERNAME_TRANSPORT=foo-transport@mail.i2p
mtn-pull() {
REPO=$(basename $(pwd))
cd ..;
mtn --db="$DB" -k\"\" pull \"$SERVER?$REPO\";
cd $REPO;
mtn update;
}
mtn-push() {
REPO=$(basename $(pwd));
cd ..;
mtn push -k\"$USERNAME_TRANSPORT\" \"$SERVER?$REPO\";
cd -;
}
mtn-init() {
mtn --db="$DB" db init
}
mtn-commit() {
mtn commit -k\"$USERNAME\" $@;
}
mtn-clone() {
mtn clone -k\"\";
}
mtn-log() {
mtn log | less;
}
mtn-import-keys() {
mtn --db="$DB" read < keys.txt
}
# undo one commit -- http://zzz.i2p/topics/764
mtn-undo() {
mtn up -r p:
mtn local kill_revision h:
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment