Repository navigation
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
mishamsk
marked this pull request as draft
February 3, 2026 16:32
Owner
|
@mishamsk still in progress or forgot to un-draft? |
Contributor
Author
|
Draft still. I wanted to improve how it shortens the path. Currently stupid. Didn't get to it yet, sorry. But I have vested interest in this pr, so rest assured it is coming |
Instead of truncating both commit text and folder path to fit narrow screens, hide the subpath entirely when it doesn't fit and only show the commit detail. This is more readable than showing truncated paths.
Three fixes for worktree folder path display: - Don't show path for the main worktree (where .git lives) - Fix branch-to-folder matching by comparing just the folder basename instead of computing the full expected path from repoPath (which could be a worktree path itself, not the main repo) - Move folder path to appear after branch name, before status symbols
Replace the full folder path display with a compact ⧉ symbol to indicate the worktree folder doesn't match the branch name. This preserves space for the commit message which is more useful.
When the worktree folder doesn't match the branch name, show "📂 folder-name" after the branch. If there isn't enough terminal width to fit the folder name alongside the commit text, fall back to showing just the 📂 icon as a compact indicator.
Wrap the folder mismatch indicator in square brackets ([📂 name] or [📂]) and use a │ pipe to visually separate the worktree name section from the status/commit tail.
mishamsk
marked this pull request as ready for review
February 15, 2026 03:40
Contributor
Author
|
@melonamin ready (although not entirely sure about bare folder symbol for narrow display, maybe you have better ideas) |
Contributor
Author
|
@melonamin maybe merge this one? |
melonamin
added a commit
that referenced
this pull request
Apr 30, 2026
Release includes: - Show worktree subpath when folder name doesn't match branch (#9)
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
When a worktree's folder name doesn't match its checked-out branch (e.g. branch
feature/loginin folderold-experiment), show a visual indicator so users know the folder is non-standard.Display format
branch ✓ ↑1 commit text (2h ago)branch [📂 folder-name] │ ✓ ↑1 commit text (2h ago)branch [📂] │ ✓ ↑1 commit text (2h ago)Visibility rules
.gitlives): never shows folder indicator — it's always expected/→-) — no indicator[📂 folder-name]when terminal is wide enough to also fit the commit text; collapses to[📂]when space is tight│pipe separates the worktree identity section from the status/commit tailChanges
mainWorktreeDirtracking (first entry fromgit worktree list) to correctly identify the main repo regardless of which worktreegtis launched fromisExpectedWorktreePaththat compares just the folder basenametruncatePathTail,tailStringByWidth,truncateStringByWidth) in favor of simple show-or-hide logictruncateToWidthfor display-width-aware string truncationgo-runewidthdirect import,mathimport, and related constantsTest plan
TestIsExpectedWorktreePath— validates branch-to-folder matching for simple names, slashed branches, mismatches, and edge casesTestTruncateToWidth— validates width-aware truncation with ellipsis