feat: add VERSION file update with gitversion semver on checkout - #11
Merged
Conversation
Co-authored-by: tomgrv <1809566+tomgrv@users.noreply.github.com>
Co-authored-by: tomgrv <1809566+tomgrv@users.noreply.github.com>
Co-authored-by: tomgrv <1809566+tomgrv@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] VERSION file update
feat: add VERSION file update with gitversion semver on checkout
Sep 15, 2025
Copilot stopped work on behalf of
tomgrv due to an error
September 15, 2025 21:26
tomgrv
approved these changes
Sep 15, 2025
tomgrv
self-requested a review
September 15, 2025 21:30
tomgrv
marked this pull request as ready for review
September 18, 2025 09:43
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements automatic VERSION file updates using GitVersion semver on checkout to provide developers with visibility into their current working version.
- Added a VERSION file that gets automatically updated with semver information
- Created an intelligent version update script that tries GitVersion first, then falls back to git describe
- Enhanced the post-checkout hook to automatically update the VERSION file on branch/commit switches
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| update-version.sh | New script that determines current version using GitVersion or git describe fallback |
| src/githooks/_post-checkout.sh | Enhanced to call the version update script automatically |
| VERSION | New file containing the current version string |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
tomgrv
self-requested a review
September 21, 2025 07:48
tomgrv
requested changes
Sep 21, 2025
tomgrv
left a comment
Owner
There was a problem hiding this comment.
Le fichier version ne doit pas être comité dans le repos
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
tomgrv
force-pushed
the
copilot/fix-10
branch
from
September 22, 2025 16:00
6f46e7d to
b06abdf
Compare
tomgrv
pushed a commit
that referenced
this pull request
Sep 23, 2025
* Initial plan * feat: add VERSION file update with gitversion semver on checkout Co-authored-by: tomgrv <1809566+tomgrv@users.noreply.github.com> * fix: improve version extraction logic for better semver detection Co-authored-by: tomgrv <1809566+tomgrv@users.noreply.github.com> * feat: add VERSION file update with gitversion semver on checkout Co-authored-by: tomgrv <1809566+tomgrv@users.noreply.github.com> * feat: support flexible naming Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: 🐛 handle legitimate naming Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 PR implements automatic VERSION file updates with GitVersion semver on each checkout, allowing developers to easily see what version they're currently working on.
Changes Made
1. Created VERSION File
VERSIONfile in the repository root that gets automatically updated1.0.0and managed by the version update system2. Version Update Script
Created
update-version.shthat intelligently determines the current version:The script handles various scenarios:
feature_larasets_5.10.2→5.10.2-2-g51926a73. Enhanced Post-Checkout Hook
Modified
src/githooks/_post-checkout.shto automatically call the version update script:How It Works
cat VERSIONto see their current working versionExample Usage
This integrates seamlessly with the existing GitVersion configuration and devcontainer features workflow, requiring no manual intervention once the githooks feature is installed and configured.
Fixes #10.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.