Compare commits

...

23 Commits

Author SHA1 Message Date
Arfon Smith
f100dc91c2 Merge pull request #1588 from github/cache-bustin
Bust that cache
2014-10-16 14:21:33 -05:00
Arfon Smith
fd9d63d605 Removing beta label 2014-10-16 14:05:36 -05:00
Arfon Smith
5c21c35875 Merge branch 'master' into cache-bustin 2014-10-16 12:59:41 -05:00
Arfon Smith
370d55fd74 Merge pull request #1595 from github/text-html-ruby
Use TextMate 1 scope for HTML+ERB files
2014-10-15 17:05:08 -05:00
Arfon Smith
8dd2ddcbf7 CI 2014-10-14 20:18:32 -05:00
Arfon Smith
037857623d Merge branch 'master' into cache-bustin
Conflicts:
	lib/linguist/version.rb
2014-10-14 19:45:09 -05:00
Arfon Smith
d7b19d577b Bumping version 2014-10-14 19:44:35 -05:00
Adam Roben
c70048a3e2 Use TextMate 1 scope for HTML+ERB files
The TextMate 2 scope requires support for injection grammars, which some parsers don't support.
2014-10-14 14:19:05 -04:00
Arfon Smith
6d51117a91 Merge pull request #1593 from github/more-tmscopes
Add more TextMate scopes
2014-10-14 10:06:47 -05:00
Arfon Smith
848a1cc1e5 Minor bump 2014-10-14 10:06:38 -05:00
Adam Roben
9092dfdc7f Add a TextMate scope for Literate CoffeeScript 2014-10-14 10:50:39 -04:00
Adam Roben
d7fe0cc5c7 Add TextMate scopes for HTML variants 2014-10-14 10:41:19 -04:00
Adam Roben
15ec37d4bc Add a TextMate scope for Objective-C++ 2014-10-14 10:41:19 -04:00
Adam Roben
43cc701ac3 Add a TextMate scope for JSON 2014-10-14 10:41:19 -04:00
Adam Roben
7cb8357f73 Add a TextMate scope for YAML 2014-10-14 10:41:19 -04:00
Adam Roben
4b46bcf649 Add TextMate scopes for Sass/SCSS files 2014-10-14 10:41:19 -04:00
Arfon Smith
a954a6465e Update README.md 2014-10-14 09:29:45 -05:00
Arfon Smith
b8a5e8505a Merge branch 'vmg/tmscopes' into cache-bustin
Conflicts:
	lib/linguist/version.rb
2014-10-13 20:21:31 -05:00
Arfon Smith
3087d640a3 3.2.2b1 2014-10-13 19:33:03 -05:00
Arfon Smith
e87b89ab5b Removing todo 2014-10-13 18:52:27 -05:00
Arfon Smith
7aabc6a5ad A different approach 2014-10-13 17:01:53 -05:00
Arfon Smith
5cc053694a Remove pry 2014-10-13 16:38:51 -05:00
Arfon Smith
653314448c Bust that cache 2014-10-13 16:37:46 -05:00
5 changed files with 33 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ The repository stats API, accessed through `#languages`, can be used on a direct
***API UPDATE*** ***API UPDATE***
Since [Version 3.0.0](https://github.com/github/linguist/releases/tag/v3.0.0) Linguist requires a git repository (in the form of a [Rugged::Repository](https://github.com/libgit2/rugged#repositories)) to be passed when initializing `Linguist::Repository`. Since [Version 3.0.0](https://github.com/github/linguist/releases/tag/v3.0.0) Linguist expects a git repository (in the form of a [Rugged::Repository](https://github.com/libgit2/rugged#repositories)) to be passed when initializing `Linguist::Repository`.
```ruby ```ruby
@@ -165,7 +165,7 @@ If you are the current maintainer of this gem:
0. Ensure that tests are green: `bundle exec rake test` 0. Ensure that tests are green: `bundle exec rake test`
0. Bump gem version in `lib/linguist/version.rb`. For example, [like this](https://github.com/github/linguist/commit/8d2ea90a5ba3b2fe6e1508b7155aa4632eea2985). 0. Bump gem version in `lib/linguist/version.rb`. For example, [like this](https://github.com/github/linguist/commit/8d2ea90a5ba3b2fe6e1508b7155aa4632eea2985).
0. Make a PR to github/linguist. For example, [#1238](https://github.com/github/linguist/pull/1238). 0. Make a PR to github/linguist. For example, [#1238](https://github.com/github/linguist/pull/1238).
0. Build a local gem: `gem build github-linguist.gemspec` 0. Build a local gem: `bundle exec rake build_gem`
0. Testing: 0. Testing:
0. Bump the Gemfile and Gemfile.lock versions for an app which relies on this gem 0. Bump the Gemfile and Gemfile.lock versions for an app which relies on this gem
0. Install the new gem locally 0. Install the new gem locally

View File

@@ -949,6 +949,7 @@ HTML:
HTML+Django: HTML+Django:
type: markup type: markup
tm_scope: text.html.django
group: HTML group: HTML
lexer: HTML+Django/Jinja lexer: HTML+Django/Jinja
extensions: extensions:
@@ -957,6 +958,7 @@ HTML+Django:
HTML+ERB: HTML+ERB:
type: markup type: markup
tm_scope: text.html.ruby
group: HTML group: HTML
lexer: RHTML lexer: RHTML
aliases: aliases:
@@ -967,6 +969,7 @@ HTML+ERB:
HTML+PHP: HTML+PHP:
type: markup type: markup
tm_scope: text.html.php
group: HTML group: HTML
extensions: extensions:
- .phtml - .phtml
@@ -1102,6 +1105,7 @@ J:
JSON: JSON:
type: data type: data
tm_scope: source.json
group: JavaScript group: JavaScript
ace_mode: json ace_mode: json
searchable: false searchable: false
@@ -1293,6 +1297,7 @@ Literate Agda:
Literate CoffeeScript: Literate CoffeeScript:
type: programming type: programming
tm_scope: source.litcoffee
group: CoffeeScript group: CoffeeScript
lexer: Text only lexer: Text only
ace_mode: markdown ace_mode: markdown
@@ -1587,6 +1592,7 @@ Objective-C:
Objective-C++: Objective-C++:
type: programming type: programming
tm_scope: source.objc++
color: "#4886FC" color: "#4886FC"
aliases: aliases:
- obj-c++ - obj-c++
@@ -2084,6 +2090,7 @@ SAS:
SCSS: SCSS:
type: markup type: markup
tm_scope: source.scss
group: CSS group: CSS
ace_mode: scss ace_mode: scss
extensions: extensions:
@@ -2124,6 +2131,7 @@ Sage:
Sass: Sass:
type: markup type: markup
tm_scope: source.sass
group: CSS group: CSS
extensions: extensions:
- .sass - .sass
@@ -2598,6 +2606,7 @@ Xtend:
YAML: YAML:
type: data type: data
tm_scope: source.yaml
aliases: aliases:
- yml - yml
extensions: extensions:

View File

@@ -128,13 +128,20 @@ module Linguist
protected protected
def compute_stats(old_commit_oid, cache = nil) def compute_stats(old_commit_oid, cache = nil)
file_map = cache ? cache.dup : {}
old_tree = old_commit_oid && Rugged::Commit.lookup(repository, old_commit_oid).tree old_tree = old_commit_oid && Rugged::Commit.lookup(repository, old_commit_oid).tree
read_index read_index
diff = Rugged::Tree.diff(repository, old_tree, current_tree) diff = Rugged::Tree.diff(repository, old_tree, current_tree)
# Clear file map and fetch full diff if any .gitattributes files are changed
if cache && diff.each_delta.any? { |delta| File.basename(delta.new_file[:path]) == ".gitattributes" }
diff = Rugged::Tree.diff(repository, old_tree = nil, current_tree)
file_map = {}
else
file_map = cache ? cache.dup : {}
end
diff.each_delta do |delta| diff.each_delta do |delta|
old = delta.old_file[:path] old = delta.old_file[:path]
new = delta.new_file[:path] new = delta.new_file[:path]

View File

@@ -1,3 +1,3 @@
module Linguist module Linguist
VERSION = "3.3.0" VERSION = "3.4.0"
end end

View File

@@ -68,6 +68,19 @@ class TestRepository < Test::Unit::TestCase
assert !repo.breakdown_by_file["Ruby"].empty? assert !repo.breakdown_by_file["Ruby"].empty?
end end
def test_commit_with_git_attributes_data
# Before we had any .gitattributes data
old_commit = '4a017d9033f91b2776eb85275463f9613cc371ef'
old_repo = linguist_repo(old_commit)
# With some .gitattributes data
attr_commit = '7ee006cbcb2d7261f9e648510a684ee9ac64126b'
# It's incremental but should bust the cache
new_repo = Linguist::Repository.incremental(rugged_repository, attr_commit, old_commit, old_repo.cache)
assert new_repo.breakdown_by_file["Java"].include?("lib/linguist.rb")
end
def test_linguist_override_vendored? def test_linguist_override_vendored?
attr_commit = '351c1cc8fd57340839bdb400d7812332af80e9bd' attr_commit = '351c1cc8fd57340839bdb400d7812332af80e9bd'
repo = linguist_repo(attr_commit).read_index repo = linguist_repo(attr_commit).read_index