Skip to content
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

Adds Open tag on remote option to tagView #3768

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nzaytsev
Copy link
Contributor

@nzaytsev nzaytsev commented Nov 18, 2024

Description

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@nzaytsev nzaytsev linked an issue Nov 18, 2024 that may be closed by this pull request
Copy link
Member

@eamodio eamodio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ensure this follows the patterns of "commits"

package.json Outdated
@@ -3668,7 +3668,8 @@
"fileInCommit",
"fileInBranch",
"fileLine",
"fileRange"
"fileRange",
"tagName"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to tag to match branch, commit, etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed

package.json Outdated
@@ -3706,6 +3707,10 @@
"fileRange": {
"type": "string",
"markdownDescription": "Specifies the format of a range in a file URL for the custom remote service\n\nAvailable tokens\\\n`${start}` — starting line\\\n`${end}` — ending line"
},
"tagName": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to tag

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed

package.json Outdated
@@ -6752,6 +6757,12 @@
"title": "Open Commit on Remote",
"icon": "$(globe)"
},
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a gitlens.openTagOnRemote command like commit/branch/etc for access from the Command Palette

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also not be placed in the middle of the commit commands, put it after

"command": "gitlens.views.openTagOnRemote",
"when": "gitlens:repos:withRemotes && viewItem =~ /gitlens:tag\\b(.*?\\b\\+remote\\b)/",
"group": "inline@99"
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a gitlens.views.copyRemoteTagUrl command and add it as an alt, like commit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to also follow the commit[s] pattern to add this to the context menu as well

@@ -580,6 +580,7 @@ export interface RemotesUrlsConfig {
readonly fileInCommit: string;
readonly fileLine: string;
readonly fileRange: string;
readonly tag: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct once tagName is renamed above

@@ -100,6 +100,10 @@ export class CustomRemote extends RemoteProvider {
return url;
}

protected override getUrlForTag(tagName: string): string {
return this.getUrl(this.urls.tag, this.getContext({ tagName: tagName }));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to tag

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed

@@ -191,4 +191,8 @@ export class GerritRemote extends RemoteProvider {
if (branch) return `${this.encodeUrl(`${this.getUrlForBranch(branch)}/${fileName}`)}${line}`;
return `${this.encodeUrl(`${this.baseUrl}/+/HEAD/${fileName}`)}${line}`;
}

protected override getUrlForTag(): string | undefined {
return undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no support for tags?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no tag details view for gerrit, only tags list view

@@ -33,13 +34,20 @@ export class TagsNode extends CacheableChildrenViewNode<'tags', ViewsWithTagsNod
}

async getChildren(): Promise<ViewNode[]> {
const remote = await this.repo.git.getBestRemoteWithProvider();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this outside the if below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved inside

"title": "Open Tag on Remote",
"category": "GitLens",
"icon": "$(globe)"
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also add gitlens.views.openTagOnRemote.multi command to follow the pattern of commit[s]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

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.

open github release note page from tag
2 participants