Conversation
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 proposes changes to the existing CLI model and introduces additional functionality for variation derivation. The previous tool already provided support for associating feature metadata with changes, but this work restructures that workflow and expands it with explicit variant derivation support.
Metadata annotation functionality and variant derivation is introduced through a new cli
git-vms. This redesign aligns the workflow more closely with standard Git usage and keeps operations primarily local to the repository.Overview
Idea
The core idea remains the same: associate feature metadata with changes and use that metadata to improve the git cli experience and explore possibility for variant derivation.
Commands
init
Initializes variation management support in the repository. It introduces a configuration file
varcs.tomlat the root of the repo and also initializes metadata tracking for staged files.The rationale behind the command was to introduce a way to keep variant definitions version controlled and improve observability and collaboration in shared repo.
add
Stages files while associating them with a feature.
Unlike the previous implementation, this version supports only one feature per change. This was done to enforce small, well-scoped commits and to help avoid ambiguity in feature ownership for feature derivation. Supporting multiple features is possible but it requires validation rules in variant definitions.
commit
Creates a commit with embedded feature metadata.
Unlike the previous implementation that relied on the existing
git commitcommand with pre-commit hooks, this subcommand togit vmsembeds metadata directly into the commit message. It also introduces a "change id" for tracking logical changes across history.The rationale behind this change was to avoid issues with hooks (fragility, portability, interoperability). Keeping metadata co-located with the change itself reduces the additional states that we need to maintain and ensures compatibility with commands like
rebase,cherry-pickand also simplifies syncing. The "change id" can be used to track a commit through its evolution across branches (eg. when cherry picked).derive
Derives a variant defined in
varcs.toml.Implementation
Limitations
The limitations a purely commit based approach exist. Commits represent changes, not features. Even when features appear isolated, they can rely on import, shared utilities and so on. Also, a project can have cross-cutting refactoring that affect multiple independent features. Operations like moves, renames and formatting changes can collapse carefully curated feature boundaries in commit history.