diff --git a/bootstrap/packages.txt b/bootstrap/packages.txt index 55c074f..f3fbca2 100644 --- a/bootstrap/packages.txt +++ b/bootstrap/packages.txt @@ -15,6 +15,7 @@ bison chromium dhcpcd dialog +diff-so-fancy docker docx2txt dunst diff --git a/git/.config/git/config b/git/.config/git/config index 3d6be53..c978251 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -22,6 +22,8 @@ rebase = true # always rebase on pulling, obviates merge commits [diff] colorMoved = zebra # also color stuff that has simply been moved, in a classy zebra-color +[pager] + diff = dsf | less --tabs=4 -RFXS --pattern '(^(Date|added|deleted|modified): |^diff --git )' [color.diff] meta = "9" frag = "magenta bold" diff --git a/git/.local/bin/dsf b/git/.local/bin/dsf new file mode 100755 index 0000000..5415d37 --- /dev/null +++ b/git/.local/bin/dsf @@ -0,0 +1,18 @@ +#!/usr/bin/env sh +# Pretty git diff display + +# degrade diffs gracefully: +# prefer diff-so-fancy if it is installed, +# otherwise fallback to git's own prettifier, +# if nothing exists just pass it on +dsf() { + if exist diff-so-fancy; then + diff-so-fancy + elif exist /usr/share/git/diff-highlight/diff-highlight; then + /usr/share/git/diff-highlight/diff-highlight + else + cat + fi +} + +dsf diff --git a/git/README.md b/git/README.md index f786183..8f62a94 100644 --- a/git/README.md +++ b/git/README.md @@ -9,6 +9,16 @@ ## Global git settings This is probably the first thing that needs to be customized, since it points to a different identity for each git user. +I sign all my commits by default, so take out the corresponding lines if you don't, or exchange it with your gpg key. + +Git will rewrite any remotes using http(s) to use the ssh notation for pushes to github and gitlab so that, even if you set up the repository using an https url you can utilize your usual ssh key for pushing. + +Finally, the configuration makes use of a custom pager called `dsf` which is also contained in this module. +It tries to use `diff-so-fancy` if that is installed on the path, otherwise uses git's internal diff prettifier. +If nothing exists it falls back to the standard output. +You can move between changed files in diffs with n/N. + +Otherwise, the git config is prepared to handle lfs repositories, and it has an assortment of smaller quality of life changes, though nothing major. ## Basic git command aliases