git-sizer can fail on some very long lines
評估
研究方向
首先,針對一個 git rev-list --objects 輸出包含極長行的儲存庫,使用 git-sizer --verbose 重現此故障。追蹤該輸出的讀取方式,並定義適當的處理方式,例如回報受影響的物件 ID;完成後應避免發生 bufio.Scanner: token too long 故障,並以測試涵蓋長行情況。
由索引模型根據 Issue 內容生成。
描述
On some repositories, we can get the following error:
% git-sizer --verbose
error: error scanning repository: copy-oids: bufio.Scanner: token too long
It appears that one of the lines from git rev-list --objects is too long to be read. In the (private) repository instance we saw, the line was 12583034 bytes in size. It is speculated that this is due to a very long filename or path.
git-sizer should handle this more gracefully, if only by printing the affected object ID. Perhaps an option could also be added to adjust the buffer size so that normally git-sizer would use fewer resources but it could be adjusted to deal with larger lines if need be.
- 主要語言
- Go
- 星號
- 4.1k
- 分支
- 202
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/git-sizer 的其他 Issue
-
Warehouse未關閉
難度 5/5 一週以上 新手友好度 10/100
-
難度 1/5 1 小時以內 新手友好度 10/100
-
難度 3/5 1-2 天 新手友好度 45/100
-
難度 5/5 一週以上 新手友好度 5/100
-
難度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
goose sub-agent runs are never indexed: blame finds no session for any file a `delegate` child wrote未關閉bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
triage
難度 2/5 1-3 小時 新手友好度 86/100
wakatime/wakatime-cli#1649 ·
維護者通常 1 天內回覆
-
PathBuffer.Pop corrupts later error locations when a key contains "." or "["可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
danielgtaylor/huma#1135 ·
維護者通常 1 天內回覆
-
needs-triage
難度 2/5 1-3 小時 新手友好度 68/100
stacklok/toolhive-catalog#1734 ·
維護者通常 1 天內回覆
-
documentation priority:p1
難度 2/5 1-3 小時 新手友好度 78/100
yeixio/toskar-core#697 ·
維護者通常 1 天內回覆