libgit2 / libgit2/libgit2sharp

.gitignore exclusions not being honoring correctly

オープン
#1,416 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
3.5k
フォーク
925
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello,

I am having an issue with inconsistent behavior when trying to exclude folders using a .gitignore. This issue is related to: https://github.com/git-tfs/git-tfs/issues/1047

Given the following repository directory:

/Main/.gitignore
/Main/Foo/test.txt
/Main/Foo/packages/test.txt
/Main/FooBar/test.txt
/Main/FooBar/packages/test.txt

And the following .gitignore file:

**/packages/*
!Foo/
!Foo/**

When I running the following code:

using (var repo = new Repository(@"C:\Git\Project\Main"))
{
	repo.RetrieveStatus().Untracked.Dump();
}

Then I get to following results:

.gitignore
Foo\test.txt
FooBar\test.txt

When I run git status -u
Then I get to following results:

.gitignore
Foo/packages/test.txt
Foo/test.txt
FooBar/test.txt

I have also tried populating the ignore rules manually using AddTemporaryRules with the same results.

Thanks!

Christopher Haws

git version 2.10.2.windows.1
LibGit2Sharp version 0.23.1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Repository.RetrieveStatus と、示されている入れ子になった .gitignore ルールを使って報告内容を再現し、その Untracked の結果を git status -u と比較します。また、AddTemporaryRules のパスも確認し、否定されたディレクトリルールによって Git と同じファイルが含まれるようになったら issue を完了とします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, git
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。