Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@Stijn-Rutten
Copy link
Contributor

This PR is related to issue #1789

@ethomson
Copy link
Member

This looks good to me, thanks @Stijn-Rutten. @bording any thoughts?

Copy link
Member

@bording bording left a comment

Choose a reason for hiding this comment

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

Overall looks good, but I have a few tweaks I'd like to see, and a couple of questions.

/// </summary>
public virtual List<Line> DeletedLines { get; internal set; }


Copy link
Member

Choose a reason for hiding this comment

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

Remove the extra line

Copy link
Member

Choose a reason for hiding this comment

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

Still need to clean up this extra line break.

LibGit2Sharp/Line.cs Outdated Show resolved Hide resolved
LibGit2Sharp/Line.cs Outdated Show resolved Hide resolved
PatchEntryChanges currentChange = this[filePath];
string prefix = string.Empty;

string decodedContent = LaxUtf8Marshaler.FromNative(line.content, (int)line.contentLen);
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this when this appears to be the same as the patchPart declaration on line 59?

Copy link
Member

Choose a reason for hiding this comment

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

This should able to be removed. You can just use the existing patchPart instead.


string decodedContent = LaxUtf8Marshaler.FromNative(line.content, (int)line.contentLen);

currentChange.AddedLines = new List<Line>();
Copy link
Member

Choose a reason for hiding this comment

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

Why are these needed? Seems like this should be already handled in the ContentChanges constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added this in case the contructor that calls LineCallback on ContentChanges is not the constructor that is utilized by Patch. This way these values are always set. After fixing the declaration of the lists and adding tests. This does work. I would like to get your input on whether or not you think this is a viable option.

LibGit2Sharp/ContentChanges.cs Outdated Show resolved Hide resolved
LibGit2Sharp/ContentChanges.cs Outdated Show resolved Hide resolved
LibGit2Sharp/Line.cs Outdated Show resolved Hide resolved
LibGit2Sharp/Line.cs Outdated Show resolved Hide resolved
Stijn-Rutten and others added 4 commits May 27, 2020 20:35
…because linecallback isn't called in this case
Co-authored-by: Brandon Ording <bording@gmail.com>
Co-authored-by: Brandon Ording <bording@gmail.com>
Copy link
Member

@bording bording left a comment

Choose a reason for hiding this comment

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

There are a lot of unrelated formatting changes in the test files. It's a good practice to avoid those kind of unrelated changes in a PR, but in this case let's go ahead and keep them. I've made some specific comments about a couple changes I'd like to see undone, though.

LibGit2Sharp.Tests/DiffBlobToBlobFixture.cs Outdated Show resolved Hide resolved
LibGit2Sharp.Tests/DiffBlobToBlobFixture.cs Show resolved Hide resolved
LibGit2Sharp.Tests/DiffTreeToTargetFixture.cs Outdated Show resolved Hide resolved
LibGit2Sharp.Tests/DiffTreeToTreeFixture.cs Outdated Show resolved Hide resolved
/// </summary>
public virtual List<Line> DeletedLines { get; internal set; }


Copy link
Member

Choose a reason for hiding this comment

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

Still need to clean up this extra line break.

LibGit2Sharp/ContentChanges.cs Outdated Show resolved Hide resolved
LibGit2Sharp/ContentChanges.cs Outdated Show resolved Hide resolved
LibGit2Sharp/ContentChanges.cs Outdated Show resolved Hide resolved
PatchEntryChanges currentChange = this[filePath];
string prefix = string.Empty;

string decodedContent = LaxUtf8Marshaler.FromNative(line.content, (int)line.contentLen);
Copy link
Member

Choose a reason for hiding this comment

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

This should able to be removed. You can just use the existing patchPart instead.

LibGit2Sharp/Patch.cs Outdated Show resolved Hide resolved
@Stijn-Rutten
Copy link
Contributor Author

Checks seem to be stuck, can someone force a restart?

@Stijn-Rutten Stijn-Rutten requested a review from bording July 30, 2020 14:07
@rouke-broersma
Copy link

@bording @ethomson @Stijn-Rutten How's this PR coming along? Looks like a lot was fixed since the last review

@Stijn-Rutten
Copy link
Contributor Author

@Mobrockers I processed @bording 's feedback and am waiting for a new review.

@Stijn-Rutten
Copy link
Contributor Author

@ethomson @bording @Mobrockers Could you take a look at this. We have been waiting for a while and could really use this feature.

@bording bording merged commit dbb17e7 into libgit2:master Nov 7, 2020
@rouke-broersma
Copy link

@bording 🎉🎉🎉🎉🎉🎉🎉🎉

@bording
Copy link
Member

bording commented Nov 23, 2020

FYI these changes are part of 0.27.0-preview-0096, which was just published.

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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.