Skip to content

feat: add git worktree support to create-branch command - #147

Open
TellMeAlex wants to merge 1 commit into
InditexTech:mainfrom
TellMeAlex:feature/GH-146-add-support-for-creating-gi
Open

feat: add git worktree support to create-branch command#147
TellMeAlex wants to merge 1 commit into
InditexTech:mainfrom
TellMeAlex:feature/GH-146-add-support-for-creating-gi

Conversation

@TellMeAlex

Copy link
Copy Markdown
  • Add --worktree and --worktree-path flags to create-branch command
  • Implement CreateWorktree, ListWorktrees, and RemoveWorktree in GitProvider
  • Add Worktree domain model to represent git worktree state
  • Add createWorktreeBranch use case method with default path generation
  • Add comprehensive unit tests for git worktree operations
  • Add integration tests for worktree creation workflow
  • Update documentation with worktree usage examples and benefits
  • Support fork context (upstream/origin) for worktree creation

Closes #146

@TellMeAlex
TellMeAlex requested a review from a team as a code owner November 27, 2025 17:00
@signoff-validator

signoff-validator Bot commented Nov 27, 2025

Copy link
Copy Markdown

Contribution License Agreement - Valid 🟢

All commits contain valid signoff. As a confirmation, remember that you are agreeing to our Contribution License Agreement.

@danielfn
danielfn self-requested a review January 8, 2026 13:26
@danielfn

danielfn commented Jan 8, 2026

Copy link
Copy Markdown
Member

@TellMeAlex thank you for your contribution!

Not sure why, but the PR-verify workflow did not run with your commit. Trying it locally, I see there are errors with gofmt, could you fix them (make fmt) and push again to trigger the CI?

@TellMeAlex
TellMeAlex force-pushed the feature/GH-146-add-support-for-creating-gi branch from 1105372 to 5144a72 Compare January 12, 2026 09:39
@TellMeAlex

Copy link
Copy Markdown
Author

Hi @danielfn, thanks for the feedback! I've already applied gofmt formatting and pushed the changes. However, I notice the CI is still failing. Could you help me identify what else might need to be fixed?

@danielfn

danielfn commented Feb 5, 2026

Copy link
Copy Markdown
Member

Hi @danielfn, thanks for the feedback! I've already applied gofmt formatting and pushed the changes. However, I notice the CI is still failing. Could you help me identify what else might need to be fixed?

@TellMeAlex there is a failure in the tests, mocks may need to be updated:

-: # github.com/InditexTech/gh-sherpa/internal/fork [github.com/InditexTech/gh-sherpa/internal/fork.test]
Error: internal/fork/fork_test.go:116:43: cannot use gitProvider (variable of type *mockGitProvider) as domain.GitProvider value in argument to NewManager: *mockGitProvider does not implement domain.GitProvider (missing method CreateWorktree)

TellMeAlex added a commit to TellMeAlex/gh-sherpa that referenced this pull request Feb 5, 2026
…thods to GitProvider mocks

- Added the three new methods to both manual mock in fork_test.go and autogenerated mock_GitProvider.go
- Fixes CI failure in PR InditexTech#147 caused by interface extension in commit 2b06ee7
@TellMeAlex
TellMeAlex force-pushed the feature/GH-146-add-support-for-creating-gi branch from 0a59e91 to 12cd0b3 Compare July 17, 2026 09:21
- Add --worktree and --worktree-path flags to create-branch command
- Implement CreateWorktree, ListWorktrees, and RemoveWorktree in GitProvider
- Add Worktree domain model to represent git worktree state
- Add createWorktreeBranch use case method returning the created worktree path
- Add comprehensive unit tests for git worktree operations
- Support fork context (upstream/origin) for worktree creation
- Fix test isolation bug in CreateBranchWorktreeTestSuite (SetupSubTest vs SetupTest)
- Fix default worktree path assertion to match the fake repository name

Closes InditexTech#146

Signed-off-by: Alejandro de la Fuente de la Rosa <alejandrodlfdlr@ext.inditex.com>
@TellMeAlex
TellMeAlex force-pushed the feature/GH-146-add-support-for-creating-gi branch from 12cd0b3 to 27edbab Compare July 17, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for creating Git worktrees

2 participants