There is no ability to unlink or re-configure an already linked project

Issue #23 resolved
Adrian Kelly created an issue

Hi,

I am using ssh aliases stored in~/.ssh/config. At some point I must have incorrectly configured the Linky settings for a repo and have no way to reconfigure or un-link that project.

Comments (11)

  1. Daniil Penkin staff

    Hello @adrianbk,

    Thank you for trying out Linky and reaching out with this issue.

    You're right, there's currently no way in the UI to go back and unlink a manually linked repository. It's mainly because of the effort required to implement that and also I'm not sure that unlinking is going to be a common thing ¯\_(ツ)_/¯

    What you can do now to fix your problem is to remove the matching between remote URL pattern and Bitbucket hosting. To do that, you'll need to edit the settings file manually:

    • Close the IDE. Otherwise the settings you change might be overridden to the old values when the IDE gets focus back or when it quits.
    • Navigate to /Users/<your_user>/Library/Preferences/<ide_with_version>/options/, in my case it's /Users/dpenkin/Library/Preferences/IntelliJIdea2017.1/options/.
    • There will be two files that Linky uses: bitbucket-cloud-registry.xml and bitbucket-server-registry.xml which keep the registry of discovered Bitbucket Cloud and Bitbucket Server hostings, respectively. From your screenshot I guess you'd need to edit the one for Cloud.
    • Settings file is an XML file. You need to find the record element that defines the pattern you've misconfigured — it will be under application/component/lookup/record. You can tweak that record in place or just remove it to be able to re-link the repo later in the IDE Settings UI.
    • Once you edited and saved the file, you can reopen your IDE. Depending on what you did on previous step, Linky will either point to the correct location or will revert the settings screen to the state shown on the second screenshot above.

    Note that when you change the pattern, it will affect all repositories with similar pattern (I mean that Linky doesn't actually link a repo to a remote hosting but rather remembers the pattern of the remote URL), but that's probably what you in fact want.

    I'll leave this issue open but change it from bug to an improvement and will think about it in one of the following releases.

    Hope this helps. Let me know if you have any further questions.

    Cheers, Daniil

  2. Adrian Kelly reporter

    @dpenkin Thanks for the quick response. I deleted all of the bitbucket-* files under ~/Library/Preferences/IntelliJIdea2017.1/options/ and restarted and then I was able to reconfigure correctly.

  3. Daniil Penkin staff

    No worries. I'm happy to help :)

    Yeah, if you delete those files, Linky will be "reset" like if you just installed it, in terms of discovering Bitbucket instances. So if you just use one instance, it doesn't matter whether you delete a record or the whole file.

  4. Adrian Kelly reporter

    I had tried uninstalling the plugin and reinstalling the plugin but it had no effect. I wonder should the uninstall process remove those settings files?

  5. Daniil Penkin staff

    Right, I meant "just installed it for the first time".

    It'd be nice to do a proper cleanup. To be honest, I don't know if there's a way to scratch the configuration when the plugin is deleted. Just briefly looked through IntelliJ's code a couldn't find anything for that. I'll look more into this when I have time but I can't guarantee it's doable.

  6. Log in to comment