Skip to content

Request support git "insteadOf" url aliases #1150

Description

@larsks

Bug Report

Description

With a configuration like this in my global git config:

[url "ssh://[email protected]/larsks/"]
	insteadof = me:

I can clone a repository like this:

git clone me:myproject

Which ends up looking like this:

$ git config --get remote.origin.url
me:myproject

Which ultimately causes psr to fail like this:

$ psr version
::ERROR:: Bad url: 'me:myproject'

Expected behavior

PSR would not have thrown an error because it would have been able to interpret my git configuration and extracted the remote URL just as git normally can.

If you use git remote get-url <remote> command, it will return a fully expanded url via the insteadOf setting.

$ git remote get-url origin
ssh://[email protected]/larsks/myproject

Actual behavior

PSR errored out with a failure message of a bad remote URL because it retrieved the remote url setting which in raw form is an invalid URL rather than using the git interpreter which supports the insteadOf alias attribute and would of returned a valid remote URL value.

Environment

semantic-release, version 9.16.1

Activity

  1. added
    bugSomething isn't working properly
    triagewaiting for initial maintainer review
    on Jan 22, 2025
  2. changed the title [-]psr should support git "insteadOf" url aliases[/-] [+]Request support git "insteadOf" url aliases[/+] on Jan 22, 2025
  3. added
    confirmedPrevent from becoming stale
    and removed
    triagewaiting for initial maintainer review
    on Jan 22, 2025
  4. codejedi365 commented on Jan 22, 2025

    @codejedi365
    Contributor

    I don't appreciate the rude tone as I do this on my own time for $0.

  5. larsks commented on Jan 22, 2025

    @larsks
    ContributorAuthor

    Look, I wasn't trying to be rude. I was just opening an issue. I'm sorry to bother you; I'll work on fixing it myself and submit a PR at some point.

  6. larsks commented on Jan 22, 2025

    @larsks
    ContributorAuthor

    I've re-read the original post, and I'm not sure what you've identified as "rude". Was it this?

    psr fell over because it couldn't parse a valid remote specification.

    Maybe the description is a bit terse, but I think it accurately captures the behavior. I apologize if it came across as rude. For what it's worth, I also work on software for $0 in my spare time, so we have in common, at least.

    If other folks want to tackle this, note that the underlying problem is that PSR relies on GitPython, which has been in "maintenance mode" for at least eight years. The most relevant issue was opened backed in 2017, and has remained untouched since then.

    The correct path forward is probably to fix this in GitPython, but note that even if it gets fixed there, PSR will need to update its dependencies, which currently pins GitPython to ~= 3.0, whereas GitPython has moved on to 3.1.xx.

  7. added a commit that references this issue on Jan 22, 2025
    897ebee
  8. larsks commented on Jan 22, 2025

    @larsks
    ContributorAuthor

    It turns out there's a relatively simple way to work around this; I've submitted a pull request that addresses the problem.

  9. codejedi365 commented on Jan 23, 2025

    @codejedi365
    Contributor

    I've re-read the original post, and I'm not sure what you've identified as "rude". Was it this?

    psr fell over because it couldn't parse a valid remote specification.

    Maybe the description is a bit terse, but I think it accurately captures the behavior. I apologize if it came across as rude.

    Thanks for the apology, I was probably having a bit of a long day and took it overly personal as I had never heard of the instead of aliasing option before. It's quite difficult to get all scenarios of use covered.

    For what it's worth, I also work on software for $0 in my spare time, so we have in common, at least.

    We do, which software is that?

    If other folks want to tackle this, note that the underlying problem is that PSR relies on GitPython, which has been in "maintenance mode" for at least eight years. The most relevant issue was opened backed in 2017, and has remained untouched since then.

    The correct path forward is probably to fix this in GitPython, but note that even if it gets fixed there, PSR will need to update its dependencies, which currently pins GitPython to ~= 3.0, whereas GitPython has moved on to 3.1.xx.

    That is good research you have completed and it would be nice to have GitPython still maintained.

    No need to bump the version, the approximation value only locks the major version of 3.

  10. added 3 commits that reference this issue on Jan 23, 2025
    1f7e500
    cb1d587
    f872aff
  11. 1 remaining item

  12. added a commit that references this issue on Jan 23, 2025
    174e4e3
  13. added a commit that references this issue on Jan 26, 2025
    4045037
  14. codejedi365 commented on Jan 26, 2025

    @codejedi365
    Contributor

    🎉 This issue has been resolved in Version 9.17.0 🎉

    You can find more information about this release on the GitHub Releases page.

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

    bugSomething isn't working properly

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions