fix(but): resolve bare paths for staged files in commit -p (#13318)#14579
Open
sidfishus wants to merge 1 commit into
Open
fix(but): resolve bare paths for staged files in commit -p (#13318)#14579sidfishus wants to merge 1 commit into
commit -p (#13318)#14579sidfishus wants to merge 1 commit into
Conversation
35554b5 to
caea74f
Compare
caea74f to
de583ee
Compare
Collaborator
|
Thanks a lot for giving it a shot! I think this is an area where @jonathantanmy2 would have the most insight. |
Contributor
Author
Collaborator
|
Thanks a lot @sidfishus, this helps for sure! Let me also reel in @davidpdrsn who has been working no a new implementation of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




🧢 Changes
Fix bare-path resolution in
IdMapsobut commit -p foo.txtworks for staged files.Add unit + integration tests for bare path (positive) and
zz:prefix (negative).☕️ Reasoning
non_colon_uncommitted_filename: I thought creating a separate test for cases where there's no colon / prefix makes more sense instead of adding them to the existingcolon_uncommitted_filename. That's the reproducer for the bare-path case (#13318).colon_uncommitted_filename: I only addedzz:assigned→ empty here, a guard sozz:stays scoped to the unassigned bucket and doesn't regress.commit.rs:commit_with_bare_path_on_staged_fileis the reproducer for that style of test. I also addedcommit_with_zz_prefix_on_staged_file_failsas the matching negative case. I didn't add comments because the tests are self explanatory and this is consistent with the other tests.Issue discussion: Per #13318, fix the reported case where a single staged foo.txt wasn't found. Qualified IDs (oo, i0:foo.txt) still work. Duplicate paths across areas still hit the existing ambiguity error; no new disambiguation logic in this PR.
This seems like a suitable issue to pick up for my first contribution.
AI Notice: I have peer programmed this with an AI agent. I've spent a lot of time reproducing and understanding the problem, and considering how best to name the functions (I got confused between uncommitted files and uncommitted/unassigned (
zz)). This is what I've finalised on, but happy to be led by somebody with more experience of the codebase.🎫 Affected issues
Fixes: #13318