config/git: improve aliases
This commit is contained in:
parent
cb4b56da96
commit
b804819c6f
|
@ -148,7 +148,7 @@
|
||||||
cme = commit -v --edit --message # Commit with message from CLI but edit it
|
cme = commit -v --edit --message # Commit with message from CLI but edit it
|
||||||
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
|
||||||
cap = !git commit --amend --no-edit && git push --force-with-lease
|
cap = !git commit --amend --no-edit && git push --force-with-lease
|
||||||
journal = !git -C $DATA commit -v $DATA/2-box/journal*
|
journal = !command git -C $DATA commit -v $DATA/2-box/journal*
|
||||||
|
|
||||||
cp = cherry-pick
|
cp = cherry-pick
|
||||||
cpc = cherry-pick --continue
|
cpc = cherry-pick --continue
|
||||||
|
|
|
@ -37,8 +37,7 @@ gcn() {
|
||||||
# if in home or under XDG_CONFIG_HOME and not within a git directory, replace git by yadm
|
# if in home or under XDG_CONFIG_HOME and not within a git directory, replace git by yadm
|
||||||
git() {
|
git() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
(config) ;;
|
(config|clone|journal) ;;
|
||||||
(clone) ;;
|
|
||||||
(*) case "$PWD" in
|
(*) case "$PWD" in
|
||||||
($HOME|$XDG_CONFIG_HOME|$LAST_YADM)
|
($HOME|$XDG_CONFIG_HOME|$LAST_YADM)
|
||||||
yadm "$@"
|
yadm "$@"
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh -ex
|
||||||
|
# Configure git prepare-commit-msg hook that prefixes common path of changed files
|
||||||
|
git config core.hooksPath .git/hooks
|
||||||
|
ln -st .git/hooks $XDG_CONFIG_HOME/git/prepare-commit-msg
|
|
@ -16,11 +16,10 @@ case "$1" in
|
||||||
esac
|
esac
|
||||||
host=$1
|
host=$1
|
||||||
case $host in
|
case $host in
|
||||||
(socha) user=software-challenge; host=git@github.com;;
|
(socha) user=software-challenge; host=github.com;;
|
||||||
(hub|github) host=git@github.com;;
|
(hub|github) host=github.com;;
|
||||||
(lab) host=git@gitlab.com;;
|
(lab) host=gitlab.com;;
|
||||||
(jf) host=gitea@git.jfischer.org;;
|
(ftt|"") host=forge.ftt.gmbh; user=janek;;
|
||||||
(ftt|"") host=git@forge.ftt.gmbh; user=janek;;
|
|
||||||
esac
|
esac
|
||||||
user=${3:-${user:-$(git config user.name)}}
|
user=${3:-${user:-$(git config user.name)}}
|
||||||
repo=${2:-$(basename $(git root))}
|
repo=${2:-$(basename $(git root))}
|
||||||
|
|
Loading…
Reference in New Issue