From 8a98e517c68a1bcda92be2a80da09981700d4ff9 Mon Sep 17 00:00:00 2001 From: Matthew John Cheetham Date: Mon, 28 Jul 2025 09:54:21 -0700 Subject: [PATCH 1/9] build: stop creating/uploading GVFS.Installers nupkg Stop creating and uploading (for the functional tests) NuGet packages for the GVFS.Installers project. We no longer maintain the packages: * GitForWindows.GVFS.Installer * GitForWindows.GVFS.Portable Signed-off-by: Matthew John Cheetham --- .github/workflows/build.yaml | 6 ------ GVFS/GVFS.Installers/GVFS.Installers.csproj | 11 ---------- .../GVFS.Installers.template.nuspec | 15 -------------- Version.props | 7 ++----- scripts/CreateBuildArtifacts.bat | 20 ------------------- 5 files changed, 2 insertions(+), 57 deletions(-) delete mode 100644 GVFS/GVFS.Installers/GVFS.Installers.template.nuspec diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 92e9ab675..4f3f30841 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -59,12 +59,6 @@ jobs: name: Installers_${{ matrix.configuration }} path: artifacts\GVFS.Installers - - name: Upload NuGet packages - uses: actions/upload-artifact@v4 - with: - name: NuGetPackages_${{ matrix.configuration }} - path: artifacts\NuGetPackages - functional_test: runs-on: windows-2025 name: Functional Tests diff --git a/GVFS/GVFS.Installers/GVFS.Installers.csproj b/GVFS/GVFS.Installers/GVFS.Installers.csproj index 13cf3e601..4470aeaba 100644 --- a/GVFS/GVFS.Installers/GVFS.Installers.csproj +++ b/GVFS/GVFS.Installers/GVFS.Installers.csproj @@ -13,8 +13,6 @@ - - @@ -24,13 +22,8 @@ - - - @@ -44,10 +37,6 @@ - - - - diff --git a/GVFS/GVFS.Installers/GVFS.Installers.template.nuspec b/GVFS/GVFS.Installers/GVFS.Installers.template.nuspec deleted file mode 100644 index 8991bd81e..000000000 --- a/GVFS/GVFS.Installers/GVFS.Installers.template.nuspec +++ /dev/null @@ -1,15 +0,0 @@ - - - - GVFS.Installers - $version$ - Microsoft - false - GVFS and G4W installers - - - - - - - diff --git a/Version.props b/Version.props index 1547245ce..d1f6f341b 100644 --- a/Version.props +++ b/Version.props @@ -5,10 +5,8 @@ 0.2.173.2 - 2.20220414.4 v2.31.0.vfs.0.1 diff --git a/scripts/CreateBuildArtifacts.bat b/scripts/CreateBuildArtifacts.bat index 5cca08d5a..797ed0bf9 100644 --- a/scripts/CreateBuildArtifacts.bat +++ b/scripts/CreateBuildArtifacts.bat @@ -14,13 +14,6 @@ IF "%~2"=="" ( SET OUTROOT=%2 ) -REM Check NuGet is on the PATH -where /q nuget.exe -IF ERRORLEVEL 1 ( - ECHO ERROR: Could not find nuget.exe on the PATH - EXIT /B 1 -) - IF EXIST %OUTROOT% ( rmdir /s /q %OUTROOT% ) @@ -60,19 +53,6 @@ xcopy /S /Y ^ %VFS_OUTDIR%\GVFS.FunctionalTests\bin\%CONFIGURATION%\net471\win-x64 ^ %OUTROOT%\GVFS.FunctionalTests\ || GOTO ERROR -ECHO ^************************************* -ECHO ^* Creating Installers NuGet Package * -ECHO ^************************************* -mkdir %OUTROOT%\NuGetPackages -nuget.exe pack ^ - %VFS_OUTDIR%\GVFS.Installers\bin\%CONFIGURATION%\win-x64\GVFS.Installers.nuspec ^ - -BasePath %VFS_OUTDIR%\GVFS.Installers\bin\%CONFIGURATION%\win-x64 ^ - -OutputDirectory %OUTROOT%\NuGetPackages || GOTO ERROR - -REM Move the nuspec file to the NuGetPackages artifact directory -move %OUTROOT%\GVFS.Installers\GVFS.Installers.nuspec ^ - %OUTROOT%\NuGetPackages - GOTO :EOF :USAGE From f215829cc7ce5b3e913e2db9924dcc16e7e62613 Mon Sep 17 00:00:00 2001 From: Matthew John Cheetham Date: Mon, 28 Jul 2025 09:56:24 -0700 Subject: [PATCH 2/9] build: download microsoft/git installers from GitHub Download the Microsoft Git installers from GitHub releases via the `gh` CLI tool. The installers (both portable and Inno Setup based) are included in the Installers_${{ matrix.configuration }} build artifact that is consumed by the functional test jobs. Signed-off-by: Matthew John Cheetham --- .github/workflows/build.yaml | 34 +++++ .../workflows/scripts/validate_release.ps1 | 124 ++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 .github/workflows/scripts/validate_release.ps1 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4f3f30841..d4af2ab39 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,11 +5,38 @@ on: branches: [ master, releases/shipped ] push: branches: [ master, releases/shipped ] + workflow_dispatch: + inputs: + git_version: + description: 'Microsoft Git version tag to include in the build (leave empty for default)' + required: false + type: string + +env: + GIT_VERSION: ${{ github.event.inputs.git_version || 'v2.50.1.vfs.0.1' }} jobs: + validate: + runs-on: windows-2025 + name: Validation + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Validate Microsoft Git version + shell: pwsh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + & "$env:GITHUB_WORKSPACE\.github\workflows\scripts\validate_release.ps1" ` + -Repository microsoft/git ` + -Tag $env:GIT_VERSION && ` + Write-Host ::notice title=Validation::Using microsoft/git version $env:GIT_VERSION + build: runs-on: windows-2025 name: Build and Unit Test + needs: validate strategy: matrix: @@ -41,6 +68,13 @@ jobs: shell: cmd run: src\scripts\CreateBuildArtifacts.bat ${{ matrix.configuration }} artifacts + - name: Download microsoft/git installers + shell: cmd + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release download %GIT_VERSION% --repo microsoft/git --pattern "Git*.exe" --dir artifacts\GVFS.Installers + - name: Upload functional tests drop uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/scripts/validate_release.ps1 b/.github/workflows/scripts/validate_release.ps1 new file mode 100644 index 000000000..b9ee8c04d --- /dev/null +++ b/.github/workflows/scripts/validate_release.ps1 @@ -0,0 +1,124 @@ +param( + [Parameter(Mandatory=$true)] + [string]$Tag, + + [Parameter(Mandatory=$true)] + [string]$Repository +) + +function Write-GitHubActionsCommand { + param( + [Parameter(Mandatory=$true)] + [string]$Command, + + [Parameter(Mandatory=$true)] + [string]$Message, + + [Parameter(Mandatory=$true)] + [string]$Title + ) + + Write-Host "::$Command title=$Title::$Message" +} + + +function Write-GitHubActionsWarning { + param( + [Parameter(Mandatory=$true)] + [string]$Message, + + [Parameter(Mandatory=$false)] + [string]$Title = "Warning" + ) + + if ($env:GITHUB_ACTIONS -eq "true") { + Write-GitHubActionsCommand -Command "warning" -Message $Message -Title $Title + } else { + Write-Host "! Warning: $Message" -ForegroundColor Yellow + } +} + +function Write-GitHubActionsError { + param( + [Parameter(Mandatory=$true)] + [string]$Message, + + [Parameter(Mandatory=$false)] + [string]$Title = "Error" + ) + + if ($env:GITHUB_ACTIONS -eq "true") { + Write-GitHubActionsCommand -Command "error" -Message $Message -Title $Title + } else { + Write-Host "x Error: $Message" -ForegroundColor Red + } +} + +if ([string]::IsNullOrWhiteSpace($Tag)) { + Write-GitHubActionsError -Message "Tag parameter is required" + exit 1 +} + +if ([string]::IsNullOrWhiteSpace($Repository)) { + Write-GitHubActionsError -Message "Repository parameter is required" + exit 1 +} + +Write-Host "Validating $Repository release '$Tag'..." + +# Prepare headers for GitHub API +$headers = @{ + 'Accept' = 'application/vnd.github.v3+json' + 'User-Agent' = 'VFSForGit-Build' +} + +if ($env:GITHUB_TOKEN) { + $headers['Authorization'] = "Bearer $env:GITHUB_TOKEN" +} + +# Check if the tag exists in microsoft/git repository +try { + $releaseResponse = Invoke-RestMethod ` + -Uri "https://api.github.com/repos/$Repository/releases/tags/$Tag" ` + -Headers $headers + + Write-Host "✓ Tag '$Tag' found in $Repository" -ForegroundColor Green + Write-Host " Release : $($releaseResponse.name)" + Write-Host " Published : $($releaseResponse.published_at.ToString('u'))" + + # Check if this a pre-release + if ($releaseResponse.prerelease -eq $true) { + Write-GitHubActionsWarning ` + -Message "Using a pre-released version of $Repository" ` + -Title "Pre-release $Repository version" + } + + # Get the latest release for comparison + try { + $latestResponse = Invoke-RestMethod ` + -Uri "https://api.github.com/repos/$Repository/releases/latest" ` + -Headers $headers + $latestTag = $latestResponse.tag_name + + # Check if this is the latest release + if ($Tag -eq $latestTag) { + Write-Host "✓ Using the latest release" -ForegroundColor Green + exit 0 + } + + # Not the latest! + $warningTitle = "Outdated $Repository release" + $warningMsg = "Not using latest release of $Repository (latest: $latestTag)" + Write-GitHubActionsWarning -Message $warningMsg -Title $warningTitle + } catch { + Write-GitHubActionsWarning -Message "Could not check latest release info for ${Repository}: $($_.Exception.Message)" + } +} catch { + if ($_.Exception.Response.StatusCode -eq 404) { + Write-GitHubActionsError -Message "Tag '$Tag' does not exist in $Repository" + exit 1 + } else { + Write-GitHubActionsError -Message "Error validating release '$Tag': $($_.Exception.Message)" + exit 1 + } +} From 3d6f13d8a051ac8514d447c80b451cf342792156 Mon Sep 17 00:00:00 2001 From: Matthew John Cheetham Date: Mon, 28 Jul 2025 09:58:26 -0700 Subject: [PATCH 3/9] ft: install arch-specific msftgit and print OS version Install the correct version of Microsoft Git in the functional tests for the OS architecture, and print more OS/CPU information for good measure. Signed-off-by: Matthew John Cheetham --- GVFS/GVFS.Installers/info.bat | 12 ++++++++++++ GVFS/GVFS.Installers/install.bat | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/GVFS/GVFS.Installers/info.bat b/GVFS/GVFS.Installers/info.bat index b068f9c69..ba61fbc7a 100644 --- a/GVFS/GVFS.Installers/info.bat +++ b/GVFS/GVFS.Installers/info.bat @@ -9,19 +9,31 @@ SET VFS_BUND_PROJFSLIB=C:\Program Files\VFS for Git\ProjFS\ProjectedFSLib.dll SET VFS_EXEC=C:\Program Files\VFS for Git\GVFS.exe SET GIT_EXEC=C:\Program Files\Git\cmd\git.exe +REM Lookup the current Windows version +FOR /F "tokens=*" %%i IN ('powershell -Command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"') DO SET OS_VER=%%i + +ECHO Print system information... +ECHO OS version: %OS_VER% +ECHO CPU architecture: %PROCESSOR_ARCHITECTURE% + +ECHO. ECHO Checking ProjFS Windows feature... powershell -Command "Get-WindowsOptionalFeature -Online -FeatureName Client-ProjFS" +ECHO. ECHO Checking ProjFS and GVFS services... ECHO GVFS.Service: sc query GVFS.Service +ECHO. ECHO Test.GVFS.Service: sc query Test.GVFS.Service +ECHO. ECHO prjflt: sc query prjflt +ECHO. ECHO Checking ProjFS files... IF EXIST "%SYS_PRJFLT%" ( ECHO [ FOUND ] %SYS_PRJFLT% diff --git a/GVFS/GVFS.Installers/install.bat b/GVFS/GVFS.Installers/install.bat index c629c75bc..8375be193 100644 --- a/GVFS/GVFS.Installers/install.bat +++ b/GVFS/GVFS.Installers/install.bat @@ -1,8 +1,18 @@ @ECHO OFF SETLOCAL +REM Determine the correct architecture for the installer +IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( + SET GIT_ARCH=64-bit +) ELSE IF "%PROCESSOR_ARCHITECTURE%"=="ARM64" ( + SET GIT_ARCH=arm64 +) ELSE ( + ECHO Unknown architecture: %PROCESSOR_ARCHITECTURE% + exit 1 +) + REM Lookup full paths to Git and VFS for Git installers -FOR /F "tokens=* USEBACKQ" %%F IN ( `where /R %~dp0 Git*.exe` ) DO SET GIT_INSTALLER=%%F +FOR /F "tokens=* USEBACKQ" %%F IN ( `where /R %~dp0 Git*-%GIT_ARCH%.exe` ) DO SET GIT_INSTALLER=%%F FOR /F "tokens=* USEBACKQ" %%F IN ( `where /R %~dp0 SetupGVFS*.exe` ) DO SET GVFS_INSTALLER=%%F REM Create new empty directory for logs @@ -12,7 +22,7 @@ IF EXIST %LOGDIR% ( ) mkdir %LOGDIR% -ECHO Installing Git for Windows... +ECHO Installing Git (%GIT_ARCH%)... %GIT_INSTALLER% /LOG="%LOGDIR%\git.log" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /ALLOWDOWNGRADE=1 ECHO Installing VFS for Git... From e66befe32f7830c76368ae9b85c6b80218e8e7b0 Mon Sep 17 00:00:00 2001 From: Matthew John Cheetham Date: Mon, 28 Jul 2025 10:25:42 -0700 Subject: [PATCH 4/9] ft: run functional tests on ARM64 Let's use the ARM64 Windows images (currently in public preview) on GitHub hosted runners to run the functional tests on ARM. VFS for Git is still only built for x86_64, but we do now include a natively compiled Git for ARM64 - so let's exercise that! Signed-off-by: Matthew John Cheetham --- .github/workflows/build.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d4af2ab39..79a4e4cc8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -94,13 +94,14 @@ jobs: path: artifacts\GVFS.Installers functional_test: - runs-on: windows-2025 + runs-on: ${{ matrix.architecture == 'arm64' && 'windows-11-arm' || 'windows-2025' }} name: Functional Tests needs: build strategy: matrix: configuration: [ Debug, Release ] + architecture: [ x86_64, arm64 ] steps: - name: Download installers @@ -131,7 +132,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: InstallationLogs_${{ matrix.configuration }} + name: InstallationLogs_${{ matrix.configuration }}_${{ matrix.architecture }} path: install\logs - name: Run functional tests @@ -145,14 +146,14 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: FunctionalTests_Results_${{ matrix.configuration }} + name: FunctionalTests_Results_${{ matrix.configuration }}_${{ matrix.architecture }} path: TestResult.xml - name: Upload Git trace2 output if: always() uses: actions/upload-artifact@v4 with: - name: GitTrace2_${{ matrix.configuration }} + name: GitTrace2_${{ matrix.configuration }}_${{ matrix.architecture }} path: C:\temp\git-trace2.log - name: ProjFS details (post-test) From 3b6c22387e2e1fea713a86cf90f24bcba73406ad Mon Sep 17 00:00:00 2001 From: Matthew John Cheetham Date: Mon, 28 Jul 2025 11:04:47 -0700 Subject: [PATCH 5/9] Functional Tests: refactor out output filtering In preparing to accounting for the "You are in a partially-hydrated checkout with %d% of tracked files present" message that was added in Microsoft Git v2.XX.Y, let's refactor the existing output filtering (which is so far only done for `stderr`) into its own method. Signed-off-by: Matthew John Cheetham Signed-off-by: Johannes Schindelin --- GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs b/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs index 8aacac84a..452bb1443 100644 --- a/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs +++ b/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs @@ -66,12 +66,23 @@ public static ProcessResult InvokeGitAgainstGVFSRepo( bool removeUpgradeMessages = true) { ProcessResult result = GitProcess.InvokeProcess(gvfsRepoRoot, command, environmentVariables); - string errors = result.Errors; + string errors = FilterMessages(result.Errors, removeWaitingMessages, removeUpgradeMessages); - if (!string.IsNullOrEmpty(errors) && (removeWaitingMessages || removeUpgradeMessages)) + return new ProcessResult( + result.Output, + errors, + result.ExitCode); + } + + private static string FilterMessages( + string input, + bool removeWaitingMessages, + bool removeUpgradeMessages) + { + if (!string.IsNullOrEmpty(input) && (removeWaitingMessages || removeUpgradeMessages)) { - IEnumerable errorLines = errors.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - IEnumerable filteredErrorLines = errorLines.Where(line => + IEnumerable lines = input.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); + IEnumerable filteredLines = lines.Where(line => { if (string.IsNullOrWhiteSpace(line) || (removeUpgradeMessages && line.StartsWith("A new version of VFS for Git is available.")) || @@ -85,13 +96,10 @@ public static ProcessResult InvokeGitAgainstGVFSRepo( } }); - errors = filteredErrorLines.Any() ? string.Join(Environment.NewLine, filteredErrorLines) : string.Empty; + return filteredLines.Any() ? string.Join(Environment.NewLine, filteredLines) : string.Empty; } - return new ProcessResult( - result.Output, - errors, - result.ExitCode); + return input; } public static void ValidateGitCommand( From 7e4e345aeaa2d69788c03c4ee76e2a0094e58edf Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 13 Aug 2025 15:05:24 +0200 Subject: [PATCH 6/9] Functional Tests: when filtering Git output, retain newlines faithfully There are tests that find multi-line needles in the Git output's haystack. So far, those tests work on `stdout` only. We are about to filter `stdout` using the new `FilterMessages()` method, therefore that method must stop its current practice where it splits by newlines and then joins using `Environment.Newline` (even if that is different from what the input had before). Signed-off-by: Johannes Schindelin --- GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs b/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs index 452bb1443..c9f9768c2 100644 --- a/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs +++ b/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs @@ -74,6 +74,23 @@ public static ProcessResult InvokeGitAgainstGVFSRepo( result.ExitCode); } + private static IEnumerable SplitLinesKeepingNewlines(string input) + { + for (int start = 0; start < input.Length; ) + { + int nextLine = input.IndexOf('\n', start) + 1; + + if (nextLine == 0) + { + // No more newlines, yield the rest + nextLine = input.Length; + } + + yield return input.Substring(start, nextLine - start); + start = nextLine; + } + } + private static string FilterMessages( string input, bool removeWaitingMessages, @@ -81,7 +98,7 @@ private static string FilterMessages( { if (!string.IsNullOrEmpty(input) && (removeWaitingMessages || removeUpgradeMessages)) { - IEnumerable lines = input.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); + IEnumerable lines = SplitLinesKeepingNewlines(input); IEnumerable filteredLines = lines.Where(line => { if (string.IsNullOrWhiteSpace(line) || @@ -96,7 +113,7 @@ private static string FilterMessages( } }); - return filteredLines.Any() ? string.Join(Environment.NewLine, filteredLines) : string.Empty; + return filteredLines.Any() ? string.Join("", filteredLines) : string.Empty; } return input; From 23001d596cc3a2a25b24290a87e9009d8c057c4b Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 13 Aug 2025 15:09:04 +0200 Subject: [PATCH 7/9] Functional Tests: support retaining empty lines in FilterMessages() Currently, we only filter `stderr`, but we're about to do that with `stdout`, too, where we do not want to skip empty lines. Signed-off-by: Johannes Schindelin --- GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs b/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs index c9f9768c2..19249ba79 100644 --- a/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs +++ b/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs @@ -66,7 +66,7 @@ public static ProcessResult InvokeGitAgainstGVFSRepo( bool removeUpgradeMessages = true) { ProcessResult result = GitProcess.InvokeProcess(gvfsRepoRoot, command, environmentVariables); - string errors = FilterMessages(result.Errors, removeWaitingMessages, removeUpgradeMessages); + string errors = FilterMessages(result.Errors, true, removeWaitingMessages, removeUpgradeMessages); return new ProcessResult( result.Output, @@ -93,6 +93,7 @@ private static IEnumerable SplitLinesKeepingNewlines(string input) private static string FilterMessages( string input, + bool removeEmptyLines, bool removeWaitingMessages, bool removeUpgradeMessages) { @@ -101,7 +102,7 @@ private static string FilterMessages( IEnumerable lines = SplitLinesKeepingNewlines(input); IEnumerable filteredLines = lines.Where(line => { - if (string.IsNullOrWhiteSpace(line) || + if ((removeEmptyLines && string.IsNullOrWhiteSpace(line)) || (removeUpgradeMessages && line.StartsWith("A new version of VFS for Git is available.")) || (removeWaitingMessages && line.StartsWith("Waiting for "))) { From 3c364c349ddb4f8e0fa50ed0272f950572e41c81 Mon Sep 17 00:00:00 2001 From: Matthew John Cheetham Date: Mon, 28 Jul 2025 11:04:47 -0700 Subject: [PATCH 8/9] Functional Tests: account for 'partially-hydrated checkout' messages Let the functional tests account for the "You are in a partially-hydrated checkout with %d% of tracked files present" message that was added in Microsoft Git v2.45.2.vfs.0.2. Do this by filtering out those messages in the same way we do for the old 'A new version of VFS for Git is available.' upgrader messages, and the 'Waiting for %s' lock waiting message. Note that the 'hydration' state message is printed to standard output and not standard error as the other messages, since this is the output from the `status` command. We filter both stdout and stderr. Signed-off-by: Matthew John Cheetham Signed-off-by: Johannes Schindelin --- GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs b/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs index 19249ba79..784b10a0e 100644 --- a/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs +++ b/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs @@ -63,13 +63,15 @@ public static ProcessResult InvokeGitAgainstGVFSRepo( string command, Dictionary environmentVariables = null, bool removeWaitingMessages = true, - bool removeUpgradeMessages = true) + bool removeUpgradeMessages = true, + bool removePartialHydrationMessages = true) { ProcessResult result = GitProcess.InvokeProcess(gvfsRepoRoot, command, environmentVariables); - string errors = FilterMessages(result.Errors, true, removeWaitingMessages, removeUpgradeMessages); + string output = FilterMessages(result.Output, false, false, false, removePartialHydrationMessages); + string errors = FilterMessages(result.Errors, true, removeWaitingMessages, removeUpgradeMessages, removePartialHydrationMessages); return new ProcessResult( - result.Output, + output, errors, result.ExitCode); } @@ -95,16 +97,18 @@ private static string FilterMessages( string input, bool removeEmptyLines, bool removeWaitingMessages, - bool removeUpgradeMessages) + bool removeUpgradeMessages, + bool removePartialHydrationMessages) { - if (!string.IsNullOrEmpty(input) && (removeWaitingMessages || removeUpgradeMessages)) + if (!string.IsNullOrEmpty(input) && (removeWaitingMessages || removeUpgradeMessages || removePartialHydrationMessages)) { IEnumerable lines = SplitLinesKeepingNewlines(input); IEnumerable filteredLines = lines.Where(line => { if ((removeEmptyLines && string.IsNullOrWhiteSpace(line)) || (removeUpgradeMessages && line.StartsWith("A new version of VFS for Git is available.")) || - (removeWaitingMessages && line.StartsWith("Waiting for "))) + (removeWaitingMessages && line.StartsWith("Waiting for ")) || + (removePartialHydrationMessages && line.StartsWith("You are in a partially-hydrated checkout with "))) { return false; } From c69ba8e8036a62c3d4dd8f2ee68cda4529187c0f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 13 Aug 2025 14:12:30 +0200 Subject: [PATCH 9/9] Functional Tests: heed Postel's law regarding `core.FSMonitor` When running the functional tests locally, it is quite possible that the `core.fsmonitor` setting is enabled globally. Let's avoid chalking that up as a test failure. Signed-off-by: Johannes Schindelin --- GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs b/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs index 784b10a0e..76a77eb64 100644 --- a/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs +++ b/GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs @@ -64,11 +64,12 @@ public static ProcessResult InvokeGitAgainstGVFSRepo( Dictionary environmentVariables = null, bool removeWaitingMessages = true, bool removeUpgradeMessages = true, - bool removePartialHydrationMessages = true) + bool removePartialHydrationMessages = true, + bool removeFSMonitorMessages = true) { ProcessResult result = GitProcess.InvokeProcess(gvfsRepoRoot, command, environmentVariables); - string output = FilterMessages(result.Output, false, false, false, removePartialHydrationMessages); - string errors = FilterMessages(result.Errors, true, removeWaitingMessages, removeUpgradeMessages, removePartialHydrationMessages); + string output = FilterMessages(result.Output, false, false, false, removePartialHydrationMessages, removeFSMonitorMessages); + string errors = FilterMessages(result.Errors, true, removeWaitingMessages, removeUpgradeMessages, removePartialHydrationMessages, removeFSMonitorMessages); return new ProcessResult( output, @@ -98,9 +99,10 @@ private static string FilterMessages( bool removeEmptyLines, bool removeWaitingMessages, bool removeUpgradeMessages, - bool removePartialHydrationMessages) + bool removePartialHydrationMessages, + bool removeFSMonitorMessages) { - if (!string.IsNullOrEmpty(input) && (removeWaitingMessages || removeUpgradeMessages || removePartialHydrationMessages)) + if (!string.IsNullOrEmpty(input) && (removeWaitingMessages || removeUpgradeMessages || removePartialHydrationMessages || removeFSMonitorMessages)) { IEnumerable lines = SplitLinesKeepingNewlines(input); IEnumerable filteredLines = lines.Where(line => @@ -108,7 +110,8 @@ private static string FilterMessages( if ((removeEmptyLines && string.IsNullOrWhiteSpace(line)) || (removeUpgradeMessages && line.StartsWith("A new version of VFS for Git is available.")) || (removeWaitingMessages && line.StartsWith("Waiting for ")) || - (removePartialHydrationMessages && line.StartsWith("You are in a partially-hydrated checkout with "))) + (removePartialHydrationMessages && line.StartsWith("You are in a partially-hydrated checkout with ")) || + (removeFSMonitorMessages && line.TrimEnd().EndsWith(" is incompatible with fsmonitor"))) { return false; }