diff options
Diffstat (limited to '.config')
| -rw-r--r-- | .config/git/config | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/.config/git/config b/.config/git/config index 11c5209..41bab58 100644 --- a/.config/git/config +++ b/.config/git/config @@ -70,6 +70,7 @@ d = diff df = diff --word-diff ds = diff --staged + dss = diff --staged --stat dl = diff --stat diffsummary = "!f() { local a=${1:-HEAD}; local b=${2:-master}; if [[ $a == '-' ]]; then a=HEAD; fi; printf ' %s is %s commits ahead and %s commits behind %s\n' `git rev-parse --short=7 $a` `git rev-list --count $b..$a` `git rev-list --count $a..$b` $b; printf ' last common commit (merge-base): %s\n' `git merge-base $a $b`; git diff --shortstat $a..$b; }; f" unstage = reset --hard HEAD @@ -103,8 +104,9 @@ root = "rev-parse --show-toplevel" trailer = "!f() { trailer=${1:-}; ref=${2:-HEAD}; mode='--amend'; [ $ref != 'HEAD' ] && mode='--fixup=$ref'; msg=$(git rev-parse --show-toplevel)/LAST_COMMIT_MSG; git log -1 --format=%B $ref > $msg; git interpret-trailers --in-place --trailer $trailer $msg; git commit --allow-empty --no-verify --only --edit --file $msg $mode; rm $msg; }; f" a = add --patch - oldest-ancestor = !bash -c 'diff -u <(git rev-list --first-parent ${1:-master}) <(git rev-list --first-parent ${2:-HEAD}) | sed -ne \"s/^ //p\" | head -1' - rebase-onto = !bash -c 'git rebase --onto ${1} `git oldest-ancestor ${2} ${3}` ${3}' - + ; oldest-ancestor = !bash -c 'diff -u <(git rev-list --first-parent ${1:-master}) <(git rev-list --first-parent ${2:-HEAD}) | sed -ne \"s/^ //p\" | head -1' + ; oldest-ancestor = !bash -c 'git merge-base ${1:-master} ${2:-HEAD}' + rebaseonto = "!f() { git rebase --autostash --onto=${1:-origin/master} $(git merge-base ${1:-origin/master} ${2:-HEAD}); }; f" find-by-subject = "!f() { set -ex; s=`git log -1 --format=%s ${1}`; git --no-pager log -1 --grep=\"^${s}$\" --no-merges ${2}; }; f" tig = !tig amend = commit --amend @@ -114,6 +116,9 @@ t = !fzfez git-tags pushall = "!f() { args=$@; git remote show -n | xargs -I{} sh -c \"set -x;git push {} $args\"; }; f" pushfall = "!f() { args=$@; git remote show -n | xargs -I{} sh -c \"set -x;git pushf {} $args\"; }; f" + ; git-hack shortcuts + hack = hack hack + sync = hack sync [apply] # Detect whitespace errors when applying a patch @@ -189,37 +194,25 @@ gpgsign = true # URL shorthands -[url "git@github.com:"] - insteadOf = "gh:" - insteadOf = "https://github.com/" - pushInsteadOf = "github:" - pushInsteadOf = "git://github.com/" - -[url "git@bitbucket.org:"] - insteadOf = "bb:" - insteadOf = "https://bitbucket.org/" - pushInsteadOf = "bitbucket:" - pushInsteadOf = "git://bitbucket.org/" - -[url "git@gitlab.com:"] - insteadOf = "gl:" - insteadOf = "https://gitlab.com/" - pushInsteadOf = "gitlab:" - pushInsteadOf = "git://gitlab.com/" - -[url "git@git.sr.ht:"] - insteadOf = "srht:" - insteadOf = "https://git.sr.ht/" - pushInsteadOf = "srht:" - pushInsteadOf = "git://git.sr.ht/" - -[url "git://github.com/"] - insteadOf = "github:" + +; [url "git@github.com:"] +; insteadOf = "https://github.com/" +; pushInsteadOf = "git://github.com/" + +; [url "git@bitbucket.org:"] +; insteadOf = "https://bitbucket.org/" +; pushInsteadOf = "git://bitbucket.org/" + +; [url "git@gitlab.com:"] +; insteadOf = "https://gitlab.com/" +; pushInsteadOf = "git://gitlab.com/" + +; [url "git@git.sr.ht:"] +; insteadOf = "https://git.sr.ht/" +; pushInsteadOf = "git://git.sr.ht/" [url "git@gist.github.com:"] - insteadOf = "gst:" insteadOf = "gist:" - pushInsteadOf = "gist:" pushInsteadOf = "git://gist.github.com/" [http] |