Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff two binlogs #163

Open
KirillOsenkov opened this issue Mar 29, 2018 · 14 comments
Open

Diff two binlogs #163

KirillOsenkov opened this issue Mar 29, 2018 · 14 comments
Assignees
Labels

Comments

@KirillOsenkov
Copy link
Owner

No description provided.

@BihtSift
Copy link
Contributor

BihtSift commented Apr 4, 2018

I actually am in need of this functionality which is why I forked the project! What direction were you thinking of going to support this?

For my use case, it would be cool if both log trees were shown with filters. Filters could maybe behave similar to diffing two folders in Araxis (All, Diff). When diff is selected, only the msbuild targets that differed are shown in each tree, and when the node is selected/double clicked a standard diff window is shown with green for additions and red for missing on each side (not sure if a new window is best, or if using the standard tabbed details view is good - I really like that one, but screen real-estate could be a problem).

I'm happy to help in any way I can :)

@KirillOsenkov
Copy link
Owner Author

Yeah, it's tricky to get right, I didn't think about it yet.

For now you have two quick workarounds: use the Save as XML feature to get two .xml files for logs, and diff those using your favorite XML diffing tool (some of them are really good).

Or you can right-click on any node and say Copy subtree, which will copy the text contents of the subtree to clipboard. You can diff those as well.

As for my plan, I was thinking of a new menu items - "Diff 2 .binlogs", where you select two .binlog files and it opens a single merged tree, where nodes are as follows:

  • node that exactly matches in both (including children) is semi-transparent with Opacity 30% (so it's easy to ignore things that haven't changed)
  • node that matches but has differences underneath is normal
  • node that is only on the left is red
  • node that is only on the right is green

I would also add heuristics to ignore non-important changes. For instance, for all nodes where the order of children doesn't matter, children will be sorted before diffing.

@nvmkpk
Copy link

nvmkpk commented Apr 4, 2020

That will be a good start. I hope you are working on it already but I can help with it if you need any.

@KirillOsenkov
Copy link
Owner Author

I'm waiting for Visual Studio 16.6 to ship. MSBuild there has a really important new feature that allows to parent a project under the MSBuild task that started it. This will greatly improve the diffing experience. After that is available I'll start on the feature.

@nvmkpk
Copy link

nvmkpk commented Apr 14, 2020

That is good to know. I was wondering why it is not already doing that. Do you have a link I can check the status if that change?

@KirillOsenkov
Copy link
Owner Author

It is already in MSBuild master and will be available in Visual Studio 16.6. I believe it is already available if you install a Preview of VisualStudio 16.6.

@KirillOsenkov
Copy link
Owner Author

Here's the PR where this was fixed: dotnet/msbuild#5013

@KirillOsenkov
Copy link
Owner Author

One can use this to diff two lists: https://github.com/praeclarum/ListDiff

@KirillOsenkov
Copy link
Owner Author

Unfortunately there's still this bug that would make diffs a bit complicated:
dotnet/msbuild#5473

@forrestcoward
Copy link

I would absolutely love this feature for comparing changes between two builds. In particular, the ability to compare specific targets with path normalization (if I built the project in one repo and then built it in another repo on a different commit).

@KirillOsenkov KirillOsenkov pinned this issue Mar 26, 2021
@KirillOsenkov KirillOsenkov self-assigned this May 1, 2021
@mcopeland-clgx
Copy link

@KirillOsenkov Did you ever try this to get a diff and did it work? https://github.com/praeclarum/ListDiff

@KirillOsenkov
Copy link
Owner Author

Yes I’m using ListDiff for comparing flat sequences and it’s great. However the complication is elsewhere when diffing binlogs - we need to unify to remove a lot of noise to highlight the signal.

@KirillOsenkov
Copy link
Owner Author

I've noticed there's some in-progress prototype work in the branches of this fork:
https://github.com/pchaurasia14/MSBuildStructuredLog/branches

@KirillOsenkov
Copy link
Owner Author

Also here's a helper I have for diffing sorted sequences in O(n) time and no memory:
https://gist.github.com/KirillOsenkov/72dc4b0b0a864c461b8c54dee61846d5

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

No branches or pull requests

5 participants