From d7a95fa8807b109ef1ad97e31aa957272d700ccc Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Halili Date: Tue, 13 Aug 2024 23:54:16 +0800 Subject: [PATCH] chore(global): apply patches from termux branch See-Also: 00aa74c8255465f7a785dcc0b0f32f44bc0b2886 See-Also: cbeb6b6b8589f9e3bca51b838a8fbf919aca2a8e Signed-off-by: Andrei Jiroh Halili --- .config/yadm/bootstrap | 9 +++++-- .../yadm/bootstrap.d/00-post-clone-repo.sh | 27 +++++++++++-------- .gitconfig | 16 ++++++----- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap index 7eadc75..e327211 100755 --- a/.config/yadm/bootstrap +++ b/.config/yadm/bootstrap @@ -8,18 +8,23 @@ set -eu +if [[ $DEBUG != "" ]]; then + set -x +fi + # Directory to look for bootstrap executables in BOOTSTRAP_D="${BASH_SOURCE[0]}.d" if [[ ! -d "$BOOTSTRAP_D" ]]; then - echo "Error: bootstrap directory '$BOOTSTRAP_D' not found" >&2 + echo "[bootstrap] Error: bootstrap directory '$BOOTSTRAP_D' not found" >&2 exit 1 fi find -L "$BOOTSTRAP_D" -type f | sort | while IFS= read -r bootstrap; do if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ "~$" ]]; then + echo "[bootstrap] running $bootstrap" if ! "$bootstrap"; then - echo "Error: bootstrap '$bootstrap' failed" >&2 + echo "[bootstrap] Error: bootstrap '$bootstrap' failed" >&2 exit 1 fi fi diff --git a/.config/yadm/bootstrap.d/00-post-clone-repo.sh b/.config/yadm/bootstrap.d/00-post-clone-repo.sh index af8394a..59a0f7f 100755 --- a/.config/yadm/bootstrap.d/00-post-clone-repo.sh +++ b/.config/yadm/bootstrap.d/00-post-clone-repo.sh @@ -1,15 +1,20 @@ #!/usr/bin/env bash -set -x - -if [ ! -d "$HOME/.git" ] && [ -d "$HOME/.local/share/yadm/repo.git" ]; then - echo "Symlinking ~/.git to ~/.local/share/yadm/repo.git for compatibility" - ln -s ~/.local/share/yadm/repo.git ~/.git -elif [ -d "$HOME/.git" ] && [ ! -d "$HOME/.local/share/yadm/repo.git" ]; then - echo "Symlinking ~/.local/share/yadm/repo.git to ~/.git for compatibility" - ln -s ~/.git ~/.local/share/yadm/repo.git +if [ $DEBUG != "" ]; then + set -x fi -echo "Setting git remote URLs to SSH" -git remote set-url --add origin ssh://git@mau.dev/andreijiroh.dev/dotfiles || true -git remote set-url --add hut ssh://git@git.sr.ht/~ajhalili2006/dotfiles || git remote add hut ssh://git@git.sr.ht/~ajhalili2006/dotfiles +if [ ! -d "$HOME/.git" ] && [ -d "$HOME/.local/share/yadm/repo.git" ]; then + echo "[git-symlinks] Symlinking ~/.git to ~/.local/share/yadm/repo.git for compatibility" + ln -s ~/.local/share/yadm/repo.git ~/.git +elif [ -d "$HOME/.git" ] && [ ! -d "$HOME/.local/share/yadm/repo.git" ]; then + echo "[git-symlinks] Symlinking ~/.local/share/yadm/repo.git to ~/.git for compatibility" + ln -s ~/.git ~/.local/share/yadm/repo.git +else + echo "[git-symlinks] Looks like everything is all clear on git" +fi + +echo "[git-remotes] Setting git remote URLs to SSH" +git remote set-url --add --push hut ssh://git@git.sr.ht/~ajhalili2006/dotfiles \ + || git remote add hut https://git.sr.ht/~ajhalili2006/dotfiles \ + && git remote set-url --add --push hut ssh://git@git.sr.ht/~ajhalili2006/dotfiles diff --git a/.gitconfig b/.gitconfig index 7a6facf..961bc4f 100644 --- a/.gitconfig +++ b/.gitconfig @@ -25,19 +25,19 @@ # authentication hellscape [credential "https://github.com"] helper = - helper = !/usr/bin/gh auth git-credential + helper = !gh auth git-credential [credential "https://gist.github.com"] helper = - helper = !/usr/bin/gh auth git-credential + helper = !gh auth git-credential [credential "https://gitlab.com"] helper = - helper = !/usr/bin/glab auth git-credential + helper = !glab auth git-credential [credential "https://mau.dev"] helper = - helper = !/usr/bin/glab auth git-credential + helper = !glab auth git-credential [credential "https://gitlab.alpinelinux.org"] helper = - helper = !/usr/bin/glab auth git-credential + helper = !glab auth git-credential # sendemail stuff (https://go.recaptime.eu.org/sendgmail) #[sendemail] @@ -82,8 +82,8 @@ # path = ~/.config/git/ajhalili2006-experiments.include.gitconfig #[includeIf "gitdir/i:~/projects/labs.andreijiroh.dev"] # path = ~/.config/git/ajhalili2006-experiments.include.gitconfig -[includeIf "gitdir/i:~/git-projects/recaptime.dev/"] - path = ~/.config/git/recaptime-dev.include.gitconfig +#[includeIf "gitdir/i:~/git-projects/recaptime.dev/"] +# path = ~/.config/git/recaptime-dev.include.gitconfig [includeIf "gitdir/i:~/projects/recaptime.dev/"] path = ~/.config/git/recaptime-dev.include.gitconfig [includeIf "gitdir/i:/workspaces/recaptime.dev/"] @@ -107,3 +107,5 @@ command = echo \"$(git config user.name) <$(git config user.email)>\" [push] autoSetupRemote = true +[safe] + directory = /storage/emulated/0/Documents/git/recaptime-dev/proxyparty