Dynamic dir-change handling for git probe.

This commit is contained in:
2026-07-08 04:50:04 -04:00
parent 923077453a
commit 1576e944ee
3 changed files with 34 additions and 3 deletions
+25
View File
@@ -0,0 +1,25 @@
#if ( ! $?cshenv_gitdirs )
set cshenv_gitdirs=( /home/adam/cshenv:/home/adam/cshenv/.git )
set _masked_cwd=$cwd:as/ //
#echo "${_masked_cwd}"
set _search_key="${_masked_cwd}"
#echo "${_search_key}"
#echo "dirs $cshenv_gitdirs"
#echo "cache-match $cshenv_gitdirs:as/${_masked_cwd}//"
#echo "cache-match $cshenv_gitdirs:gx/^${_search_key}*/"
#set _cache_match = ( $cshenv_gitdirs:gx^${_search_key}* )
#if ( ${#_cache_match} == 1 ) then
#echo "Found ${_cache_match}"
#else
set _git_check=( `git rev-parse --git-dir |&cat` )
#if ( -d "${_git_check}" ) then
#echo "Found and installed ${_git_check} git dir"
#set _masked_git=$_git_check:as/ //
#set cshenv_dirs=( ${cshenv_dirs} "${_masked_cwd}${masked_git}" )
#else
#echo "Found no git dir for ${_masked_cwd}"
#set cshenv_dirs=( ${cshenv_dirs} "${_masked_cwd}" )
#endif
#endif