This website allows you to review GitHub pull requests and commits using a semantic/structural diff. Just enter the URL of a pull request and you get a diff that hides changes to the code style as well as other irrelevant modifications. You can also view existing review comments or add new comments to the code. Comments are synchronized live with GitHub, so you can switch between the two interfaces.
Check out the other questions or our documentation for more details.
Yes. To review pull requests in a private repository the following two requirements need to be fulfilled:
SemanticDiff uses OAuth to enforce GitHub permission checks and to allow posting review comments through our interface.
No. Logging in via GitHub does not grant us access to your private repositories or gists. SemanticDiff can only access repositories that are public or have our GitHub App installed.
The only information SemanticDiff can access after your login is your profile information and your email address.
The following programming languages and data exchange formats are currently supported:
Your language is not included? Feel free to open a feature request in our issue tracker.
Our diff is able to detect moved or copied blocks of code, as well as renaming of variables, functions, and classes. Additional types of refactorings will be added over time. If you have suggestions on what should be recognized, feel free to open a feature request in our issue tracker.
Please note that our technology is currently in beta state and some features might still be work in progress.
Yes, we also offer a free extension for Visual Studio Code called SemanticDiff.
The extension is great for comparing local files and can be used with all diffs displayed by VS Code (as long as the programming language is supported). The diff features and visualization are identical in both tools, but our VS Code extension does not offer any integration with GitHub.
Common diffs treat source code as text files, and generate a visualization based on a simple line-by-line comparison. This is far from perfect: There are many types of code changes, such as inserting line breaks between function arguments, that don't have any effect on the software but are displayed as changes. This adds a lot of visual noise and makes it difficult for developers to spot the relevant changes.
In contrary, a semantic diff (or also called structural diff) understands the impact of a change. It can, for example, distinguish between relevant and irrelevant changes, and recognizes when changes correspond to a typical refactoring pattern, like moving code or renaming a function. Instead of showing only changed lines, a semantic diff will show an abstract description for some changes, e.g., that a function has been moved.
Our diff works similar to a compiler or interpreter. Given two source codes to compare, they are first converted to Abstract Syntax Trees (ASTs). This step adds additional information that enables us to filter out various style changes, like adding optional semicolons or commas in an array initialization.
In a second step, we match both trees to find out what has changed. Additional rules are applied to filter out more complex invariances. Afterwards the detected changes are translated back into a text diff representation.
The backend is built using Python and FastAPI, with some basic template rendering performed by jinja2. Most of the actual diff processing is done by an executable written in C++ that is invoked by the backend.
The frontend part is mostly based on our SemanticDiff Visual Studio Code extension and implements a custom diff viewer that only creates DOM elements for the currently visible text. It makes use of some third-party components that are listed here.
Please let us know in our issue tracker :-)