From 46a372a8730aedb2dadecea3df0833fd7b52bbd7 Mon Sep 17 00:00:00 2001 From: Yax Date: Thu, 22 Jan 2026 08:11:17 +0100 Subject: [PATCH] Share project git fetch b/w ZSH and SESH --- dot_zshrc.tmpl | 14 +------------- private_dot_local/bin/executable_project_git_fetch | 9 +++++++++ 2 files changed, 10 insertions(+), 13 deletions(-) create mode 100644 private_dot_local/bin/executable_project_git_fetch diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index df2d389..9f5cf40 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -66,21 +66,9 @@ if command -v tig &>/dev/null; then fi chpwd() { - # Is this directory inside a git repo? - if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then - - # Are we at the repo root? (prefix empty = root) - - if [ -z "$(git rev-parse --show-prefix)" ]; then - echo "Fetching latest changes from remote..." - git fetch - fi - - fi + project_git_fetch } -alias f='git fetch' - # --------------------------------------------------------------------------- # Editor # --------------------------------------------------------------------------- diff --git a/private_dot_local/bin/executable_project_git_fetch b/private_dot_local/bin/executable_project_git_fetch new file mode 100644 index 0000000..804ad3a --- /dev/null +++ b/private_dot_local/bin/executable_project_git_fetch @@ -0,0 +1,9 @@ +#!/usr/bin/env zsh +# Is this directory inside a git repo? +if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + # Are we at the repo root? (prefix empty = root) + if [ -z "$(git rev-parse --show-prefix)" ]; then + echo "Fetching latest changes from remote..." + git fetch + fi +fi \ No newline at end of file