]> git.madduck.net Git - etc/zsh.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:

completely disable the vcs prompt on network filesystems
authormartin f. krafft <madduck@madduck.net>
Fri, 25 Aug 2017 08:30:25 +0000 (10:30 +0200)
committermartin f. krafft <madduck@madduck.net>
Fri, 25 Aug 2017 08:30:25 +0000 (10:30 +0200)
.zsh/themes/prompt_madduck_setup

index 100ce874162e750dfd74058deed0b2131a1c6821..3f0f3e5c9a4082d58750b1e376da90e0b9955fab 100644 (file)
@@ -141,6 +141,11 @@ __vcs_get_repo_type()
 {
   emulate -L zsh
   # return the type of the closest repository in the path hierarchy
 {
   emulate -L zsh
   # return the type of the closest repository in the path hierarchy
+  # unless we're on a network filesystem:
+  if __on_networkfs; then
+    echo netfs
+    return
+  fi
   local dir
   while true; do
     [ -d ${dir}.git ] && echo git && break
   local dir
   while true; do
     [ -d ${dir}.git ] && echo git && break
@@ -259,7 +264,7 @@ __vcs_set_prompt_variables()
       ;;
     *)
       case "$repotype" in
       ;;
     *)
       case "$repotype" in
-        NONE) :;;
+        NONE|netfs) :;;
         *) warn "$repotype repositories not (yet) supported in the prompt";;
       esac
       local MAXLEN MINLEN
         *) warn "$repotype repositories not (yet) supported in the prompt";;
       esac
       local MAXLEN MINLEN
@@ -293,9 +298,11 @@ if ! is_root; then
 
   _update_vcs_prompt_vars_if_vcs_ran() {
     local vcs="$(__vcs_get_repo_type)"
 
   _update_vcs_prompt_vars_if_vcs_ran() {
     local vcs="$(__vcs_get_repo_type)"
-    case "$(history $(($HISTCMD - 1)))" in
+    case "$vcs/$(history $(($HISTCMD - 1)))" in
       # $vcs appeared in last command, so be sure to update
       # $vcs appeared in last command, so be sure to update
-      *${vcs}*) __vcs_set_prompt_variables "$vcs"
+      NONE/*) :;;
+      netfs/*) :;;
+      */*${vcs}*) __vcs_set_prompt_variables "$vcs"
     esac
   }
   add-zsh-hook precmd _update_vcs_prompt_vars_if_vcs_ran
     esac
   }
   add-zsh-hook precmd _update_vcs_prompt_vars_if_vcs_ran