From fce5d67082392a25678a4a2afa1d3e5b96edae7d Mon Sep 17 00:00:00 2001 From: "Snedecor, David" Date: Thu, 22 Mar 2018 16:46:42 -0500 Subject: [PATCH 1/2] Update git status to always show untracked files. Fixes dahlbyk/posh-git#556 --- src/GitUtils.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitUtils.ps1 b/src/GitUtils.ps1 index 0c221c41c..c79ed9194 100644 --- a/src/GitUtils.ps1 +++ b/src/GitUtils.ps1 @@ -232,7 +232,7 @@ function Get-GitStatus($gitDir = (Get-GitDirectory)) { if ($cacheResponse.State) { $branch += "|" + $cacheResponse.State } } else { dbg 'Getting status' $sw - $status = Invoke-Utf8ConsoleCommand { git -c core.quotepath=false -c color.status=false status --short --branch 2>$null } + $status = Invoke-Utf8ConsoleCommand { git -c core.quotepath=false -c color.status=false status -uall --short --branch 2>$null } if($settings.EnableStashStatus) { dbg 'Getting stash count' $sw $stashCount = $null | git stash list 2>$null | measure-object | Select-Object -expand Count From 81dc263aef531b0784a35cd20be9a2b1efb7dc84 Mon Sep 17 00:00:00 2001 From: "Snedecor, David" Date: Mon, 16 Apr 2018 22:26:43 -0500 Subject: [PATCH 2/2] Added new $GitPromptSettings.UntrackedFilesMode setting. --- src/GitPrompt.ps1 | 3 +++ src/GitUtils.ps1 | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/GitPrompt.ps1 b/src/GitPrompt.ps1 index 010af199c..67895998a 100644 --- a/src/GitPrompt.ps1 +++ b/src/GitPrompt.ps1 @@ -87,6 +87,9 @@ $global:GitPromptSettings = [pscustomobject]@{ ShowStatusWhenZero = $true + # Valid values are "all", "no", and "normal" + UntrackedFilesMode = $null + AutoRefreshIndex = $true # Valid values are "Full", "Compact", and "Minimal" diff --git a/src/GitUtils.ps1 b/src/GitUtils.ps1 index c79ed9194..311ac903b 100644 --- a/src/GitUtils.ps1 +++ b/src/GitUtils.ps1 @@ -232,7 +232,8 @@ function Get-GitStatus($gitDir = (Get-GitDirectory)) { if ($cacheResponse.State) { $branch += "|" + $cacheResponse.State } } else { dbg 'Getting status' $sw - $status = Invoke-Utf8ConsoleCommand { git -c core.quotepath=false -c color.status=false status -uall --short --branch 2>$null } + $untrackedFilesOption = if($settings.UntrackedFilesMode) { "-u$($settings.UntrackedFilesMode)" } else { "" } + $status = Invoke-Utf8ConsoleCommand { git -c core.quotepath=false -c color.status=false status $untrackedFilesOption --short --branch 2>$null } if($settings.EnableStashStatus) { dbg 'Getting stash count' $sw $stashCount = $null | git stash list 2>$null | measure-object | Select-Object -expand Count