git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. P. <coding _æ_ lirion.de> 2024-07-14 11:32:25 +0200
committerH. P. <coding _æ_ lirion.de> 2024-07-14 11:32:25 +0200
commit672c91bc95a167269fb7ddfa2c84e4f7da2bdad2 (patch)
tree24cdbba6369c6b4e6de7403b8cd0cfdccee17ee2
parentcbc3482c5d475eff579902004f81cefd38cfcb98 (diff)
downloaddotfiles-672c91bc95a167269fb7ddfa2c84e4f7da2bdad2.tar.bz2
here goes another attempt
-rw-r--r--.gitconfig1
-rw-r--r--README.md29
2 files changed, 29 insertions, 1 deletions
diff --git a/.gitconfig b/.gitconfig
index a830a7d..440b155 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -73,6 +73,7 @@
[core]
editor = vim
fileMode = true
+ hooksPath = ~/git-hooks
[merge]
tool = vimdiff
[mergetool]
diff --git a/README.md b/README.md
index 7710d7a..2b8301f 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,34 @@ Yet another (!) approach at building up a centralized configuration.
Parts are old, parts are not done yet, we're getting there.
-## Information for cloning
+# Information for cloning
+
+## only clone git-prompt.sh
+
+Define your git hooksPath. If `git config --global core.hooksPath` delivers no result, choose a directory
+where to place your hooks. I am going with `git config --global core.hooksPath '~/git-hooks'` (the quotation
+marks are essential here, otherwise `~` would be converted to a static home directory name).
+
+Inside that folder, place a file with following content:
+
+```
+#!/usr/bin/env sh
+
+if git remote get-url origin --no-all | grep -P 'lirion.*dotfiles.git' > /dev/null; then
+ install -dvm .git/modules
+ install -dvm .git/modules/git-prompt
+ install -dvm .git/modules/git-prompt/info
+ cat > .git/modules/git-prompt/info/sparse-checkout <<EOF
+contrib/completion/git-prompt.sh
+EOF
+ rm -r ./git-prompt
+ git -c submodule.sha1collisiondetection.update=none submodule update --init --recursive
+fi
+```
+
+Then you can proceed to clone.
+
+## sha1collisiondetection
For git-prompt, its submodule sha1collisiondetection may be "broken" (i.e. it cannot be pulled), here's a fix: