config/git: alias fixes

This commit is contained in:
xeruf 2021-09-18 22:05:23 +02:00
parent f3b8aff618
commit 0aeb5bcd4c
3 changed files with 10 additions and 6 deletions

View File

@ -130,8 +130,8 @@
a = add -u a = add -u
aa = add -u . aa = add -u .
ap = add -p 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=- 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 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 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 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 # Change remote
ruu = !git fetch upstream && git reset --keep upstream/${1:-$(git curbranch)} && git push --no-verify --force-with-lease 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 pf = push --force-with-lease
cap = !git commit --amend --no-edit && git push --force-with-lease cap = !git commit --amend --no-edit && git push --force-with-lease

View File

@ -1,4 +1,4 @@
[alias] [alias]
journal = !git add $(git root)/2-standards/notes/journal && git cme "notes/journal:" -- $(git root)/2-standards/notes/journal 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 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

View File

@ -11,9 +11,13 @@ yc() {
yadm commit -v --template /tmp/yc-msg ${@:2} -- "$XDG_CONFIG_HOME/$1" yadm commit -v --template /tmp/yc-msg ${@:2} -- "$XDG_CONFIG_HOME/$1"
} }
alias sy="sysyadm"
alias sysyadm="sudo yadm -Y /etc/yadm" 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() { gcn() {
if test $# -eq 0 || test -e $1 if test $# -eq 0 || test -e $1