Enable commit-specific git fetch for compatibility with external forks.#83
Enable commit-specific git fetch for compatibility with external forks.#83leander-dsouza wants to merge 1 commit intomainfrom
Conversation
85222a3 to
e4d26d4
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #83 +/- ##
==========================================
- Coverage 26.96% 26.84% -0.12%
==========================================
Files 31 31
Lines 2240 2250 +10
Branches 393 397 +4
==========================================
Hits 604 604
- Misses 1576 1586 +10
Partials 60 60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This pull request adds support for fetching specific commit hashes in non-shallow Git import mode, and improves test skipping for VCS tools that may not be installed.
- Refactored version type determination to work for both shallow and non-shallow modes
- Added explicit fetch of commit hashes for non-shallow repository imports
- Added test skipping when SVN or Mercurial tools are not available
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| vcs2l/clients/git.py | Refactored to determine version type earlier and fetch specific commit hashes in non-shallow mode for both existing and new repositories |
| test/test_commands.py | Added utility variables and skip decorator for tests requiring SVN and Mercurial |
| test/reimport_force.txt | Updated expected output to include fetch messages for commit hash imports |
| test/import.txt | Updated expected output to include fetch messages for commit hash imports |
There was a problem hiding this comment.
The checks added here are part of the fixture setup in __init__.py. What's the motivation to duplicate them here?
There was a problem hiding this comment.
They were initially duplicated as Subversion, and Mercurial ignores were flaky in Windows 2025 in previous workflow runs.
However, they currently work as expected, so I have dropped the additional commit.
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
e4d26d4 to
9d6d6bc
Compare
Basic Info
Description of contribution in a few bullet points
Description of how this change was tested
1. Testing against vcs2l old pull requests
First, clone the codebase:
Next, use the following
repos.yamlto get the commit hash of the following external fork:Finally, update the existing repository:
This will successfully checkout the repository to the specific hash.
This step fails without this contribution with the following error message:
=== ./vcs2l-ext-fork (git) === Could not checkout ref '4ad2dd14b0033c275e5faff7935c4a7d7581fee4': fatal: reference is not a tree: 4ad2dd14b0033c275e5faff7935c4a7d7581fee42. Test against the reproduction step in the parent issue - dirk-thomas/vcstool#258
Reproduction measures specified by @timor-raiman