git-blame icon indicating copy to clipboard operation
git-blame copied to clipboard

custom commit url template string doesn't work if remote is not named 'origin'

Open noseglid opened this issue 11 years ago • 4 comments

I have only one remote, named 'gerrit' which points to my Gerrit code review git repo. We also have a cgit connected to this which provides an HTTP interface to the repo. I utilized the custom url in settings: 'https:///cgit.cgi/<%-repo%>/gerrit.git/commit/?id=<%-revision%>' (nifty feature by the way). When I now click on a commit after bringing up the git blame, it gives me 'Uncaught TypeError: Cannot call method 'match' of null' in '/home/alexo/.atom/packages/git-blame/lib/util/RemoteRevision.js:65'.

I tried changing the name on my remote to 'origin', where it worked fine (and correctly opened my browser to the specified commit).

noseglid avatar Jul 18 '14 09:07 noseglid

I'll add a user setting for a custom remote name if origin fails. That should solve your problem right?

alexcorre avatar Jul 25 '14 00:07 alexcorre

Yep, that'd work fine. Thanks.

noseglid avatar Jul 25 '14 06:07 noseglid

Short term I will add this setting in the next day or two.

I have another question though...would this be across ALL your projects? Do you always have your main remote named 'gerrit'? Or is this only for a project here or there.

Long run I'm thinking this should be project specific. Having a discussion on how best to make this possible in #18 potentially using git config or git-blame for atom config that is checked into the project. Thoughts?

alexcorre avatar Jul 28 '14 06:07 alexcorre

The remote is not always named gerrit. There is also times where I have multiple remotes for the same project. Perhaps a way to specify which remote I want to use for blame? (In my case they are very often mirrors and blame would show same result regardless of which remote it used).

noseglid avatar Aug 09 '14 19:08 noseglid