From 0aeb5bcd4c9612fc4d953cab4667caaa96d891e3 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Sat, 18 Sep 2021 22:05:23 +0200 Subject: [PATCH] config/git: alias fixes --- .config/git/config | 6 +++--- .config/git/config-data | 2 +- .config/shell/git | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.config/git/config b/.config/git/config index 707a8dd..73fe40a 100644 --- a/.config/git/config +++ b/.config/git/config @@ -130,8 +130,8 @@ a = add -u aa = add -u . ap = add -p - af = !git status --porcelain --no-renames --untracked-files=all -z | grep -v '^\\w ' -z | git fzs git -c advice.addEmptyPathspec=false add --verbose --pathspec-from-file=- - sf = !git status --porcelain --no-renames -z | sed -z 's/^\\(\\w\\) / \\1/' | git fzs >/tmp/git-sf && git -c advice.addEmptyPathspec=false add --intent-to-add --pathspec-from-file=/tmp/git-sf && git commit --only -v --pathspec-from-file=/tmp/git-sf + af = !git status --porcelain --no-renames --untracked-files=all -z | grep -v '^\\w ' -z | git fzs | git -c advice.addEmptyPathspec=false add --verbose --pathspec-from-file=- + sf = "!git status --porcelain --no-renames -z | sed -z 's/^\\(\\w\\) / \\1/' | git fzs >/tmp/git-sf && git -c advice.addEmptyPathspec=false add --intent-to-add --pathspec-from-file=/tmp/git-sf; git commit --only -v --pathspec-from-file=/tmp/git-sf" c = commit -v cad = !git diff-tree --no-commit-id --name-only -r HEAD | git commit -v --amend --pathspec-from-file=- # Amend commit with all already changed files @@ -172,7 +172,7 @@ # Change remote ruu = !git fetch upstream && git reset --keep upstream/${1:-$(git curbranch)} && git push --no-verify --force-with-lease - luu = !git pull upstream ${1:-(git curbranch)} && git push --no-verify + luu = !git pull upstream ${1:-$(git curbranch)} && git push --no-verify pf = push --force-with-lease cap = !git commit --amend --no-edit && git push --force-with-lease diff --git a/.config/git/config-data b/.config/git/config-data index 2052a49..2182d7e 100644 --- a/.config/git/config-data +++ b/.config/git/config-data @@ -1,4 +1,4 @@ [alias] journal = !git add $(git root)/2-standards/notes/journal && git cme "notes/journal:" -- $(git root)/2-standards/notes/journal note = !git cme "notes:" -- $(git root)/2-standards/notes - write = !git cme "write:" -- $(git root)/2-standards/writing + write = !git add $(git root)/2-standards/writing && git cme "write:" -- $(git root)/2-standards/writing diff --git a/.config/shell/git b/.config/shell/git index e4fec07..79bc167 100644 --- a/.config/shell/git +++ b/.config/shell/git @@ -11,9 +11,13 @@ yc() { yadm commit -v --template /tmp/yc-msg ${@:2} -- "$XDG_CONFIG_HOME/$1" } -alias sy="sysyadm" alias sysyadm="sudo yadm -Y /etc/yadm" -alias sysinit="sysyadm init -b main -w / && sysyadm gitconfig include.path '$XDG_CONFIG_HOME/git/config'" +alias sysinit="sysyadm init -b main -w /; sysyadm gitconfig include.path '$XDG_CONFIG_HOME/git/config'" +sy() { + unignore="/etc/yadm/unignore" + test -r "$unignore" && cat "$unignore" | envsubst | sysyadm add --intent-to-add --pathspec-from-file=- + test "$#" -eq 0 && sysyadm s || sysyadm "$@" +} gcn() { if test $# -eq 0 || test -e $1