Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

git calls in the tree/file-browser crash with ENOBUFS on large repos

Đang mở Phù hợp với người mới
#24 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
git, node.js, typescript
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu trong dist/index.js, tại các lệnh gọi git được getTreeEntries, getTreeFingerprint, git status --porcelain -u và git rev-parse --show-toplevel sử dụng. Tái hiện với một repository có các đường dẫn được theo dõi vượt quá 1 MB bằng git ls-files | wc -c, sau đó chạy diffity tree hoặc /api/tree. Hoàn tất khi các repository lớn không còn tạo ra ENOBUFS hoặc phản hồi 500.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What happens

Open diffity tree (or any tour view) on a large repo and the whole UI goes down with:

Something went wrong
Failed to get tree: Error: spawnSync git ENOBUFS

/api/tree returns a 500. Since the SPA surfaces that at the top level, views that don't even need the file tree (a code tour) go down with it too.

What I found

The git calls behind the file browser run through execFileSync("git", [...], { encoding: "utf-8" }) with no maxBuffer, so they get Node's 1 MB default. Once git ls-files prints more than 1 MB of paths, the call throws ENOBUFS. In 0.9.5's dist/index.js it's the git ls-files calls in getTreeEntries and getTreeFingerprint, the git status --porcelain -u, and the git rev-parse --show-toplevel calls.

How to reproduce

Any repo whose tracked paths exceed ~1 MB of text. Mine is a monorepo that vendors a few external repos as git subtrees, so git ls-files is ~14,300 files / 1.24 MB, just over the line. A large public repo would do the same.

git ls-files | wc -c   # > 1048576 reproduces it

Environment

  • diffity 0.9.5
  • node (system), macOS arm64
Ngôn ngữ chính
TypeScript
Star
775
Fork
57
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nilbuild/diffity

Tất cả issue của nilbuild/diffity

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.