mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-10-31 09:22:15 +08:00 
			
		
		
		
	dd per shell git opt out
This commit is contained in:
		| @@ -184,7 +184,10 @@ You can write `*.cmd|*.bat`, `*.ps1`, and `*.sh` scripts and just drop them in t | |||||||
|  |  | ||||||
|  ``` |  ``` | ||||||
|  [cmder] |  [cmder] | ||||||
|    status = false |    status = false      # Opt out of Git status for 'ALL' Cmder supported shells. | ||||||
|  |    cmdstatus = false   # Opt out of Git status for 'Cmd.exe' shells. | ||||||
|  |    psstatus = false    # Opt out of Git status for 'Powershell.exe and 'Pwsh.exe' shells. | ||||||
|  |    shstatus = false    # Opt out of Git status for 'bash.exe' shells. | ||||||
|  ``` |  ``` | ||||||
|  |  | ||||||
| ### Aliases | ### Aliases | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								vendor/clink.lua
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/clink.lua
									
									
									
									
										vendored
									
									
								
							| @@ -285,10 +285,10 @@ end | |||||||
| -- @return {bool} | -- @return {bool} | ||||||
| --- | --- | ||||||
| local function get_git_status_setting() | local function get_git_status_setting() | ||||||
|     gitStatusSetting = io.popen("git config cmder.status") |     gitStatusSetting = io.popen("git --no-pager config -l") | ||||||
|  |  | ||||||
|     for line in gitStatusSetting:lines() do |     for line in gitStatusSetting:lines() do | ||||||
|         if string.match(line, 'false') then |         if string.match(line, 'cmder.status=false') or string.match(line, 'cmder.cmdstatus=false') then | ||||||
|           gitStatusSetting:close() |           gitStatusSetting:close() | ||||||
|           return false |           return false | ||||||
|         end |         end | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								vendor/git-prompt.sh
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/git-prompt.sh
									
									
									
									
										vendored
									
									
								
							| @@ -1,7 +1,7 @@ | |||||||
| function getGitStatusSetting() { | function getGitStatusSetting() { | ||||||
|   gitStatusSetting=$(git config cmder.status 2>/dev/null)   |   gitStatusSetting=$(git --no-pager config -l 2>/dev/null)   | ||||||
|  |  | ||||||
|   if [[ -n ${gitStatusSetting} ]] && [[ ${gitStatusSetting} == false ]] |   if [[ -n ${gitStatusSetting} ]] && [[ ${gitStatusSetting} =~ cmder.status=false ]] || [[ ${gitStatusSetting} =~ cmder.shstatus=false ]] | ||||||
|   then |   then | ||||||
|     echo false |     echo false | ||||||
|   else |   else | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								vendor/psmodules/Cmder.ps1
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								vendor/psmodules/Cmder.ps1
									
									
									
									
										vendored
									
									
								
							| @@ -16,6 +16,7 @@ function Configure-Git($GIT_INSTALL_ROOT){ | |||||||
| } | } | ||||||
|  |  | ||||||
| function Import-Git(){ | function Import-Git(){ | ||||||
|  |  | ||||||
|     $GitModule = Get-Module -Name Posh-Git -ListAvailable |     $GitModule = Get-Module -Name Posh-Git -ListAvailable | ||||||
|     if($GitModule | select version | where version -le ([version]"0.6.1.20160330")){ |     if($GitModule | select version | where version -le ([version]"0.6.1.20160330")){ | ||||||
|         Import-Module Posh-Git > $null |         Import-Module Posh-Git > $null | ||||||
| @@ -46,11 +47,13 @@ function checkGit($Path) { | |||||||
| } | } | ||||||
|  |  | ||||||
| function getGitStatusSetting() { | function getGitStatusSetting() { | ||||||
|     $gitStatus = (git config cmder.status) | out-string |     $gitStatus = (git --no-pager config -l) | out-string | ||||||
|  |  | ||||||
|     if (($gitStatus -replace "`n" -replace "`r") -eq "false") { |     ForEach ($line in $($gitStatus -split "`r`n")) { | ||||||
|  |         if ($line -match 'cmder.status=false' -or $line -match 'cmder.psstatus=false') { | ||||||
|             return $false |             return $false | ||||||
|     } else { |  | ||||||
|         return $true |  | ||||||
|         } |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     return $true | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user