-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy branch url to clipboard #3343
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Have just one suggestion :)
pkg/i18n/english.go
Outdated
@@ -1746,6 +1759,9 @@ func EnglishTranslationSet() TranslationSet { | |||
CopyCommitURLToClipboard: "Copy commit URL to clipboard", | |||
CopyCommitAuthorToClipboard: "Copy commit author to clipboard", | |||
CopyCommitAttributeToClipboard: "Copy to clipboard", | |||
CopyBranchAttributeToClipboard: "Copy to clipboard", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking out loud: I'm okay with having two of the attributes with the same text, but if it happens for a third time maybe it's best to make them all the same attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'll just create a generic Copy to Clipboard attribute since the copy menu would have the same label everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like there's already a CopyToClipboard attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it these are correct because I've only checked for github
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't verify the branch URL for bitbucket server. The others should be correct.
Getting some weird behaviors when in a repo with multiple remotes. But I think it's not due to the changes in this PR, but rather with the way Copy branch url seems to only use the base url of the upstream named Maybe we can find a way to pass in the name of the upstream of the branch we want to get the url / open a pull request for? We can always default to origin. Especially since this is already what we are doing in |
Valid point @karimkhaleel. I'm not sure how we'd deal with upstreams (for from and to branches) when creating pull requests given that lazygit has a pull request options menu where the target branch can be selected. The branch URL part is clear to me. |
Maybe we just leave the |
I agree |
This change allows copying branch URL to clipboard in the branches view. The existing copy X items are moved to a Copy to Clipboard menu with the following copy options:
Fixes #1959
go generate ./...
)docs/Config.md
) have been updated if necessary