git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.bash/postexec.bash7
-rw-r--r--.bash/prompt.bash14
-rw-r--r--.bash/vars.bash2
-rw-r--r--.flake82
-rw-r--r--.gitconfig7
-rwxr-xr-x.githooks/post-checkout13
-rwxr-xr-x.githooks/pre-commit4
-rw-r--r--.gitignore2
-rw-r--r--.gitmodules3
-rw-r--r--.gnupg/gpg.conf1
-rw-r--r--.pylintrc2
-rw-r--r--.ssh/config.d/0000-all.conf4
-rw-r--r--README.md32
m---------tmux-gpakosz0
m---------tmux-yank0
15 files changed, 82 insertions, 11 deletions
diff --git a/.bash/postexec.bash b/.bash/postexec.bash
index 564356a..6137814 100644
--- a/.bash/postexec.bash
+++ b/.bash/postexec.bash
@@ -6,3 +6,10 @@ if [ -n "$SSHENVFILE" ] && [ -r "$SSHENVFILE" ];then
fi
fi
fi
+for gitpsrc in "/usr/share/git/git-prompt.sh" "/usr/local/share/git/git-prompt.sh" \
+ "/usr/share/git-completion/prompt.sh" "/usr/local/share/git-completion/prompt.sh"; do
+ if [ -r "$gitpsrc" ]; then
+ source "$gitpsrc"
+ break
+ fi
+done
diff --git a/.bash/prompt.bash b/.bash/prompt.bash
index 6914d63..8c4dbaa 100644
--- a/.bash/prompt.bash
+++ b/.bash/prompt.bash
@@ -145,7 +145,19 @@ __prompt_command() {
PS1="\\# \[$(tput bold)\]\[$($FGC1)\]\t \[$($FGC2)\]\\u$UHSEP\[$($FGC3)\]$PHN \\w \[$(tput sgr0)\]\\n"
;;
esac
- if command -v __git_ps1 >/dev/null 2>&1;then PS1+="$(__git_ps1 "%s ")";fi
+ # git-completion. Sources:
+ # - https://github.com/git/git/tree/master/contrib/completion (main)
+ # - https://github.com/felipec/git-completion (fork)
+ # - Debian: easygit (outdated! you may want to use something like /git-prompt inside this repo)
+ # - Arch: git-completion (AUR, with functionality tests) - search for ...share/git(-completion)?/prompt.sh
+ # - Manual measure: this repository, /git-prompt
+ # Why all this fuss? magicmonty takes control over the whole prompt, __git_ps1 only serves a part
+ # of it. We don't like monoliths, we like modules; the latter is good practice.
+ # also, see postexec --> one-time sourcing of git's prompt.sh
+ if command -v __git_ps1 >/dev/null 2>&1;then
+ GIT_PS1_SHOWCOLORHINTS=1
+ PS1+="$(__git_ps1 "%s ")"
+ fi
if [ "$EXIT" -eq 0 ];then
PS1+="\[\033[0;32m\]# "
elif [ "$EXIT" -eq 255 ]||[ "$EXIT" -eq 127 ];then
diff --git a/.bash/vars.bash b/.bash/vars.bash
index da222b1..a7bdcb5 100644
--- a/.bash/vars.bash
+++ b/.bash/vars.bash
@@ -18,7 +18,7 @@ SSHAGH+=( "woschd.example.com" )
export SSHAGH
# ----- SHELL ----- #
-for pa in "/usr/local/bin" "${HOME}/bin" "${HOME}/.local/bin";do
+for pa in "/usr/local/bin" "${HOME}/bin" "${HOME}/.local/bin" "${HOME}/go/bin";do
if [ -x "$pa" ]; then
if ! printf "%b" "$PATH"|grep -P "^${pa}:|:${pa}:" >/dev/null;then
export PATH="${pa}:${PATH}"
diff --git a/.flake8 b/.flake8
index c35b8d3..e6ad5fa 100644
--- a/.flake8
+++ b/.flake8
@@ -13,6 +13,8 @@ doctests = True
# format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}:\\t${red_bold}%(code)s${reset} %(text)s
# Superseding flake8-colors:
format = %(cyan)s%(path)s%(reset)s:%(yellow)s%(bold)s%(row)d%(reset)s:%(green)s%(bold)s%(col)d%(reset)s: %(red)s%(bold)s%(code)s%(reset)s %(text)s
+# python8-flake8-cognitive-complexity
+max-cognitive-complexity = 16
#per-file-ignores =
# # imported but unused
# __init__.py: F401
diff --git a/.gitconfig b/.gitconfig
index 5a312f4..440b155 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -73,6 +73,7 @@
[core]
editor = vim
fileMode = true
+ hooksPath = ~/git-hooks
[merge]
tool = vimdiff
[mergetool]
@@ -88,3 +89,9 @@
#proxy = http://10.0.0.1:3128/
[pull]
rebase = false
+[pack]
+ windowMemory = 1024m
+[credential]
+ helper = !type pass-git-helper > /dev/null && pass-git-helper $@
+ useHttpPath = true
+
diff --git a/.githooks/post-checkout b/.githooks/post-checkout
new file mode 100755
index 0000000..e02dfcf
--- /dev/null
+++ b/.githooks/post-checkout
@@ -0,0 +1,13 @@
+#!/usr/bin/env sh
+rm -rf ./git-prompt
+git -c submodule.sha1collisiondetection.update=none clone --no-checkout --depth 1 https://github.com/git/git.git ./git-prompt &&\
+(
+ cd ./git-prompt || exit 110
+ #mkdir -pv contrib/completion || exit 111
+ #git show HEAD:contrib/completion/git-prompt.sh > contrib/completion/git-prompt.sh || exit 112
+ git restore --staged contrib/completion/git-prompt.sh
+ git checkout contrib/completion/git-prompt.sh
+ # if you can't cope with git reporting a truckload of deleted files, do this:
+ #rm -rf .git
+ # ...mind you this will alwasys pull in the whole repository on checkout/clone.
+)
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
new file mode 100755
index 0000000..2ec7e41
--- /dev/null
+++ b/.githooks/pre-commit
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+git config --remove-section submodule.git-prompt
+printf "submodule git-prompt has been removed. After pushing, don't forget to trigger the"
+printf " post-checkout hook again.\\n"
diff --git a/.gitignore b/.gitignore
index d049053..e9d033e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,5 @@
!/.vimrc
!/.ssh/config
!/.ssh/config.d/0000-all.conf
+#!/git-prompt
+!/.githooks
diff --git a/.gitmodules b/.gitmodules
index d2a5366..9a9d797 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -6,3 +6,6 @@
path = tmux-yank
url = https://github.com/tmux-plugins/tmux-yank
branch = master
+[submodule "git-prompt"]
+ path = git-prompt
+ url = https://github.com/git/git.git
diff --git a/.gnupg/gpg.conf b/.gnupg/gpg.conf
index 3b013a4..d91ecbd 100644
--- a/.gnupg/gpg.conf
+++ b/.gnupg/gpg.conf
@@ -11,3 +11,4 @@ cert-digest-algo SHA256
no-emit-version
ask-cert-level
expert
+trust-model tofu+gpg
diff --git a/.pylintrc b/.pylintrc
index d66e5a2..92ee902 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -3,5 +3,5 @@
jobs=2
[FORMAT]
-indent-string='\t'
+#indent-string='\t'
max-line-length=100
diff --git a/.ssh/config.d/0000-all.conf b/.ssh/config.d/0000-all.conf
index df13d7c..7a69c2a 100644
--- a/.ssh/config.d/0000-all.conf
+++ b/.ssh/config.d/0000-all.conf
@@ -6,8 +6,8 @@
SendEnv LANG LC_* MUTTEXEC
HashKnownHosts yes
ForwardAgent yes
-ControlMaster auto
-ControlPath /run/user/%i/ssh/cm-%r@%h:%p
+#ControlMaster auto
+#ControlPath /run/user/%i/ssh/cm-%r@%h:%p
# ControlMaster: to use SSH multiplexing with ProxyCommand (e.g. to reach host b through host a)
# Host b
diff --git a/README.md b/README.md
index 6728444..e660979 100644
--- a/README.md
+++ b/README.md
@@ -4,10 +4,30 @@ Yet another (!) approach at building up a centralized configuration.
Parts are old, parts are not done yet, we're getting there.
-## To-Dos
+# Information for cloning
-* i3 config / sway config
-* gpg config
-* game launching stuff
-* parallel-ssh and ansible
-* ...
+## only clone git-prompt.sh
+
+This repository does not include a git-prompt.sh source. This is due to the file residing inside
+the whole git repository. Submoduling cannot just include one file, so if you need this file here,
+the checkout is... up to you, kind of.
+
+Since I am maintaining this repo for ease of distribution for myself as well, here's the solution:
+
+Trigger `/.githooks/post-checkout` inside this repo. Either do this on any checkout, or set your git
+post-checkout trigger for this file to automatically take over.
+
+## sha1collisiondetection
+
+For git-prompt, its submodule sha1collisiondetection may be "broken" (i.e. it cannot be pulled), here's a fix:
+
+`git -c submodule.sha1collisiondetection.update=none COMMAND`
+
+...whereas `COMMAND` is one of the usual actions such as
+
+```
+clone --recurse-submodules
+submodule update --init --recursive
+```
+
+This only applies if you do not use `/.githooks/post-checkout` inside this repository.
diff --git a/tmux-gpakosz b/tmux-gpakosz
-Subproject b69ae7c1a4243afd02c5883a500c61218f6bbf3
+Subproject 9cf49731cd785b76cf792046feed0e827545791
diff --git a/tmux-yank b/tmux-yank
-Subproject 1b1a436e19f095ae8f825243dbe29800a8acd25
+Subproject acfd36e4fcba99f8310a7dfb432111c242fe739