From d6b4906b3596653a072ecac109c17a3a96cdf61d Mon Sep 17 00:00:00 2001 From: Matthew Strasiotto Date: Mon, 21 Oct 2019 15:01:35 +1100 Subject: [PATCH 1/3] Now encode relative paths as URLS --- lib/git-links.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/git-links.coffee b/lib/git-links.coffee index 91ecb89..5c0afc6 100644 --- a/lib/git-links.coffee +++ b/lib/git-links.coffee @@ -37,6 +37,7 @@ module.exports = GitLinks = self.git(['rev-parse', '--show-toplevel'], (code, stdout, errors) -> gitDirectory = stdout.trim() relativePath = filePath.replace(gitDirectory, '') + relativePath = encodeURI(relativePath) link = repo + '/blob/' + commitHash + relativePath + '#L' + line atom.clipboard.write(link) atom.notifications.addInfo('Copied link for current line to clipboard', detail: link) @@ -63,6 +64,7 @@ module.exports = GitLinks = self.git(['rev-parse', '--show-toplevel'], (code, stdout, errors) -> gitDirectory = stdout.trim() relativePath = filePath.replace(gitDirectory, '') + relativePath = encodeURI(relativePath) link = repo + '/blob/' + commitHash + relativePath atom.clipboard.write(link) atom.notifications.addInfo('Copied link for current file to clipboard', detail: link) From faccd0ac573c44a00e97a79f0fb348c06148422b Mon Sep 17 00:00:00 2001 From: Matthew Strasiotto Date: Wed, 5 Feb 2020 11:34:48 +1100 Subject: [PATCH 2/3] Bump Version, rename package, update changelog --- CHANGELOG.md | 5 +++++ package.json | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcdcf26..c391d2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,3 +21,8 @@ * Missed adding the commit command to the entry points. This means you'd have to run another command first. This is now fixed. ## 0.3.3 - Added notifications + +## 0.3.4 - Escape Whitespace + +* Whitespace In Paths were previously not escaped, breaking links when repositories has spaces in some filenames + this is now fixed diff --git a/package.json b/package.json index c7b9dd7..d193ab9 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "git-links", + "name": "git-links-plus", "main": "./lib/git-links", - "version": "0.3.3", - "description": "Get a link to any code hosted in github", + "version": "0.3.4", + "description": "Get a link to any code hosted in github. Previously maintained by calebmeyer", "keywords": [ "git", "link", @@ -15,7 +15,7 @@ "git-links:copy-absolute-link-for-current-commit" ] }, - "repository": "https://github.com/calebmeyer/git-links", + "repository": "https://github.com/mstr3336/git-links", "license": "MIT", "engines": { "atom": ">=1.0.0 <2.0.0" From 2bf11895bc0173aae17ac6c39810b55c779042aa Mon Sep 17 00:00:00 2001 From: Matthew Strasiotto Date: Wed, 5 Feb 2020 11:37:27 +1100 Subject: [PATCH 3/3] Prepare v0.3.5 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d193ab9..9471376 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-links-plus", "main": "./lib/git-links", - "version": "0.3.4", + "version": "0.3.5", "description": "Get a link to any code hosted in github. Previously maintained by calebmeyer", "keywords": [ "git",