Skip to content

Commit 88f7f47

Browse files
committed
gitignores: add own implementation and stop using libgit2's
This is to address issue #8. I haven't added the optimization to avoid walking all the files in `target/` yet. Even so, this patch still speeds up `jj st` in this repo, with ~13k files in `target/`, from ~320 ms to ~100 ms (-5.1dB). The time actually checking if paths match gitignores seems to go down from 116 ms to 6 ms. I think that's mostly because libgit2 has to look for `.gitignore` files in every parent directory every time we ask it about a file, while the rewritten code looks for a `.gitignore` file only when visiting a new directory.
1 parent 31eff96 commit 88f7f47

File tree

5 files changed

+467
-44
lines changed

5 files changed

+467
-44
lines changed

Cargo.lock

+9-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pest = "2.1.3"
3030
pest_derive = "2.1.0"
3131
protobuf = { version = "2.22.1", features = ["with-bytes"] }
3232
rand = "0.8.0"
33+
regex = "1.5.4"
3334
serde_json = "1.0.60"
3435
tempfile = "3.1.0"
3536
thiserror = "1.0.22"

0 commit comments

Comments
 (0)