Add gitattributesdb support. Update bash startup files. Small changes to other files.

This commit is contained in:
Darren 'Tadgy' Austin 2024-08-25 21:20:56 +01:00
commit 93e8fe1e3f
22 changed files with 742 additions and 620 deletions

21
.bash_profile.d/gitconfig Normal file
View file

@ -0,0 +1,21 @@
#!/bin/bash - not strictly necessary, but helps nano with syntax highlighting.
# Symlink the .gitconfig file to the most specific .gitconfig-* file.
if [[ -e "$HOME/.gitconfig-$USER@$HOSTNAME" ]]; then
FILE=".gitconfig-$USER@$HOSTNAME"
elif [[ -e "$HOME/.gitconfig-$USER@*.${HOSTNAME#*.}" ]]; then
FILE=".gitconfig-$USER@*.${HOSTNAME#*.}"
elif [[ -e "$HOME/.gitconfig-$USER@*" ]]; then
FILE=".gitconfig-$USER@*"
elif [[ -e "$HOME/.gitconfig-*@$HOSTNAME" ]]; then
FILE=".gitconfig-*@$HOSTNAME"
elif [[ -e "$HOME/.gitconfig-*.${HOSTNAME#*.}" ]]; then
FILE=".gitconfig-*.${HOSTNAME#*.}"
elif [[ -e "$HOME/.gitconfig-default" ]]; then
FILE=".gitconfig-default"
else
(cd "$HOME" && [[ -L ".gitconfig" ]] && rm -f ".gitconfig")
printf "%s: %s\\n" "${BASH_SOURCE##*/}" "failed to update .gitconfig symlink" >&2
fi
[[ -n "$FILE" ]] && (cd "$HOME" && ln -sf "$FILE" ".gitconfig")
unset FILE