diff --git a/.gitattributes b/.gitattributes index 7ec9aec55..f6cbefe43 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,12 +2,16 @@ *.xml diff -text *.patch diff -text *.blame diff -text +*.xlf text *.cs text diff=csharp *.sln text eol=crlf +*.targets text eol=crlf *.bat text eol=crlf *.cmd text eol=crlf +*.yml text eol=lf *.sh text eol=lf *.py text eol=lf +.gitattributes text eol=lf # Used in unit tests - try text diff *.bin binary diff=text diff --git a/GitExtensions.sln b/GitExtensions.sln index cbe8f57b8..e7e1146de 100644 --- a/GitExtensions.sln +++ b/GitExtensions.sln @@ -156,6 +156,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{472B scripts\Download-PluginManager.ps1 = scripts\Download-PluginManager.ps1 scripts\Mark-RepoClean.ps1 = scripts\Mark-RepoClean.ps1 scripts\stylecop.json = scripts\stylecop.json + update-loc.cmd = update-loc.cmd scripts\vs-threading.MainThreadAssertingMethods.txt = scripts\vs-threading.MainThreadAssertingMethods.txt scripts\vs-threading.MainThreadSwitchingMethods.txt = scripts\vs-threading.MainThreadSwitchingMethods.txt scripts\vs-threading.TypesRequiringMainThread.txt = scripts\vs-threading.TypesRequiringMainThread.txt diff --git a/GitExtensions/Project.Loc.targets b/GitExtensions/Project.Loc.targets index a7da50b39..fe65e7663 100644 --- a/GitExtensions/Project.Loc.targets +++ b/GitExtensions/Project.Loc.targets @@ -68,7 +68,7 @@ ContinueOnError="false" /> - diff --git a/GitExtensions/Project.Publish.targets b/GitExtensions/Project.Publish.targets index 6a4e4e877..15ec47e0a 100644 --- a/GitExtensions/Project.Publish.targets +++ b/GitExtensions/Project.Publish.targets @@ -229,9 +229,9 @@ <_PublishPortableVersionSuffix>-$(CurrentBuildVersion.ToString()) + + <_PublishPortableCommitHashSuffix Condition="'$(GitCommit)' != ''">-$(GitCommit) - <_PublishPortableCommitHashSuffix Condition="'$(env:APPVEYOR_REPO_COMMIT)' != ''">-$(env:APPVEYOR_REPO_COMMIT) - <_PublishPortableCommitHashSuffix Condition="'$(env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT)' != ''">-$(env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT) <_PublishPortableFileName>GitExtensions-Portable$(_PublishPortableVersionSuffix)$(_PublishPortableCommitHashSuffix).zip <_PublishPortablePath>$([MSBuild]::NormalizePath('$(ArtifactsPublishDir)', '$(_PublishPortableFileName)')) diff --git a/appveyor.yml b/appveyor.yml index 2dff32e77..5c64daded 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,7 +48,7 @@ install: - cmd: git submodule update --init --recursive - cmd: |- cd scripts - C:\\Python35\\python set_version_to.py -v %APPVEYOR_BUILD_VERSION% -t %APPVEYOR_BUILD_VERSION% + C:\\Python311\\python set_version_to.py -v %APPVEYOR_BUILD_VERSION% -t %APPVEYOR_BUILD_VERSION% cd .. git --version @@ -56,35 +56,28 @@ install: # to run your custom scripts instead of automatic MSBuild build_script: - ps: | - $isBuildingPR = $false; - # if building a temporary merge with master, soft reset to the PR commit so the build contains the PR's hash instead of the merge-commit's hash + $buildArgs = '/p:ContinuousIntegrationBuild=true' + # if building a PR override the hash with the PR commit's so the build contains the PR's hash instead of the merge-commit's hash if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and ($env:APPVEYOR_REPO_COMMIT -ne $env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT)) { - git reset --soft "$env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT" -- - $isBuildingPR = $true; + $gitCommit = $(git rev-parse --short $env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT) + $buildArgs += " /p:GitCommit=$gitCommit /p:GitSha=$($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT)" } +- ps: | + # add to index, to adjust crlf configured in .gitattributes + git -c core.autocrlf=false add -A + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - ps: | # build VC++ dotnet build .\scripts\native.proj -c Release --verbosity q --nologo /bl:.\artifacts\log\native.binlog if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - ps: | # build .NET - dotnet build -c Release --verbosity q --nologo /bl:.\artifacts\log\build.binlog /p:ContinuousIntegrationBuild=true + $cmd = "dotnet build -c Release --verbosity q --nologo /bl:.\artifacts\log\build.binlog $buildArgs" + Invoke-Expression $cmd if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -- ps: | - # if we have reset above, we need to restore the merge commit, otherwise the loc verification step will fail - # there is no need to have the same commit hash, but there must be no pending changes before the loc verification - # refer to https://github.com/gitextensions/gitextensions/issues/7979 - if ($isBuildingPR) { - git config user.email "gitextensions@github.com" - git config user.name "Git Extensions" - git -c core.autocrlf=false commit -a -m "restore merge commit" | Out-Null - # ignore warning about line-endings conversion - $global:LASTEXITCODE = 0 - } - ps: | # Verify that new strings (if any) have been processed and ready for localisation - # it would be nice to run '.\cibuild.cmd -loc -logFileName localise.binlog /p:NoBuild=true' but it doesn't work without `-build` switch :\ Push-Location .\GitExtensions dotnet msbuild /p:Configuration=Release /t:_UpdateEnglishTranslations /p:RunTranslationApp=true /p:ContinuousIntegrationBuild=true /v:m /bl:..\artifacts\log\localise.binlog Pop-Location @@ -100,7 +93,8 @@ test_script: after_test: - ps: | Write-Host "Preparing build artifacts..." - dotnet publish -c Release --no-build /bl:.\artifacts\log\publish.binlog /p:ContinuousIntegrationBuild=true + $cmd = "dotnet publish -c Release --no-build /bl:.\artifacts\log\publish.binlog $buildArgs" + Invoke-Expression $cmd if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - ps: | if ([bool]$env:APPVEYOR_PULL_REQUEST_TITLE -and [bool]$env:ARTIFACT_PUBLISH_PULL_REQUEST_MSI) {