Skip to content

refactor(git): improve parsing, caching, and test coverage#37

Merged
dlyongemallo merged 1 commit intomainfrom
improve_git_adapter_infra
Mar 12, 2026
Merged

refactor(git): improve parsing, caching, and test coverage#37
dlyongemallo merged 1 commit intomainfrom
improve_git_adapter_infra

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 11, 2026 15:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves Diffview’s Git parsing to better handle merge/combined diffs and tricky filenames, while extracting Git log/stat parsing into a dedicated parser module and adding functional coverage.

Changes:

  • Extend diff patch parsing to recognize diff --cc / diff --combined headers and combined hunk/header formats.
  • Refactor Git file-history stat parsing into vcs/adapters/git/parser.lua, and add functional tests for both parsers.
  • Update Git adapter file listing/parsing to use NUL-delimited (-z) git diff output and add a small cache for Cygwin path normalization.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lua/diffview/vcs/utils.lua Enhances diff header/hunk/index/path parsing for combined diffs.
lua/diffview/vcs/adapters/git/parser.lua New module for structuring git log --raw/--numstat data and parsing namestat entries.
lua/diffview/vcs/adapters/git/init.lua Uses new parser module, adds Cygwin path cache, switches tracked file parsing to -z output.
lua/diffview/tests/functional/git_parser_spec.lua Adds functional tests for the new Git parser module.
lua/diffview/tests/functional/diff_parser_spec.lua Adds functional tests for diff parsing, including combined diffs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lua/diffview/vcs/adapters/git/init.lua Outdated
Comment thread lua/diffview/vcs/adapters/git/init.lua Outdated
@dlyongemallo dlyongemallo force-pushed the improve_git_adapter_infra branch from 9bfdfa8 to 65bdf3d Compare March 12, 2026 09:12
@dlyongemallo dlyongemallo merged commit c1b0d4e into main Mar 12, 2026
2 checks passed
@dlyongemallo dlyongemallo deleted the improve_git_adapter_infra branch March 12, 2026 09:14
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