Skip to content

Regression - incorrect directory passed to function in "git-link-remote-alist" #95

Description

@edkolev

Hi, I updated the git-link package to the latest one and my custom function in "git-link-remote-alist" stopped working (produces incorrect URLs).

I've been using git-link for 3+ years without any issues with the config pasted below.

The issue is DIRNAME passed to my function is invalid. I've narrowed down the issue to git-link--parse-remote.

Here's how to reproduce it:

(git-link--parse-remote "gitolite@my.company.internal:dir")
;; returns ("my.company.internal" "/")
;; expected ("my.company.internal" "dir")

This is the git config:

$ git config --get remote.origin.url
gitolite@my.company.internal:dir/

Could you please review the parsing in git-link--parse-remote? I suspect it has changed. I haven't binary-searched for the breaking commit, but it should be committed the last 1-2 years. Sorry, I don't know what was the previous version which was working for me. EDIT: last working version is in the comment below.

Thanks for this package, it has been one of my daily tools!

Config ("XXX" obfuscates what I don't want to share):

(use-package git-link
  :ensure t
  :config
  (add-to-list 'git-link-remote-alist '("XXX" git-link-xxx))

  (defun git-link-xxx (hostname dirname filename branch commit start end)
    (format "XXX/%s/%s@%s/-/blob/%s"
            hostname
            dirname
            (or branch commit)
            (concat filename
                    (when start
                      (concat "#"
                              (if end
                                  (format "L%s-%s" start end)
                                (format "L%s" start))))))))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions