From 779381516d65a4ad30898d0a0f92d851839920b8 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Sat, 28 Mar 2020 17:42:27 +0100 Subject: [PATCH] adding suckless git utilities --- .local/bin/suckless/suckclean | 2 ++ .local/bin/suckless/suckdiff | 17 +++++++++++++++++ .local/bin/suckless/suckmerge | 11 +++++++++++ 3 files changed, 30 insertions(+) create mode 100755 .local/bin/suckless/suckclean create mode 100755 .local/bin/suckless/suckdiff create mode 100755 .local/bin/suckless/suckmerge diff --git a/.local/bin/suckless/suckclean b/.local/bin/suckless/suckclean new file mode 100755 index 0000000..1926078 --- /dev/null +++ b/.local/bin/suckless/suckclean @@ -0,0 +1,2 @@ +#!/bin/zsh +make clean && rm -f config.h && reset --hard origin/master diff --git a/.local/bin/suckless/suckdiff b/.local/bin/suckless/suckdiff new file mode 100755 index 0000000..bbd365b --- /dev/null +++ b/.local/bin/suckless/suckdiff @@ -0,0 +1,17 @@ +#!/usr/bin/zsh +git checkout master && +dotfiles="/home/drew/.config/dotfiles/suckless" +project=$(basename $(pwd)) +diffdir="${dotfiles}/${project}_diffs/" +olddiffdir="${dotfiles}/${project}_diffs/old/" +rm -rf "$olddiffdir" && +mkdir -p "$olddiffdir" && +mkdir -p "$diffdir" && +mv "$diffdir"*.diff "$olddiffdir" || true && +make clean && rm -f config.h && git reset --hard origin/master && +for branch in $(git for-each-ref --format='%(refname)' refs/heads/ | cut -d'/' -f3); do + if [ "$branch" != "master" ];then + git diff master..$branch > "${diffdir}${project}_${branch}.diff" + fi +done + diff --git a/.local/bin/suckless/suckmerge b/.local/bin/suckless/suckmerge new file mode 100755 index 0000000..b8a0142 --- /dev/null +++ b/.local/bin/suckless/suckmerge @@ -0,0 +1,11 @@ +#!/bin/zsh +suckdiff && +git reset --hard origin/master && +for branch in $(git for-each-ref --format='%(refname)' refs/heads/ | cut -d'/' -f3); do + if [ "$branch" != "master" ];then + echo $branch + git merge $branch -m $branch + fi +done +make && sudo make clean install +