GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — feature: fetch tag pointing to HEAD in shallow clone by gnought · Pull Request #3617 · pre-commit/pre-commit Conversation
This PR adds logic to resolve and fetch the remote tag associated with FETCH_HEAD when present.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
@asottile Thank you for your feedback. I understand that there is no simple way to fetch a single remote tag efficiently. For repositories that require version metadata, and where most Although the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| git_config = 'protocol.version=2' | ||
| git_cmd('-c', git_config, 'fetch', 'origin', ref, '--depth=1') | ||
| git_cmd('checkout', 'FETCH_HEAD') | ||
| git_cmd('tag', '-a', '-m', '""', ref, 'FETCH_HEAD') |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is good either. this will tag non-tags (and invoke signing mechanisms)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, this will tag non-tag revisions but limit to local. As long as pre-commit does not push changes, this will not affect the remote or introduce signing issues.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
-m invokes signing. and if this tags things differently than the actual repo that's not ok
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that -m does not trigger signing unless -s is used.
git does not provide a direct way to fetch a specific tag at a particular commit. The only single-command option is to use --tags with git fetch, but that would retrieve all tags and be slower than creating a fake local tag.
What do you think about the 3rd proposal on git_cmd('-c', git_config, 'fetch', 'origin', ref, '--depth=1', '--tags') ?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
your understanding is slightly wrong. and no --tags will not work that will fetch a bunch of unnecessary stuff
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Try an alternative approach by using |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.