mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-10-31 09:22:15 +08:00 
			
		
		
		
	Merge pull request #1 from daxgames/status-branchonly-dax
Status branchonly dax
This commit is contained in:
		
							
								
								
									
										14
									
								
								vendor/clink.lua
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								vendor/clink.lua
									
									
									
									
										vendored
									
									
								
							| @@ -42,7 +42,7 @@ local function get_conflict_color() | |||||||
| end | end | ||||||
|  |  | ||||||
| local function get_unknown_color() | local function get_unknown_color() | ||||||
|   return unknown_color or "\x1b[30;1m" |   return unknown_color or "\x1b[37;1m" | ||||||
| end | end | ||||||
|  |  | ||||||
| --- | --- | ||||||
| @@ -397,18 +397,17 @@ local function git_prompt_filter() | |||||||
|         clean = get_clean_color(), |         clean = get_clean_color(), | ||||||
|         dirty = get_dirty_color(), |         dirty = get_dirty_color(), | ||||||
|         conflict = get_conflict_color(), |         conflict = get_conflict_color(), | ||||||
|         unknown = get_unknown_color() |         nostatus = get_unknown_color() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     local git_dir = get_git_dir() |     local git_dir = get_git_dir() | ||||||
|  |     local color | ||||||
|     cmderGitStatusOptIn = get_git_status_setting() |     cmderGitStatusOptIn = get_git_status_setting() | ||||||
|  |  | ||||||
|     if git_dir then |     if git_dir then | ||||||
|         -- if we're inside of git repo then try to detect current branch |  | ||||||
|         local branch = get_git_branch(git_dir) |         local branch = get_git_branch(git_dir) | ||||||
|         local color = colors.unknown |  | ||||||
|         if branch then |         if branch then | ||||||
|             if cmderGitStatusOptIn then |             if cmderGitStatusOptIn then | ||||||
|  |                 -- if we're inside of git repo then try to detect current branch | ||||||
|                 -- Has branch => therefore it is a git folder, now figure out status |                 -- Has branch => therefore it is a git folder, now figure out status | ||||||
|                 local gitStatus = get_git_status() |                 local gitStatus = get_git_status() | ||||||
|                 local gitConflict = get_git_conflict() |                 local gitConflict = get_git_conflict() | ||||||
| @@ -421,8 +420,9 @@ local function git_prompt_filter() | |||||||
|                 if gitConflict then |                 if gitConflict then | ||||||
|                     color = colors.conflict |                     color = colors.conflict | ||||||
|                 end |                 end | ||||||
|  |             else | ||||||
|  |                 color = colors.nostatus | ||||||
|             end |             end | ||||||
|  |  | ||||||
|             clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..verbatim(branch)..")") |             clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..verbatim(branch)..")") | ||||||
|             return false |             return false | ||||||
|         end |         end | ||||||
| @@ -443,6 +443,7 @@ local function hg_prompt_filter() | |||||||
|         local colors = { |         local colors = { | ||||||
|             clean = get_clean_color(), |             clean = get_clean_color(), | ||||||
|             dirty = get_dirty_color(), |             dirty = get_dirty_color(), | ||||||
|  |             nostatus = get_unknown_color() | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         local pipe = io.popen("hg branch 2>&1") |         local pipe = io.popen("hg branch 2>&1") | ||||||
| @@ -477,6 +478,7 @@ local function svn_prompt_filter() | |||||||
|     local colors = { |     local colors = { | ||||||
|         clean = get_clean_color(), |         clean = get_clean_color(), | ||||||
|         dirty = get_dirty_color(), |         dirty = get_dirty_color(), | ||||||
|  |         nostatus = get_unknown_color() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     if get_svn_dir() then |     if get_svn_dir() then | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								vendor/cmder_prompt_config.lua.default
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/cmder_prompt_config.lua.default
									
									
									
									
										vendored
									
									
								
							| @@ -43,4 +43,4 @@ lamb_color = "\x1b[1;30;40m" -- Light Grey = Lambda Color | |||||||
| clean_color = "\x1b[1;37;40m" | clean_color = "\x1b[1;37;40m" | ||||||
| dirty_color = "\x1b[33;3m" | dirty_color = "\x1b[33;3m" | ||||||
| conflict_color = "\x1b[31;1m" | conflict_color = "\x1b[31;1m" | ||||||
| unknown_color = "\x1b[30;1m" | unknown_color = "\x1b[37;1m" -- White = No VCS Status Branch Color | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								vendor/git-prompt.sh
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/git-prompt.sh
									
									
									
									
										vendored
									
									
								
							| @@ -61,7 +61,7 @@ else | |||||||
|         PS1="$PS1"'\[\033[36m\]'  # change color to cyan |         PS1="$PS1"'\[\033[36m\]'  # change color to cyan | ||||||
|         PS1="$PS1"'`__git_ps1`'   # bash function |         PS1="$PS1"'`__git_ps1`'   # bash function | ||||||
|       else |       else | ||||||
|         PS1="$PS1"'\[\033[30;1m\]'  # change color to gray |         PS1="$PS1"'\[\033[37;1m\]'  # change color to white | ||||||
|         PS1="$PS1"'`getSimpleGitBranch`' |         PS1="$PS1"'`getSimpleGitBranch`' | ||||||
|       fi |       fi | ||||||
|     fi |     fi | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								vendor/psmodules/Cmder.ps1
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/psmodules/Cmder.ps1
									
									
									
									
										vendored
									
									
								
							| @@ -43,7 +43,7 @@ function checkGit($Path) { | |||||||
|         } else { |         } else { | ||||||
|             $branchName = "HEAD detached at $($headContent.Substring(0, 7))" |             $branchName = "HEAD detached at $($headContent.Substring(0, 7))" | ||||||
|         } |         } | ||||||
|         Write-Host " [$branchName]" -NoNewline -ForegroundColor DarkGray |         Write-Host " [$branchName]" -NoNewline -ForegroundColor White | ||||||
|       } |       } | ||||||
|  |  | ||||||
|       return |       return | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user