]> git.madduck.net Git - etc/git.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

update prompt vars after git command runs
authormartin f. krafft <madduck@madduck.net>
Mon, 6 Sep 2021 10:34:31 +0000 (22:34 +1200)
committermartin f. krafft <madduck@madduck.net>
Mon, 6 Sep 2021 10:34:31 +0000 (22:34 +1200)
.zsh/zshrc/parts.d/50-git

index da11bf80a96942309961035ff0dd75f872ee81e2..9419e15afc9ff72fc365513b97bb634489276982 100644 (file)
@@ -60,6 +60,13 @@ __git_set_prompt_variable() {
 add-zsh-hook chpwd __git_set_prompt_variable
 __git_set_prompt_variable
 
 add-zsh-hook chpwd __git_set_prompt_variable
 __git_set_prompt_variable
 
+__update_git_prompt_vars_if_git_ran() {
+  case "$(history $(($HISTCMD - 1)))" in
+    *git*) __git_set_prompt_variable
+  esac
+}
+add-zsh-hook precmd __update_git_prompt_vars_if_git_ran
+
 __git_print_preprompt()
 {
   [[ $? -eq 0 ]] || return
 __git_print_preprompt()
 {
   [[ $? -eq 0 ]] || return