Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#24 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
git, node.js, typescript
領域
api, backend

調査の方向性

dist/index.js で、getTreeEntries、getTreeFingerprint、git status --porcelain -u、git rev-parse --show-toplevel が使用している git 呼び出しから始めます。git ls-files | wc -c を使って、追跡対象のパスが 1 MB を超えるリポジトリで再現し、その後 diffity tree または /api/tree を実行します。大規模なリポジトリで ENOBUFS や 500 レスポンスが発生しなくなれば完了です。

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

説明

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
主要言語
TypeScript
スター
775
フォーク
57
PR マージ指標
30日以内にマージされた PR はありません

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

nilbuild/diffity のほかの issue

nilbuild/diffity の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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