Skip to content

chore: replace LibGit2Sharp with native git CLI commands to simplify dependencies#367

Merged
DecSmith42 merged 1 commit into
mainfrom
chore/no-libgit2sharp
Jul 20, 2026
Merged

chore: replace LibGit2Sharp with native git CLI commands to simplify dependencies#367
DecSmith42 merged 1 commit into
mainfrom
chore/no-libgit2sharp

Conversation

@DecSmith42

Copy link
Copy Markdown
Collaborator

This pull request refactors the breaking change detection logic to remove the dependency on LibGit2Sharp and instead use the git command-line tool via a process runner. The changes streamline repository interactions, improve compatibility, and simplify the codebase by removing direct library usage. Additionally, the pull request updates method signatures to be asynchronous and adjusts related logic accordingly.

Repository interaction refactor:

  • All usages of LibGit2Sharp for repository operations (e.g., commit lookup, diff, tag listing) have been replaced with calls to the git CLI via ProcessRunner, eliminating the direct dependency on LibGit2Sharp. (_atom/RepoUtils/IApiSurfaceHelper.cs, _atom/RepoUtils/ICheckPrForBreakingChanges.cs, _atom/_atom.csproj, _atom/_usings.cs) [1] [2] [3] [4] [5] [6] [7]

  • The IdentifyBreakingChanges and FindLatestReleaseInfo methods have been updated to be asynchronous (async Task) and now accept a CancellationToken. (_atom/RepoUtils/IApiSurfaceHelper.cs, _atom/RepoUtils/ICheckPrForBreakingChanges.cs) [1] [2] [3] [4]

Diff parsing and breaking change detection:

  • A new ParseChanges helper method was added to parse the output of git diff and extract added and deleted lines, replacing the previous use of LibGit2Sharp.Patch. (_atom/RepoUtils/IApiSurfaceHelper.cs)

  • The Change record was updated to use List<string> for AddedLines and DeletedLines instead of List<Line>, simplifying the data model. (_atom/RepoUtils/IApiSurfaceHelper.cs)

Minor improvements:

  • Logging and suspicious change detection logic were updated to work with the new data structures and asynchronous flow. (_atom/RepoUtils/IApiSurfaceHelper.cs)

  • The LibGit2Sharp package reference and related usings/aliases were removed from the project. (_atom/_atom.csproj, _atom/_usings.cs) [1] [2]

Copilot AI review requested due to automatic review settings July 20, 2026 04:41
@DecSmith42
DecSmith42 enabled auto-merge July 20, 2026 04:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Atom’s breaking-change detection in _atom/RepoUtils to remove the LibGit2Sharp dependency and instead use git CLI calls via IProcessRunner, while also making the detection flow asynchronous and cancellable.

Changes:

  • Replace LibGit2Sharp repository operations (commit/tag/diff) with git CLI invocations through ProcessRunner.
  • Update breaking-change detection APIs to async Task and thread CancellationToken through the call chain.
  • Add a lightweight git diff output parser (ParseChanges) and simplify the Change model to store raw added/deleted lines as strings.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
_atom/RepoUtils/ICheckPrForBreakingChanges.cs Switches release/tag/commit discovery to git CLI and updates call sites to async/cancellable flow.
_atom/RepoUtils/IApiSurfaceHelper.cs Replaces LibGit2Sharp diffing with git diff + custom parsing; updates breaking-change logic to async and string-based line tracking.
_atom/_usings.cs Removes LibGit2Sharp global using and related aliases.
_atom/_atom.csproj Removes the LibGit2Sharp package reference to simplify dependencies.

Comment thread _atom/RepoUtils/ICheckPrForBreakingChanges.cs
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.

2 participants