Open MikeAlhayek opened 1 month ago
Here are the steps each PR author need to do to resolve the conflicts of their PR
# checkout PR
git checkout <BRANCH>
# merge the changes before the formatting was applied
git merge before-formatting
<FIX MERGE CONFLICTS IF ANY>
# commit changes (including resolved merge conflicts if any)
git commit -m "Merge tag 'before-formatting"
# patch formatting settings locally
curl https://gist.githubusercontent.com/sebastienros/b2e88eb460396e07c8bdeeb725645a22/raw/bf3b8854b9bfc13e68da94044dea77eee9623cd5/patchformatfiles.patch -o c:\temp\patchformatfiles.patch
git apply c:\temp\patchformatfiles.patch
# apply formatting
dotnet restore
dotnet format --severity info --diagnostics IDE0160 IDE0161
# commit formatting changes
git add -A
git commit -m "Format code"
# merge with official formatting branch
git merge formatting --no-edit --strategy-option ours
# ensure local code builds correctly
dotnet build
# push changes
git push
@MikeAlhayek I got the following error
curl : Could not find a part of the path 'C:\temp\patchformatfiles.patch'.
the curl command should download the remote file locally for you on C:\temp\patchformatfiles.patch
. Try changing it to C:/temp/patchformatfiles.patch
or any other local path to see if that works
Seem you forgot that temp inside windows folder
error: patch failed: .editorconfig:1 error: .editorconfig: patch does not apply error: patch failed: .gitattributes:1 error: .gitattributes: patch does not apply error: patch failed: Directory.Packages.props:56 error: Directory.Packages.props: patch does not apply error: patch failed: src/OrchardCore.Build/OrchardCore.Commons.props:13 error: src/OrchardCore.Build/OrchardCore.Commons.props: patch does not apply
did you try to place it on a different location that C:/temp
?
yes, the issue right now while executing git apply
I tried to use git apply --check
seems there's an error somewhere
@sebastienros, do you have any idea how to resolve the above error? I need to resolve all the conflicts for my PRs?
@MikeAlhayek could you please reply ASAP I'm unable to update my PRs
Can you share the error you are experiencing? Others have reported no issues with this script
sorry not sure. maybe @sebastienros have some feedback on your error.
I'm waiting ..
git apply -v C:/temp/patchformatfiles.patch
to list the issues with this command.
Also please check that the content of this file is correct and matches the source on gist.
Checking patch .editorconfig...
error: while searching for:
root = true
[*]
end_of_line = crlf
charset = utf-8
indent_style = space
indent_size = 4
error: patch failed: .editorconfig:1
error: .editorconfig: patch does not apply
Checking patch .gitattributes...
error: while searching for:
* text=auto
**/wwwroot/Scripts/* linguist-vendored
# Keep LF line endings in webroot assets files. Otherwise, building them under Windows would change the line endings to CLRF and cause changes without actually editing the source files.
**/wwwroot/**/*.js text eol=lf
**/wwwroot/**/*.css text eol=lf
error: patch failed: .gitattributes:1
error: .gitattributes: patch does not apply
Checking patch Directory.Packages.props...
error: while searching for:
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="MimeKit" Version="4.7.1" />
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageVersion Include="Moq" Version="4.20.70" />
error: patch failed: Directory.Packages.props:56
error: Directory.Packages.props: patch does not apply
Checking patch src/OrchardCore.Build/OrchardCore.Commons.props...
error: while searching for:
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<!-- Common NuGet properties-->
<OCFrameworkDescription>Orchard Core Framework is an application framework for building modular, multi-tenant applications on ASP.NET Core.</OCFrameworkDescription>
<OCCMSDescription>Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework.</OCCMSDescription>
error: patch failed: src/OrchardCore.Build/OrchardCore.Commons.props:13
error: src/OrchardCore.Build/OrchardCore.Commons.props: patch does not apply
Also please check that the content of this file is correct and matches the source on gist.
It should be the same while the command read from your gist
Hi @MikeAlhayek , Is this operation necessary? Or is it also possible to fix the conflict manually?
@hyzx86 it’s not required. You can fix them manually if the PR does not have much many file. We shared these steps to make it easier for PRs with many changes.
I'm still blocked by this, any idea?
I'm still blocked by this, any idea?
If there isn't many files, update them manually.
Some PRs have many files
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).
This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.
Still, there's no update here
As expected merging merging #16539 broke all existing PRs