You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
754 B

#!/bin/bash
# for showing the diffs to the master branch of a git directory according to my suckless patch structure
# e.g. see dwm/st/etc
# by uoou, checkout gitlab.com/uoou/dotfiles
git checkout master &&
dotfiles="/home/tiynger/.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/base &&
for branch in $(git for-each-ref --format='%(refname)' refs/heads/ | cut -d'/' -f3); do
if [ "$branch" != "master" ];then
git diff base..$branch > "${diffdir}${project}_${branch}.diff"
fi
done