Skip to content

BDiff

GitHub App

BDiff

GitHub App

Are you still struggling with reading such differencing results? Now try BDiff!:
home-assitant_a2a580f0fe7a1354a109eb062b5393fbb330f508-urls

🔆 Overview

BDiff is a text-based differencing algorithm that can identify accurate line-level and block-level differences between text files and generate corresponding edit scripts. It can be applied in scenarios such as code review and change analysis.

BDiff is open-sourced at: https://github.com/BDiff/BDiff

🎻 1. Main Features

  • Comprehensive Difference Identification: It can identify line deletions, line additions, line updates, line splits, line merges, block copies (including line updates), and block moves (including line updates).
  • Generate Edit Scripts: Produces edit scripts based on the identified differences.
  • Display Updated Difference Substrings: Shows the specific substrings that have been updated.
  • Edit Action Localization: Helps pinpoint the edit actions within the script.
  • View Before-and-After Mapped Lines/Blocks: Allows users to view the mapped lines or blocks before and after the changes.
  • Set Difference Display Modes: Offers alignment mode and compact mode for displaying differences.
    Language Settings: Supports Chinese and English.
  • Theme Settings: Switch between light and dark themes for comfortable viewing.
  • Difference Option Settings: Customize comparison parameters for precise results.
  • Programming Language Highlighting: Syntax-aware highlighting for major programming languages.

🚩2. Typical Real-world Cases

2.1 Changing the order of parameter and member variable assignments:

Project: kitao/pyxel
Commit: 3861523a200da507f36edf478729f4ec7c269775
File: app.py

1
1

2.2 Moving the try statement block

Project: requests
Commit: cde3b88f3e93a9503810acc0ded890025fcbc119
File: core.py

1
2

2.3 Adding conditional judgment

Project: ansible
Commit: 3807824c6d0dae63b9f36dbafe8e100b0a3beaa6
File: __init__.py

1
3

2.4 Reusing interface elements

Project: magisk
Commit: fc5c9647d829cad1b73338e42164decc4ab08a54
File: drawer.xml

1
4

2.5 Copying function implementation

Project: keras
Commit: aa7f9cdae951bba824883cfa392224a292b284bb
File: core.py

1
5

2.6 Reuse test functions

Project: black
Commit: e911c79809c4fd9b0773dea5b6a0e710b59614cf
File: test_black.py

1
6

2.7 Line splits and block moves

Project: home-assitant
Commit: a2a580f0fe7a1354a109eb062b5393fbb330f508
File: urls.py

1
7

2.8 Block copies and block moves

Project: okhttp
Commit: c8638813ff5f90715417e489b342aae5e410c5b2
File: pom.xml

1
8

2.9 Converting spaces to indentation

Project: scikit-learn
Commit: 612312553118371289330f50b38653d1206246c0
File: gene.py

1
2

Developer

BDiff is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

Report abuse