From 84806a9cbdc26ac05036bbdc901364789c7380cd Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Mon, 28 Nov 2022 11:37:05 -0500 Subject: Update gitconfig (more aliases, aaa) --- modules/40-git/gitconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules/40-git') diff --git a/modules/40-git/gitconfig b/modules/40-git/gitconfig index 4ab3320..82f6de6 100644 --- a/modules/40-git/gitconfig +++ b/modules/40-git/gitconfig @@ -13,13 +13,15 @@ [alias] lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all edit-alias = "!f() {\n\t_tmpfile=\"$(mktemp --tmpdir git-alias-$@.XXXXX.sh)\"\n\tgit config --global --get alias.\"$@\" > \"$_tmpfile\"\n\t_startsum=$(md5sum \"$_tmpfile\" | cut -d' ' -f1)\n\t$EDITOR \"$_tmpfile\"\n\t_finalsum=$(md5sum \"$_tmpfile\" | cut -d' ' -f1)\n\tif [[ \"$_startsum\" != \"$_finalsum\" ]]; then\n\t\tgit config --global alias.\"$@\" \"$(cat $_tmpfile)\"\n\telse\n\t\techo \"Alias not modified\" >&2\n\tfi\n\trm \"$_tmpfile\"\n}; f" - fdiff = "!f() {\n\tif command -v fzf 2>&1 >/dev/null; then\n\t\tPREVIEW=\"{ if [[ \\\"{+}\\\" == *\\\"{}\\\"* ]]; then\n\t\t\t\tgit diff --color=always $@ -- {+};\n\t\t\telse\n\t\t\t\tgit diff --color=always $@ -- {};\n\t\t\tfi } | /usr/share/git/diff-highlight/diff-highlight\"\n\t\tgit diff \"$@\" --name-only | \\\n\t\t\tfzf \\\n\t\t\t\t--scheme=path \\\n\t\t\t\t--layout=reverse \\\n\t\t\t\t--info=inline \\\n\t\t\t\t--multi \\\n\t\t\t\t--cycle \\\n\t\t\t\t--header=\"git diff $@\" \\\n\t\t\t\t--header-first \\\n\t\t\t\t--filepath-word \\\n\t\t\t\t--ansi \\\n\t\t\t\t--preview-window=\"60%,wrap\" \\\n\t\t\t\t--preview \"$PREVIEW\" \\\n\t\t\t\t--bind=\"enter:execute(less {})\"\n\telse\n\t\techo \"fzf not found, using normal diff\" >&2\n\t\tgit diff \"$@\"\n\tfi\n}; f" + fdiff = "!f() {\n\tif command -v fzf 2>&1 >/dev/null; then\n\t\tPREVIEW=\"{ if [[ \\\"{+}\\\" == *\\\"{}\\\"* ]]; then\n\t\t\t\tgit diff --color=always $@ -- {+};\n\t\t\telse\n\t\t\t\tgit diff --color=always $@ -- {};\n\t\t\tfi } | /usr/share/git/diff-highlight/diff-highlight\"\n\t\tgit diff \"$@\" --name-only | \\\n\t\t\tfzf \\\n\t\t\t\t--scheme=path \\\n\t\t\t\t--layout=reverse \\\n\t\t\t\t--info=inline \\\n\t\t\t\t--multi \\\n\t\t\t\t--cycle \\\n\t\t\t\t--header=\"git diff $@\" \\\n\t\t\t\t--header-first \\\n\t\t\t\t--filepath-word \\\n\t\t\t\t--ansi \\\n\t\t\t\t--preview-window=\"60%,wrap\" \\\n\t\t\t\t--preview \"$PREVIEW\" \\\n\t\t\t\t--bind=\"enter:execute(git diff {})\"\n\telse\n\t\techo \"fzf not found, using normal diff\" >&2\n\t\tgit diff \"$@\"\n\tfi\n}; f" gce = config --global --edit ce = config --edit + clean-untracked = clean --force -d + cdiff = "!f() {\n if command -v fzf 2>&1 >/dev/null; then\n\t\tPREVIEW='if echo \"{+1}\" | grep \" \" >/dev/null && [[ \"{+1}\" == *\"{1}\"* ]]; then export REV2=`echo {+1} | grep -Po \"^[A-z0-9]*\"`; export REV1=`echo {+1} | grep -Po \"[A-z0-9]*$\"`; else export REV2={1}; export REV1={1}^; fi; git diff --color=always $REV1..$REV2 | /usr/share/git/diff-highlight/diff-highlight'\n\t\tgit log --oneline --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)\\n' | \\\n fzf \\\n --scheme=path \\\n --layout=reverse \\\n --info=inline \\\n --multi \\\n --cycle \\\n --header-first \\\n --filepath-word \\\n --ansi \\\n --preview-window=\"60%,wrap\" \\\n --preview \"$PREVIEW\"\n else\n echo \"fzf not found, sad\" >&2\n fi\n}; f" [push] autoSetupRemote = true [blame] - ignoreRevsFile = .git-blame-ignore-revs + #ignoreRevsFile = .git-blame-ignore-revs [pager] diff = /usr/share/git/diff-highlight/diff-highlight | less log = /usr/share/git/diff-highlight/diff-highlight | less -- cgit v1.2.3