Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pmezard/go-difflib
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: codinganovel/go-difflib
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 7 commits
  • 8 files changed
  • 1 contributor

Commits on Aug 10, 2025

  1. Revive go-difflib: modernize for Go modules and fix compilation errors

    This commit brings the unmaintained go-difflib back to working
    condition:
    
      - Add go.mod with Go 1.16 support and updated module path
      - Fix test compilation errors (rename example functions)
      - Update installation instructions for modern Go
    
      The library now works with `go get
    github.com/codinganovel/go-difflib/difflib`
      and compiles/tests successfully with current Go versions.
    codinganovel committed Aug 10, 2025
    Configuration menu
    Copy the full SHA
    b4a6f03 View commit details
    Browse the repository at this point in the history
  2. Fix SetSeq optimization bug and update security analysis

    - Remove broken address comparison in SetSeq1/SetSeq2 functions
      - Functions now properly clear cache instead of failing optimization
      - Update repository references in README from pmezard to codinganovel
    codinganovel committed Aug 10, 2025
    Configuration menu
    Copy the full SHA
    b934651 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2025

  1. difflib: add GetCloseMatches, NDiff/Restore, Differ (+intraline)

    - Add IsLineJunk/IsCharacterJunk
    - Tests: round‑trip, intraline; examples added
    - README: new features, examples, API notes
    - TO-DO: progress and next steps
    - go fmt/vet clean
    codinganovel committed Aug 23, 2025
    Configuration menu
    Copy the full SHA
    319f11b View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2025

  1. Add NDiff

    - NDiff options and API:
        - Added NDiffOptions with LineJunk, CharJunk, and Intraline.
        - Added NDiffWith(a, b []string, opts NDiffOptions)
    []string.
        - Behavior:
        - `Intraline: true` → adds “? ” guide lines (uses `Differ`
    under the hood).
        - `Intraline: false` → same output style as `NDiff`, but
    honors `LineJunk` for matching.
        - `CharJunk`: defaults to `IsCharacterJunk` when intraline
    is on and `CharJunk` is nil.
    
    - Differ improvements:
        - Differ.Compare now honors LineJunk by using
    NewMatcherWithJunk.
        - Intraline builder now respects CharJunk via a new helper:
        - Replaced `buildIntralineTags` with
    `buildIntralineTagsWith(aline, bline string, charJunk func(rune)
    bool)`.
        - Uses `NewMatcherWithJunk` on character sequences with a
    rune-aware junk adapter.
    
    - Imports:
        - Added unicode/utf8 for safe rune decoding in intraline
    junk adapter.
    
    - Existing NDiff(a, b []string) remains unchanged for backward
    compatibility.
    - Differ still has simple replace pairing (not the full
    _fancy_replace yet), but now respects junk filters as requested.
    - If you want, I can proceed next to add more table-driven
    tests around junk filters and multi-line replacements, or start
    _fancy_replace work.
    codinganovel committed Aug 26, 2025
    Configuration menu
    Copy the full SHA
    bb360fd View commit details
    Browse the repository at this point in the history
  2. add byte adapters

    - Byte adapters:
        - Unified: WriteUnifiedDiffBytes, GetUnifiedDiffBytes, with
    UnifiedDiffBytes struct.
        - Context: WriteContextDiffBytes, GetContextDiffBytes, with
    ContextDiffBytes (alias of bytes struct).
        - Behavior: split on '\n' via SplitLinesBytes, convert lines
    to strings without decoding, delegate to existing string-based
    writers, return bytes.
    - Tests/Examples:
        - ExampleGetUnifiedDiffBytes mirrors the unified example
    using bytes.
        - ASCII parity:
    TestUnifiedDiffBytes_EqualsStringUnified_ASCII,
    TestContextDiffBytes_EqualsStringContext_ASCII.
        - Binary safety: TestUnifiedDiffBytes_BinarySafety,
    TestContextDiffBytes_BinarySafety (handles NUL and 0xFF, no
    panics).
    
    Files Changed
    
    - difflib/difflib.go: added UnifiedDiffBytes,
    WriteUnifiedDiffBytes, GetUnifiedDiffBytes, ContextDiffBytes,
    WriteContextDiffBytes, GetContextDiffBytes.
    - difflib/difflib_test.go: added example and tests.
    - TO-DO.md: marked unified/context byte adapters as done.
    codinganovel committed Aug 26, 2025
    Configuration menu
    Copy the full SHA
    24836f7 View commit details
    Browse the repository at this point in the history
  3. Docs + Tests Polished

    - README updates:
        - Added NDiffWith, NDiffBytes, Unified/Context byte adapters
    with examples.
        - Clarified Differ now honors LineJunk/CharJunk and provides
    intraline hints.
        - Kept NDiff as a simple, stable API; pointed to NDiffWith
    for intraline.
        - Added notes on byte safety and remaining HtmlDiff work.
        - Added notes on byte safety and remaining HtmlDiff work.
    -
    New tests:
        - NDiffBytes binary safety: ensures no intraline hints and
    non-empty output with NUL bytes.
        - Unified/Context bytes: parity with string versions and
    binary-safety (NUL and 0xFF) already included.
    codinganovel committed Aug 26, 2025
    Configuration menu
    Copy the full SHA
    65dcd28 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2025

  1. late night work

    probably doesn't work, its 12:30 at night, ill double check it Tomorrow.
    codinganovel committed Aug 30, 2025
    Configuration menu
    Copy the full SHA
    c792bd6 View commit details
    Browse the repository at this point in the history
Loading