Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Conversation

alekstorm
Copy link
Contributor

Apologies if the new testing logic is a bit clumsy; this was the best method I could figure out.

models/commit.rb Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow_ambiguous_match I think is clearer, but in any case, this param could use a description in the method-level comment.

@philc
Copy link
Contributor

philc commented Dec 29, 2012

Very nice feature Alek. My only concern would be that it results in many more sha lookups, but for small bodies of text that shouldn't matter.

As soon as you can take care of a few of the code review comments, I'll merge this in. Looking forward to it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shas coming from git tools are always lowercase, so we could remove A-Z in that character class if we want it to match fewer things. Although the git tooling handles uppercase shas.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do that, but it sounds like a premature optimization, especially since git handles uppercase shas.

@alekstorm
Copy link
Contributor Author

Fixed in 9bf9e89.

@alekstorm
Copy link
Contributor Author

If the sha lookups start to hurt, we can start caching pre-filtered comment text in Redis (although preferably only for older comments, since newer ones sometimes reference commits that haven't been pushed yet), or add an index on the commits.sha column.

@cespare
Copy link
Contributor

cespare commented Feb 14, 2013

Nice feature. Just got another request for this today. I'm ready to merge after we confirm my inline comment.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants