aboutsummaryrefslogtreecommitdiff
path: root/metadot
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-03-21 20:19:37 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-03-21 20:19:37 -0300
commit98023ba5774594e86062c8a86781c87dbc2d9e42 (patch)
tree67462d02b59db2bb97c6263c5f70ca30733764ab /metadot
parent489c2b3b867cd1c2e5de2a97557137ce888a1053 (diff)
downloadmetadot-98023ba5774594e86062c8a86781c87dbc2d9e42.tar.gz
metadot-98023ba5774594e86062c8a86781c87dbc2d9e42.tar.bz2
Renames README
Diffstat (limited to 'metadot')
-rwxr-xr-xmetadot42
1 files changed, 34 insertions, 8 deletions
diff --git a/metadot b/metadot
index 011091c..1e52913 100755
--- a/metadot
+++ b/metadot
@@ -39,6 +39,9 @@ MODULES="$DOT/modules"
BACKUPS="$DEST/.backups/$DATE"
DEFAULT="https://git.fluxo.info/rhatto/dotfiles"
+# Make sure we're running git directly and not any existing wrapper
+GIT="/usr/bin/git"
+
# Backup a file
function metadot_backup {
local file="$DEST/$1"
@@ -146,17 +149,31 @@ function metadot_create {
echo "Metadot skeleton module $1 created at $MODULES/$1"
}
-# Update your dotfiles
-function metadot_update {
+# Fetch dotfiles
+function metadot_fetch {
if [ -d "$DOT/.git" ]; then
- ( cd $DOT && git pull origin master && git submodule update --init --recursive )
- else
- for module in `ls $MODULES`; do
- ( cd $MODULES/$module && git pull origin master && git submodule update --init --recursive )
- done
+ ( cd $DOT && $GIT fetch --all && $GIT log --show-signature -n 1 --branches=origin/master )
+ fi
+}
+
+# Merge
+function metadot_merge {
+ if [ -d "$DOT/.git" ]; then
+ ( cd $DOT && $GIT merge origin/master && $GIT submodule update --init --recursive )
fi
}
+# Update your dotfiles
+#function metadot_update {
+# if [ -d "$DOT/.git" ]; then
+# ( cd $DOT && git pull origin master && git submodule update --init --recursive )
+# else
+# for module in `ls $MODULES`; do
+# ( cd $MODULES/$module && git pull origin master && git submodule update --init --recursive )
+# done
+# fi
+#}
+
# Basic usage
function metadot_usage {
echo "usage: $BASENAME <option> [arguments]"
@@ -272,7 +289,16 @@ function metadot_ls_bundle {
# Display version
function metadot_version {
- ( cd $DOT && git log --show-signature -n 1 )
+ echo "master branch:"
+ echo "=============="
+ echo ""
+ ( cd $DOT && $GIT log --show-signature -n 1 )
+
+ echo ""
+ echo "origin/master branch:"
+ echo "====================="
+ echo ""
+ ( cd $DOT && $GIT log --show-signature -n 1 --branches=origin/master )
}
# Load a bundle