Skip to content

[WIP] Support configurable URL schemes in git-link #143

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

Merged
merged 1 commit into from
Jul 12, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 11, 2025

  • Analyze the problem statement and understand current code structure
  • Locate the git-link--web-host function and understand its usage
  • Identify how web-host values are used in handler functions
  • Write comprehensive tests for the new functionality
  • Implement scheme detection logic in git-link--web-host function
  • Create helper function git-link--format-url for URL construction
  • Update git-link-github handler to support custom schemes
  • Update remaining handler functions (GitLab, Bitbucket, etc.)
  • Test the implementation with various scenarios
  • Verify all existing tests still pass

This pull request was created as a result of the following prompt from Copilot chat.

Update the git-link--web-host function to allow customizable URL schemes for git-link commands. Currently, the handler functions (git-link, git-link-commit, and git-link-homepage) retrieve a hostname, which is then passed to a handler, and the hostname is derived from an entry in git-link-web-host-alist. This alist is in the form (GIT-HOST-REGEXP . WEB-HOST) where WEB-HOST is usually hardcoded to use the https scheme. The desired change is to allow users to specify a scheme within the WEB-HOST value. In the git-link--web-host function, determine if the WEB-HOST value already has a URL scheme (for example, it begins with a pattern like "https:" or "http:"). If it does not, modify the WEB-HOST value by prepending "https:" to it. This way, users can configure alternative schemes by specifying them directly in the git-link-web-host-alist. The change should be implemented in a single commit or squashed into one commit before opening the pull request.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI assigned Copilot and sshaw Jul 11, 2025
@Copilot Copilot AI requested a review from sshaw July 11, 2025 22:49
Copilot stopped work on behalf of sshaw due to an error July 11, 2025 22:49
@@ -622,16 +635,16 @@ is no entry for GIT-HOST in the list, it is returned unmodified."
(format "L%s" start)))))))

(defun git-link-github (hostname dirname filename branch commit start end)
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot all values (functions) in git-link-remote-alist, git-link-commit-remote-alist, and git-link-homepage-remote-alist must be updated like this, to support a hostname with a prefix.

Also git-link--format-url does not look necessary since all hosts returned by git-link--web-host will have a scheme.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated all handler functions in git-link-remote-alist, git-link-commit-remote-alist, and git-link-homepage-remote-alist to support scheme-enabled hostnames. Also removed the unnecessary git-link--format-url function as requested. Commit 995b624

Copy link
Contributor Author

Copilot AI commented Jul 12, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI requested a review from sshaw July 12, 2025 02:06
Copilot finished work on behalf of sshaw July 12, 2025 02:06
@sshaw sshaw force-pushed the copilot/fix-79320625-cd55-4c4b-922e-2052b4261c1a branch 2 times, most recently from a0b5b28 to 1740bd6 Compare July 12, 2025 04:22
…handlers

This allows for linking to http hosts

Co-authored-by: sshaw <[email protected]>
@sshaw sshaw force-pushed the copilot/fix-79320625-cd55-4c4b-922e-2052b4261c1a branch from 1740bd6 to 933135d Compare July 12, 2025 04:26
@sshaw sshaw marked this pull request as ready for review July 12, 2025 14:24
@sshaw sshaw merged commit f12dbcc into master Jul 12, 2025
18 checks passed
@sshaw sshaw mentioned this pull request Jul 12, 2025
@sshaw sshaw deleted the copilot/fix-79320625-cd55-4c4b-922e-2052b4261c1a branch July 12, 2025 23:56
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.

2 participants