Repository navigation
Conversation
|
hey @orhun @ognis1205 - draft is up for the refactor we discussed in #1369. main change is pulling the include-path resolution into one function that runs after repo discovery instead of the three scattered spots. still a draft so happy to rework anything based on feedback. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1379 +/- ##
==========================================
+ Coverage 48.90% 49.13% +0.23%
==========================================
Files 26 26
Lines 2272 2296 +24
==========================================
+ Hits 1111 1128 +17
- Misses 1161 1168 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Thanks for the effort!
I'm quite cautious about this PR, especially around the directory handling changes.
Historically, this area has been fragile: fixing one bug has often led to unexpected behavior elsewhere, and we've gone back and forth with multiple fixes. Because of that history, I'm very hesitant to introduce substantial changes now.
On top of that, I believe the git-cliff crate as a whole needs a broader refactoring. Although this PR is labeled as a refactoring, I feel it also contains unclear functional changes, and I'm not convinced this is the right time for such a refactoring.
In particular, simply consolidating directory handling into a single function doesn't address the root issues. Given the past instability, I'm concerned we'll reintroduce bugs that we haven't fully anticipated.
Personally, I'd prefer to avoid major changes to the existing implementation for now, and instead fix the workdir issue based on the current code. I think that would let us isolate the problem more cleanly and reduce the risk of regressions.
cc: @orhun any thoughts on this?
|
Thanks again for working on this. As mentioned in my review, I'm still a bit hesitant about the scope of the changes here. Given that this area has historically been quite fragile, I'd prefer to keep the existing implementation mostly intact for now and focus only on fixing the Would you be open to adjusting this PR to target the |
be7da48 to
6f387c8
Compare
|
@ognis1205 @orhun sorry for the delay on my side. I had to take some time off for personal reasons, but I am back now and still available to take this forward. I went back through the review feedback and reworked this into a smaller fix for the What changed in the local rework:
I also ran:
I still need to push the narrowed version, but the broader refactor pieces are out now. Please take another look when I push the update. Also happy to collaborate if that would make this easier to move forward. |
|
Hey again, I kinda lost track on this. What is the latest state and do you wish to proceed with a review? |
eb1f825 to
a87f529
Compare
a87f529 to
7bee6fe
Compare
Description
Extracts path resolution for
--workdirand--include-pathinto a singleresolve_include_pathsfunction that runs after repo discovery, where the repo root is available.Previously, the workdir block set
args.include_pathto a raw workdir path before repo discovery (absolute or cwd-relative), which never matched the repo-relative paths from git2's diff API. This broke--workdirin v2.11.0.The new function handles three cases:
--workdirset to a subdirectory adds a repo-relative glob; workdir at root means no filterAll paths (root, cwd, workdir) are canonicalized before comparison to handle symlinks.
Motivation and Context
Fixes #1369
As discussed in the issue, the path resolution logic was scattered across three locations in
lib.rs. @orhun asked for a proper refactor rather than a band-aid fix.How Has This Been Tested?
resolve_include_pathscovering: workdir at root, workdir subdirectory, workdir outside repo, implicit cwd scoping, no scoping at root, repository arg suppressing implicit scoping, config patterns combined with workdirnormalize_to_repo_relativetest-workdir-root(--workdir .with empty + file-changing commits)cargo clippy --tests -- -D warningscargo +nightly fmt --all -- --checkTypes of Changes
Checklist:
cargo +nightly fmt --allcargo clippy --tests --verbose -- -D warningscargo test