Skip to content

full issue ref has escape characters that break hover links #2625

@Jacksondr5

Description

@Jacksondr5

Description

Some context: I'm preparing a repo to be merged into another repo and I'm rewriting commit messages so that the PR references in the hovers will still link back to the original repo. I think this is possible by changing the references from #[pr-number] to [owner]/[repo]#[pr-number] based on this regex. For example: try a rewritten squash (#3) -> try a rewritten squash (Jacksondr5/test-repo#3)

However, the hover opens a link with encoded backslashes in the repo name: https://github.com/Jacksondr5/test%5C-repo%5C/pull/3 . This also happens in the owner/org if there is a hyphen in the name. I've done a little digging and I think the issue is that the text is being escaped before the link is generated. I'll try to do some more digging later this week.

Is this a valid use case? Am I doing this the wrong way?

Reproduction steps (already done in this repo):

  1. Start with a repo that has a commit history with PR merges in it
  2. Rewrite commits using git-filter-repo: git filter-repo --replace-message replace.txt
  3. Hover over blame in editor to trigger GitLens hover
  4. Click PR reference in commit message

GitLens Version

13.5.0

VS Code Version

Version: 1.77.1 (user setup)
Commit: b7886d7461186a5eac768481578c1d7ca80e2d21
Date: 2023-04-04T23:21:11.906Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: No

Git Version

git version 2.34.1

Logs, Screenshots, Screen Captures, etc

Before transformation:
image
After transformation:
image

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions