Repository navigation
fix: re-add repo_name() for bare repo layout (regression #1279) - #1544
Closed
worktrunk-bot wants to merge 1 commit into
Closed
worktrunk-bot wants to merge 1 commit into
worktrunk-bot wants to merge 1 commit into
Conversation
The fix in 5b67d38 added Repository::repo_name() to resolve the project name correctly for nested bare repos (project/.git → "project"). Commit 79361c6 (#1280) inadvertently removed repo_name() while refactoring repo_path() to return Result, reverting all call sites back to repo_path().file_name() which returns ".git" for bare repos. Re-add repo_name() adapted for the Result-returning repo_path() API, and restore the regression test. Closes #1279 Co-Authored-By: Claude Opus 4.6 <[email protected]>
This was referenced Mar 15, 2026
Collaborator
Author
worktrunk-bot
added a commit
that referenced
this pull request
Mar 16, 2026
Previously, claude-mention triggered on `issues: [opened, edited]` while claude-issue-triage skipped issues mentioning @worktrunk-bot. This caused races when a user both commented on an existing issue and filed a new one — two workflows independently created fix PRs for the same bug (#1544/#1545). Now triage handles all new issues (including @worktrunk-bot mentions), and mention only triggers on issue edits. This eliminates the race for new issues while preserving the ability to summon the bot by editing an existing issue. Ref: #1548 (comment) Co-Authored-By: Claude Opus 4.6 <[email protected]>
max-sixty
pushed a commit
that referenced
this pull request
Mar 21, 2026
…ixes (#1548) ## Problem When a user both comments on an existing issue AND files a new issue within seconds (as happened with #1279/#1543), two independent workflows (`claude-mention` and `claude-issue-triage`) race to create fix PRs. This produced duplicate PRs #1544 and #1545, which modify the exact same 6 files with nearly identical changes. The review bot then reviewed both PRs independently and even posted misleading feedback on #1545 — flagging "missing" call site migrations in `src/llm.rs` and `src/commands/step_commands.rs` that PR #1544 already handles. **Evidence:** Run 23121388888 (review of #1545) posted a COMMENT suggesting files that the sibling PR #1544 already covers. Run 23121179226 (review of #1544) found no issues but didn't detect the duplication either. This is a variant of #1428 but affects user-triggered events (not bot-authored), so the existing bot-author filter from #1429 doesn't help. ## Fix Add a new **Step 2: Check for overlapping PRs** to the review-pr skill. Before reading the diff, the reviewer checks whether other open bot-authored PRs touch the same files. If overlap is found, it's flagged in the review so one can be closed as a duplicate. Also renumbers subsequent steps (3→4, 4→5, etc.) and updates internal cross-references. ## Why this approach - **Catches duplicates at review time** — the cheapest point to detect, since both PRs exist by then - **Doesn't require workflow coordination** — no locking or inter-workflow communication needed - **Low false-positive risk** — overlapping files on bot PRs with similar fixes is a strong signal The underlying race between triage and mention workflows remains (fixing that would require cross-workflow locking), but this ensures the reviewer surfaces the duplication for human action. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: worktrunk-bot <[email protected]> Co-authored-by: Claude <[email protected]>
max-sixty
pushed a commit
that referenced
this pull request
Nov 28, 2026
…#4908) `{{ repo }}` in commit and squash prompt templates now renders the repository's name in every worktree. Before, it rendered the current worktree's folder name, so a custom template run from a linked worktree at `~/code/myrepo.feature` got `myrepo.feature`. A hook in the same worktree gets `myrepo`, and [the LLM commits docs](https://worktrunk.dev/llm-commits/) describe the variable as "Repository name". The three prompt sites (`build_commit_prompt`, the squash preview, the squash run) each derived the name from `wt.root()`. They now share `llm::prompt_repo_name`, which reads `Repository::repo_path()`, the same source `build_hook_context` and the worktree-path template use. The default templates don't reference `{{ repo }}`, so only custom templates are affected. One effect to know about: in a nested bare layout (`project/.git` with worktrees beside it), the prompt's `repo` changes from the worktree's folder name (e.g. `main`) to `.git`. That's the value hooks already get there. Naming bare repos better was discussed in #1281, #1544 and #1545, and this PR doesn't change that. The new test `test_prompt_repo_names_the_repository_from_a_linked_worktree` covers `commit --show-prompt`, `squash --show-prompt`, `squash --dry-run`, and a real squash, all from a linked worktree. On `main` it fails with `repo=repo.feature`; with the fix it passes. The `merge::` and `bare_repository::` integration tests also pass locally, except `test_merge_no_ff_signs_merge_commit`, which fails the same way on `main` in this sandbox (ssh refuses the test's signing key because its file permissions are too open). Co-authored-by: worktrunk-bot <[email protected]>
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.
Summary
Repository::repo_name()which was inadvertently removed by fix: propagate repo_path() errors via Result instead of fallback #1280project/.git), resolves{{ repo }}to"project"instead of".git"project/.bare→"project"andproject.git→"project"The original fix (5b67d38) was working, but #1280 refactored
repo_path()to returnResultand in doing so reverted all call sites back torepo_path()?.file_name(), removing therepo_name()method entirely.Test plan
test_nested_bare_repo_repo_name_not_dot_git— verifies{{ repo }}resolves to project name🤖 Generated with Claude Code