Closed modulitos closed 1 year ago
Hi @modulitos, thanks so much for your contribution and detailed explanation. Give me a week or so and I will review. Please follow-up if you don't hear back from me!
@sshaw Thank you for the review! I made some updates, per your feedback. I think you're right, that this is limited to only googlesource.com repos :)
Great thanks. Can you just squash into single commit?
@sshaw Done :+1:
Resolves: https://github.com/sshaw/git-link/issues/100(Update: this doesn't actually provide support for gitiles, and is limited to googelsource)Also adds support for the repos hosted by
googlesource.com
, which I believe are all using gitiles. Such as https://android.googlesource.com/ and https://go.googlesource.com/go I checked several projects under https://opensource.google/projects, and I believe all repos under thegooglesource.com
domain are using gitiles.Testing
I added a test to
git-link-test.el
to ensure the behavior ofgit-link--parse-remote-test
was correct.For the rest of the behavior, I ran the following tests manually, since I didn't see any existing automated tests (although it seems like the project can use some unit tests here):
git-link
I tested this by running
git-link
in several gitiles repos. The following value is copies to my clipboard:git-link-use-commit
set tot
: https://go.googlesource.com/go/+/38cfb3be9d486833456276777155980d1ec0823e/src/go/token/token.go#162git-link-use-commit
set tonil
(the default vaue): https://go.googlesource.com/go/+/master/src/go/token/token.go#162git-link-commit
I tested this by running
git-link-commit
over some code like// 38cfb3be9d486833456276777155980d1ec0823e
and got this: https://go.googlesource.com/go/+/38cfb3be9d486833456276777155980d1ec0823egit-link-homepage
Running
git-link-homepage
copies this to my clipboard: https://go.googlesource.com/go