Correctly handle ignore pattern in multilevel nested histories#164
Closed
pfn-asm wants to merge 2 commits intoascmitc:masterfrom
Closed
Correctly handle ignore pattern in multilevel nested histories#164pfn-asm wants to merge 2 commits intoascmitc:masterfrom
pfn-asm wants to merge 2 commits intoascmitc:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request fixes the handling of ignore patterns in multilevel nested histories and ensures that patterns are correctly propagated into child histories. Key changes include:
- Enhancements in the logic to compute relevant ignore patterns in nested histories.
- Introduction of new helper functions and updates to ignore spec calculations in generator and commands.
- Updates to test fixtures to support the revised ignore pattern functionality.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_ignore.py | Added a helper test function for asserting ignore pattern behavior. |
| tests/conftest.py | Added fixtures to simulate complex nested file structures for testing. |
| ascmhl/utils.py | Introduced a utility function to check if a path is absolute to a history. |
| ascmhl/history.py | Added method to accumulate ignore patterns from nested histories. |
| ascmhl/generator.py | Revised commit logic to use the new get_relevant_ignore_pattern helper. |
| ascmhl/commands.py | Updated ignore spec handling to incorporate nested history ignores. |
| .github/workflows/build+test.yml | Adjusted branch list to reflect the new feature branch. |
Comments suppressed due to low confidence (1)
tests/test_ignore.py:85
- The parameter name 'pattern' is reused as the loop variable in 'for pattern in pattern:', which shadows the outer variable. Consider renaming the loop variable to avoid confusion.
def assert_pattern_ignored_in_result(pattern: [str], result, negate=False):
| return path | ||
|
|
||
|
|
||
| def check_path_is_absolute_to_history(base_path, relative_path) -> bool: |
There was a problem hiding this comment.
Using 'startswith' to determine if one path is within another may lead to false positives (e.g., '/root/foo' vs '/root/foobar'). Consider using os.path.commonpath or a more robust method for path comparison.
Collaborator
Author
|
covered by pull request #166 |
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.
This fix covers two main topics regarding ignore patterns in nested histories: