たとえば、 の.gitattributes
ファイルにlg2s
は次の行があります*.cs diff=csharp
。コードの出力
using (var repo = new Repository(@"path\to\lg2s"))
{
var tree1 = repo.Lookup<Commit>("a845db9").Tree;
var tree2 = repo.Lookup<Commit>("d677741").Tree;
var patches = repo.Diff.Compare<Patch>(tree1, tree2);
foreach (var patch in patches)
{
Console.WriteLine(patch.Patch);
}
}
は(まもなく)
diff --git a/LibGit2Sharp/RepositoryStatus.cs b/LibGit2Sharp/RepositoryStatus.cs
@@ -59,8 +59,8 @@ namespace LibGit2Sharp
しかし、の出力git bash
は(まもなく)
diff --git a/LibGit2Sharp/RepositoryStatus.cs b/LibGit2Sharp/RepositoryStatus.cs
@@ -59,8 +59,8 @@ internal RepositoryStatus(Repository repo, StatusOptions optio
2行目は同じではありません。
詳細な議論Add .gitattributes support
libgit2/#508があるように見えますが、PR Add APIs for git attributes
libgit2/#516はマージされていますか?
現在、サポートされている言語はいくつですか?
ファイルなしでルールを指定できgitattributes
ますか?