git: Add fixes alias and pretty format

This allows printing for 'Fixes:' tags as mentioned in the kernel
documentation:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html
This commit is contained in:
2022-01-12 12:41:22 +01:00
parent 157c2ae43f
commit ef7196f2ca

View File

@@ -3,6 +3,7 @@
detachedHead = off detachedHead = off
[alias] [alias]
branches = track branches = track
fixes = log -1 --pretty=fixes
root = rev-parse --show-toplevel root = rev-parse --show-toplevel
spull = "!__git_spull() { git pull \"$@\" && git submodule sync --recursive && git submodule update --init --recursive; }; __git_spull" spull = "!__git_spull() { git pull \"$@\" && git submodule sync --recursive && git submodule update --init --recursive; }; __git_spull"
track = "!git for-each-ref --format='%(upstream),%(refname)' refs/heads refs/remotes | sort -d | sed -Ez 's:(^|\\n|,)refs/(heads|remotes/):\\1:g; s:(^|\\n),([^/][^\\n]*):\\1\\2,:g; s:,/:,:g; s:(^|\\n)([^,]+),\\n\\2:\\1\\2:g; s:(^|\\n)([^/,]*)([^\\n]*\\n\\2(,|/))*:\\n&:g; s:\\n+$:\\n:' | (echo remote,local; cat) | column -tdLs, -Na,b -Ob,a | sed '2d; 1{p;s/./―/g}'" track = "!git for-each-ref --format='%(upstream),%(refname)' refs/heads refs/remotes | sort -d | sed -Ez 's:(^|\\n|,)refs/(heads|remotes/):\\1:g; s:(^|\\n),([^/][^\\n]*):\\1\\2,:g; s:,/:,:g; s:(^|\\n)([^,]+),\\n\\2:\\1\\2:g; s:(^|\\n)([^/,]*)([^\\n]*\\n\\2(,|/))*:\\n&:g; s:\\n+$:\\n:' | (echo remote,local; cat) | column -tdLs, -Na,b -Ob,a | sed '2d; 1{p;s/./―/g}'"
@@ -29,6 +30,8 @@
log = true log = true
suppressDest = * suppressDest = *
tool = nvimdiff tool = nvimdiff
[pretty]
fixes = Fixes: %h (\"%s\")
[pull] [pull]
ff = yes ff = yes
rebase = true rebase = true