Skip to content

Conversation

pmiossec
Copy link
Member

@pmiossec pmiossec commented Oct 16, 2023

Note: done automatically by VS (with 2 or 3 small adaptations -- code indentation and tuples not 100% well handled--)

Test methodology

  • Manual

Test environment(s)

  • Git Extensions 33.33.33
  • Build 03e983f
  • Git 2.42.0.windows.2
  • Microsoft Windows NT 10.0.22621.0
  • .NET 6.0.21
  • DPI 96dpi (no scaling)
  • Portable: False
  • Microsoft.WindowsDesktop.App Versions
    Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned pmiossec Oct 16, 2023
Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
Plan to speed review, just voting for the change right now.

Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RussKie has some bigger PRs that may be affected and should comment before merge

var firstId = Module.RevParse(gitStash.Name + "^");
var firstRev = firstId is null ? null : new GitRevision(firstId);
ObjectId firstId = Module.RevParse(gitStash.Name + "^");
GitRevision firstRev = firstId is null ? null : new GitRevision(firstId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expected IDE0090 for the assignment and null annotation is obviously not handled

Suggested change
GitRevision firstRev = firstId is null ? null : new GitRevision(firstId);
GitRevision? firstRev = firstId is null ? null : new(firstId);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NRTA not enabled in the UI project, which is tech debt.

var patchesList = new SortablePatchesList();
string text = System.IO.File.ReadAllText(PatchFileNameEdit.Text, GitModule.LosslessEncoding);
List<Patch> patches = PatchProcessor.CreatePatchesFromString(text, new Lazy<Encoding>(() => Module.FilesEncoding)).ToList();
SortablePatchesList patchesList = new SortablePatchesList();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SortablePatchesList patchesList = new SortablePatchesList();
SortablePatchesList patchesList = new();

@@ -67,7 +67,9 @@

<!-- Settings -->
<None Update="Properties\Settings.settings" Generator="SettingsSingleFileGenerator" LastGenOutput="Settings.Designer.cs" />
<Compile Update="Properties\Settings.Designer.cs" AutoGen="True" DependentUpon="Settings.settings" />
<Compile Update="Properties\Settings.Designer.cs" AutoGen="True" DependentUpon="Settings.settings">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

@@ -49,7 +49,7 @@ public static class GitUIExtensions
return;
}

var firstId = item.FirstRevision?.ObjectId ?? item.SecondRevision.FirstParentId;
ObjectId firstId = item.FirstRevision?.ObjectId ?? item.SecondRevision.FirstParentId;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ObjectId firstId = item.FirstRevision?.ObjectId ?? item.SecondRevision.FirstParentId;
ObjectId? firstId = item.FirstRevision?.ObjectId ?? item.SecondRevision.FirstParentId;


if (file.IsSubmodule && task is not null)
{
// Patch already evaluated
var status = await task;
GitSubmoduleStatus status = await task;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GitSubmoduleStatus status = await task;
GitSubmoduleStatus? status = await task;

if (currentCredentials.UserName == userName && currentCredentials.Password == password)
{
return;
}
}

var newCredentials = string.IsNullOrWhiteSpace(userName)
NetworkCredential newCredentials = string.IsNullOrWhiteSpace(userName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NetworkCredential newCredentials = string.IsNullOrWhiteSpace(userName)
NetworkCredential? newCredentials = string.IsNullOrWhiteSpace(userName)

@RussKie
Copy link
Member

RussKie commented Oct 17, 2023

The nullable annotations should be done anyway, so taking this to avoid any conflicts.

Thank you

@RussKie RussKie merged commit ba7b679 into gitextensions:master Oct 17, 2023
@ghost ghost added this to the vNext milestone Oct 17, 2023
@pmiossec pmiossec deleted the rid_of_var branch October 17, 2023 10:05
@pmiossec
Copy link
Member Author

FYI:

Call me naive but I just noticed that VS automatic conversion of all the Solution has done only a very small subset (around 1/4) 😭
I was a little surprised because I found the number of file not as big as expected but, without a real knowledge of the number of cs files, I have not thought about doing a verification......

82ujlv

😭 😭

@RussKie
Copy link
Member

RussKie commented Oct 17, 2023 via email

@RussKie
Copy link
Member

RussKie commented Oct 17, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants