Github 语言统计中未排除的路径
Paths not excluded from Github language statistics
我已经阅读了相关的 SO 线程 here and here, as well as Github Linguist manual override,但我似乎无法从语言统计信息中排除一些顶级目录。
在当前的最新版本中,this repo 显示了 HTML 代码的优势。单击 HTML 详细信息,会列出两个 HTML 文件:
packages/NUnit.2.5.7.10213/NUnitFitTests.html
最后索引于 2016 年 12 月 30 日。
packages/NUnit.2.5.7.10213/Tools/NUnitFitTests.html
最后索引于 2016 年 12 月 30 日。
但那些应该是 .gitattributes
:
中排除路径的一部分
.nuget/* linguist-vendored
libs/* linguist-vendored
NUnit.Runners.2.6.4/* linguist-vendored
packages/* linguist-vendored §§ <--- this one in particular
RubyInstallationFiles/* linguist-vendored
但是在同一个详情页中,左下方的排名清楚地显示 HTML 处于较低的位置,而 C# 位于顶部:
我做错了什么?
附带问题: 在众多更改中,我还从 .gitattribute 文件中删除了评论,因为我无法从任何参考中找到这些评论是否被允许或其他内容。有谁知道你是否可以在那里发表评论?哪种格式? TA
您可以使用 git-check-attr
检查属性并验证它们是否按照您认为的方式设置。
$ git check-attr --all -- packages/NUnit.2.5.7.10213/NUnitFitTests.html
$
好像没有属性。问题似乎是 packages/*
不是递归的。
$ git check-attr --all -- packages/NUnit.2.5.7.10213/
packages/NUnit.2.5.7.10213/: linguist-vendored: set
那么模式的规则是什么?与 gitignore.
相同
The rules how the pattern matches paths are the same as in .gitignore files; see gitignore(5). Unlike .gitignore, negative patterns are forbidden.
您要查找的是/**
。
A trailing "/**" matches everything inside. For example, "abc/**" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth.
正在修复...
$ cat .gitattributes
.nuget/** linguist-vendored
libs/** linguist-vendored
NUnit.Runners.2.6.4/** linguist-vendored
packages/** linguist-vendored
RubyInstallationFiles/** linguist-vendored
现在我们好了。
$ git check-attr --all packages/NUnit.2.5.7.10213/NUnitFitTests.html
packages/NUnit.2.5.7.10213/NUnitFitTests.html: linguist-vendored: set
这也回答了你关于评论的问题...
A line starting with # serves as a comment. Put a backslash ("\") in front of the first hash for patterns that begin with a hash.
可能会发生几件事:
语言统计信息尚未更新语言检测作业运行作为低优先级后台作业。语言统计信息可能需要一些时间才能更新(最多一天)。
您遗漏了一些 HTML 个文件 显示每种语言的文件的搜索结果已缓存,并不总是最新的。因此,您的存储库中可能有一些 HTML 文件您忘记了供应商。
如何调试? 你最好的选择是 运行 本地语言学家。如果您有 working Ruby environment,这很简单:
gem install github-linguist
linguist /path/to/your/repository --breakdown
此命令将输出 Linguist 结果,其中包含为每种语言检测到的文件以及计算出的百分比。
注意:你的.gitattributes
语法是正确的,不需要双星号。 Linguist 路径末尾不需要双星号。但是,您可能需要它们匹配通配符路径开头的多个目录,例如:
**/NSpec/Domain/Formatters/Templates/*
我已经阅读了相关的 SO 线程 here and here, as well as Github Linguist manual override,但我似乎无法从语言统计信息中排除一些顶级目录。
在当前的最新版本中,this repo 显示了 HTML 代码的优势。单击 HTML 详细信息,会列出两个 HTML 文件:
packages/NUnit.2.5.7.10213/NUnitFitTests.html
最后索引于 2016 年 12 月 30 日。packages/NUnit.2.5.7.10213/Tools/NUnitFitTests.html
最后索引于 2016 年 12 月 30 日。
但那些应该是 .gitattributes
:
.nuget/* linguist-vendored
libs/* linguist-vendored
NUnit.Runners.2.6.4/* linguist-vendored
packages/* linguist-vendored §§ <--- this one in particular
RubyInstallationFiles/* linguist-vendored
但是在同一个详情页中,左下方的排名清楚地显示 HTML 处于较低的位置,而 C# 位于顶部:
我做错了什么?
附带问题: 在众多更改中,我还从 .gitattribute 文件中删除了评论,因为我无法从任何参考中找到这些评论是否被允许或其他内容。有谁知道你是否可以在那里发表评论?哪种格式? TA
您可以使用 git-check-attr
检查属性并验证它们是否按照您认为的方式设置。
$ git check-attr --all -- packages/NUnit.2.5.7.10213/NUnitFitTests.html
$
好像没有属性。问题似乎是 packages/*
不是递归的。
$ git check-attr --all -- packages/NUnit.2.5.7.10213/
packages/NUnit.2.5.7.10213/: linguist-vendored: set
那么模式的规则是什么?与 gitignore.
相同The rules how the pattern matches paths are the same as in .gitignore files; see gitignore(5). Unlike .gitignore, negative patterns are forbidden.
您要查找的是/**
。
A trailing "/**" matches everything inside. For example, "abc/**" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth.
正在修复...
$ cat .gitattributes
.nuget/** linguist-vendored
libs/** linguist-vendored
NUnit.Runners.2.6.4/** linguist-vendored
packages/** linguist-vendored
RubyInstallationFiles/** linguist-vendored
现在我们好了。
$ git check-attr --all packages/NUnit.2.5.7.10213/NUnitFitTests.html
packages/NUnit.2.5.7.10213/NUnitFitTests.html: linguist-vendored: set
这也回答了你关于评论的问题...
A line starting with # serves as a comment. Put a backslash ("\") in front of the first hash for patterns that begin with a hash.
可能会发生几件事:
语言统计信息尚未更新语言检测作业运行作为低优先级后台作业。语言统计信息可能需要一些时间才能更新(最多一天)。
您遗漏了一些 HTML 个文件 显示每种语言的文件的搜索结果已缓存,并不总是最新的。因此,您的存储库中可能有一些 HTML 文件您忘记了供应商。
如何调试? 你最好的选择是 运行 本地语言学家。如果您有 working Ruby environment,这很简单:
gem install github-linguist
linguist /path/to/your/repository --breakdown
此命令将输出 Linguist 结果,其中包含为每种语言检测到的文件以及计算出的百分比。
注意:你的.gitattributes
语法是正确的,不需要双星号。 Linguist 路径末尾不需要双星号。但是,您可能需要它们匹配通配符路径开头的多个目录,例如:
**/NSpec/Domain/Formatters/Templates/*