summary refs log tree commit diff
path: root/.config/git
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.config/git/config191
-rw-r--r--.config/git/ignore60
-rw-r--r--.config/git/message2
-rwxr-xr-x.config/git/signoff.sh2
-rw-r--r--.config/git/tig41
5 files changed, 296 insertions, 0 deletions
diff --git a/.config/git/config b/.config/git/config
new file mode 100644
index 0000000..458280d
--- /dev/null
+++ b/.config/git/config
@@ -0,0 +1,191 @@
+[user]
+    name = Robert Günzler
+    email = r@gnzler.io
+    ; signingkey = AF6AB8C8B10436B9F61293632143BD2AAB94BCC4
+    signingkey = ~/.ssh/id_ed25519.pub
+
+[gpg]
+    format = ssh
+
+[sendemail]
+    sendmailCmd = ~/bin/msmtpq --set-from-header=on
+    envelopeSender = auto
+    annotate = true
+    multiEdit = true
+    confirm = always
+
+[credential "smtp.mailfence.com"]
+    username = robert@gnzler.de
+    helper = !sh -c 'rbw get 68b0ea26-733a-43cd-b8f8-e8ecc98de072 | xargs printf password=%s\\n'
+
+[credential "git.sr.ht"]
+    username = robertgzr
+    helper = !sh -c 'rbw get c7e750ea-6713-4254-90e7-6e077b552ffa | xargs printf password=%s\\n'
+
+[credential "github.com"]
+    username = robertgzr
+    helper = !sh -c 'rbw get f94a873d-9d72-412e-a46d-53e4cd19a291 | xargs printf password=%s\\n'
+
+[core]
+    excludesfile = $HOME/.config/git/ignore
+    filemode = false
+    pager = less -F
+
+[init]
+    defaultBranchName = master
+    # templateDir = ~/.dotfiles/git/templates
+
+[interactive]
+    diffFilter="diff-highlight | less -FRX --tabs=4"
+
+[log]
+    date = iso-strict-local
+
+[format]
+    signoff = true
+    coverLetter = false
+
+[column]
+    ui = auto
+
+[commit]
+    ; template = ~/.config/git/message
+    gpgSign = true
+    verbose = true
+
+[alias]
+    a = add --patch
+    amend = ci --amend --reuse-message=HEAD --edit
+    br = branch
+    ci = commit --trailer=signoff
+    co = checkout
+    cp = cherry-pick
+    dl = diff --stat
+    ds = diff --staged
+    fix = "!f() { local c=${1:-$(git fuzzy commits || :)}; test -n \"$c\" && git fixup $c && git ri $c^; }; f"
+    fixup = "!f() { local c=${1:-$(git fuzzy commits || :)}; test -n \"$c\" && git commit --fixup=$c; }; f"
+    grep = grep --break --heading --line-number
+    l = !tig
+    ls = log --graph --decorate --stat
+    mt = mergetool
+    pushf = push --force-with-lease
+    authors = shortlog -nse
+    reviewers = shortlog -nse --group=trailer:reviewed-by
+    ri = rebase --autostash --autosquash -i # -x 'git hook run pre-commit'
+    squash = "!f() { local c=${1:-$(git fuzzy commits || :)}; test -n \"$c\" && git commit --squash=$c; }; f"
+    st = status -sb
+    sw = switch
+    tig = !tig
+
+[apply]
+    # Detect whitespace errors when applying a patch
+    whitespace = fix
+
+[diff]
+    # Detect copies as well as renames
+    renames = copies
+    renameLimit = 3210
+    tool = difftastic
+
+[diff "bin"]
+    # Use `hexdump` to diff binary files
+    textconv = hexdump -v -C
+    renames = copies
+    tool = vimdiff
+
+[difftool]
+    prompt = false
+
+[pager]
+    difftool = true
+
+[fetch]
+    prune = true
+
+[submodule]
+    recurse = true
+
+[pull]
+    rebase = true
+    autostash = true
+
+[grep]
+    lineNumber = true
+
+[merge]
+    log = true
+    defaultToUpstream = true
+    tool = nvimdiff
+
+[mergetool "nvimdiff"]
+    conflictstyle = diff3
+    prompt = false
+
+[rerere]
+    enabled = false
+
+[push]
+    followTags = true
+    autoSetupRemote = true
+
+[tag]
+    gpgsign = true
+
+[safe]
+    directory = /var/tmp/portage/*
+    directory = /var/cache/distfiles/git3-src/*
+
+[trailer "signoff"]
+    key = "Signed-off-by"
+    cmd = ~/.config/git/signoff.sh $(git config user.email)
+    ifmissing = add
+    ifexists = replace
+    where = end
+[trailer "changetype"]
+    key = "Change-type"
+    where = start
+[trailer "connects"]
+    key = "Connects-to"
+    where = start
+[trailer "depends"]
+    key = "Depends-on"
+    where = start
+[trailer "changelog"]
+    key = "Changelog-entry"
+    where = start
+[trailer "coauthor"]
+    key = "Co-authored-by"
+    where = start
+[trailer "reviewed"]
+    key = "Reviewed-by"
+    where = start
+[trailer "tested"]
+    key = "Tested-by"
+    where = start
+[trailer "fixes"]
+    key = "Fixes"
+    where = start
+[trailer "refs"]
+    key = "Refs"
+    where = start
+
+
+[include]
+    path = tig
+
+[includeIf "gitdir:~/src/unikraft/**"]
+    path = ~/src/unikraft/.gitconfig
+
+
+# url rewrites
+; [url "git@github.com:"]
+;     insteadOf = "https://github.com/"
+[url "git@git.sr.ht:"]
+    insteadOf = "https://git.sr.ht/"
+; [url "git@bitbucket.org:"]
+;     insteadOf = "https://bitbucket.org/"
+; [url "git@gitlab.com:"]
+;     insteadOf = "https://gitlab.com/"
+
+
+; vim: expandtab shiftwidth=4
diff --git a/.config/git/ignore b/.config/git/ignore
new file mode 100644
index 0000000..33b0186
--- /dev/null
+++ b/.config/git/ignore
@@ -0,0 +1,60 @@
+# Random
+*~
+._*
+Thumbs.db
+.DS_Store*
+Desktop.ini
+.idea
+ehthumbs.db
+Icon*
+Session.vim
+
+# external
+.Spotlight-V100
+.Trashes
+
+# compiled
+*.o
+*.out
+*.pyc
+*.so
+*.exe
+*.class
+*.dll
+bin/
+tags
+
+# logs and db
+*.log
+*.sql
+*.sqlite
+*.db
+
+# packages
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+
+# web stuff
+node_modules
+bower_components
+
+# personal stuff
+.todo.md
+.org.md
+
+# clangd
+.cache/
+
+# cargo
+target/debug/build/
+target/release/build/
+
+# zig
+zig-out/
+.zig-cache/
diff --git a/.config/git/message b/.config/git/message
new file mode 100644
index 0000000..d6c62b9
--- /dev/null
+++ b/.config/git/message
@@ -0,0 +1,2 @@
+
+Signed-off-by: Robert Günzler <r@gnzler.io>
diff --git a/.config/git/signoff.sh b/.config/git/signoff.sh
new file mode 100755
index 0000000..9a0f3f6
--- /dev/null
+++ b/.config/git/signoff.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+printf '%s <%s>' "$(git config user.name)" "$1"
diff --git a/.config/git/tig b/.config/git/tig
new file mode 100644
index 0000000..3ab5af7
--- /dev/null
+++ b/.config/git/tig
@@ -0,0 +1,41 @@
+[tig "color"]
+    cursor = default default bold reverse
+    title-focus = black blue
+    title-blur = black white
+
+[tig "bind"]
+    generic = y none
+    generic = yy !@wl-copy -n "%(commit)"
+    generic = I !@fyi -u critical -a tig -- 'tig: you should use yy'
+
+    generic = G move-last-line
+    generic = V view-pager
+    ; generic = <Ctrl-n> find-next
+    ; generic = <Ctrl-p> find-prev
+    ; generic = <Ctrl-l> scroll-right
+    ; generic = <Ctrl-h> scroll-left
+    ; generic = <Ctrl-g> refresh
+    generic = ~ :goto %(commit)^
+
+    main = g none
+    main = gg move-first-line
+    main = G move-last-line
+    main = <esc>g :toggle commit-title-graph
+
+    diff = g none
+    diff = gg move-first-line
+    diff = G move-last-line
+    diff = n :/^@@
+    diff = p :?^@@
+
+    stage = n :/^@@
+    stage = p :?^@@
+
+    pager = n :/^@@
+    pager = p :?^@@
+
+    log = n :/^commit
+    log = p :?^commit
+    log = I !@wl-copy -n "%(commit)"
+
+; vim: ft=gitconfig expandtab shiftwidth=4