Repository navigation
Copy a ref's name to the clipboard from its menu - #711
Merged
Merged
Conversation
goneng
force-pushed
the
copy-a-ref-name-to-the-clipboard
branch
from
September 21, 2026 19:51
990b053 to
12b47e4
Compare
goneng
marked this pull request as ready for review
September 21, 2026 20:00
Contributor
|
Do you have an idea, why this menu is not shown in screenshots ? |
Collaborator
Author
yes, the new option is not showing because the right-click is done on the commit-message and not on the actual branch-tag. |
goneng
force-pushed
the
copy-a-ref-name-to-the-clipboard
branch
from
September 22, 2026 05:19
12b47e4 to
3dab919
Compare
hannesa2
approved these changes
Sep 22, 2026
A name too long for the sidebar to show has to be read off the screen and retyped before it can be used, so the menu that every ref already has offers to copy it. - Add the item to the shared ref menu builder, so the sidebar rows and the ref labels in the history view both gain it at once - Copy the short name, which is what a git command takes, rather than the full ref, which would have to be trimmed by hand - Put it second, under the entry that opens or checks the ref out, so it is nowhere near the one that removes it - Say "Copy name", since a menu of refs is not obvious about what a bare "Copy" would take
goneng
force-pushed
the
copy-a-ref-name-to-the-clipboard
branch
from
September 22, 2026 05:21
3dab919 to
11dc5c7
Compare
Contributor
Contributor
|
I used it recently the first time in real life. It's very useful |
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.

A branch name too long for the sidebar to show has to be read off the
screen and retyped before it can be used, so the menu that every ref
already has now offers to copy it.
Description
menuItemsForRef:, the one builder the sidebar andthe ref labels in the history view both read, so both gain it at once
feature/foo, which is what a git commandtakes; the full ref would have to be trimmed by hand
refishForSender:refishTypes:with no typefilter, so branches, tags, remotes and remote branches are all
covered by the same action
out, rather than beside the one that removes it, and title it
"Copy name" so it is clear what lands on the clipboard
Screenshot
Test plan
enabled, carries its ref, names the branch rather than the full ref,
is offered for tags and remote branches, sits second whether the
first entry checks out or opens a worktree, comes first for a plain
remote which has neither, and is never adjacent to Remove
for
masterreadsCheckout “master”thenCopy name “master”, andinvoking it puts
masteron the clipboard, notrefs/heads/masterNSPasteboard generalPasteboardis system-wide, so a test would replace whateverthe developer had copied, and restoring it would preserve only plain
text. The wiring, the title, the placement and the ref types are
covered instead.