feat(git-workflow): Simplify git integration with --from-branch option

- Remove automatic git workflow and branch-tag switching - we are not ready for it yet

- Add --from-branch option to add-tag command for manual tag creation from git branch

- Remove git workflow configuration from config.json and assets

- Disable automatic tag switching functions in git-utils.js

- Add createTagFromBranch function for branch-based tag creation

- Support both CLI and MCP interfaces for --from-branch functionality

- Fix ES module imports in git-utils.js and utils.js

- Maintain user control over tag contexts without forced automation

The simplified approach allows users to create tags from their current git branch when desired, without the complexity and rigidity of automatic branch-tag synchronization. Users maintain full control over their tag contexts while having convenient tools for git-based workflows when needed.
This commit is contained in:
Eyal Toledano
2025-06-13 18:56:09 -04:00
parent 32236a0bc5
commit be0bf18f41
11 changed files with 205 additions and 367 deletions

View File

@@ -1235,7 +1235,7 @@ async function createTagFromBranch(
// Import git utilities
const { sanitizeBranchNameForTag, isValidBranchForTag } = await import(
'../../utils/git-utils.js'
'../utils/git-utils.js'
);
// Create a consistent logFn object regardless of context
@@ -1341,7 +1341,7 @@ async function autoSwitchTagForBranch(
isGitRepository,
sanitizeBranchNameForTag,
isValidBranchForTag
} = await import('../../utils/git-utils.js');
} = await import('../utils/git-utils.js');
// Create a consistent logFn object regardless of context
const logFn = mcpLog || {
@@ -1475,13 +1475,8 @@ async function checkAndAutoSwitchTag(projectRoot, tasksPath, context = {}) {
const rawConfig = fs.readFileSync(configPath, 'utf8');
const config = JSON.parse(rawConfig);
// Check if git workflow is enabled
const gitWorkflowEnabled = config.tags?.enabledGitworkflow || false;
const autoSwitchEnabled = config.tags?.autoSwitchTagWithBranch || false;
if (!gitWorkflowEnabled || !autoSwitchEnabled) {
return null;
}
// Git workflow has been removed - return null to disable auto-switching
return null;
// Perform auto-switch
return await autoSwitchTagForBranch(