Discrepancy in line change counts reported by your library
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start by reproducing the reported discrepancy with the public IssueJgit commit comparison and inspect the listed Edit ranges alongside the DiffFormatter configuration. Compare JGit's added/deleted counts with Git's --numstat output for the same file and commit pair. The issue is resolved when the reported counts match the expected 58 added and 70 deleted lines.
索引モデルが issue の本文から書いたものです。
説明
Version
7.5.0.202512021534-r
Operating System
Windows
Bug description
I'm using this library to extract numerical values related to added and deleted lines within commits of a Bitbucket repository. To calculate these values I'm using:
linesAdded += edit.getEndB() - edit.getBeginB(); linesDeleted += edit.getEndA() - edit.getBeginA();
However, I notice that for some commits—fortunately just a few—the numbers I obtain are incorrect compared to what I should be getting.
Actual behavior
I have reproduced one of the problematic commits in a public repository. For copyright reasons, I am unable to share the original commit; however, you can review the reproduced version at the following link:
https://github.com/omucci/IssueJgit/compare/e106a4c2deb516d68d9647e7d8b1c0bf8fa66ef8...793db0271eb27394223ff338d2905fa3dd94e346.
As is evident, the commit shows 70 lines removed and 58 lines added. Nevertheless, the output produced by your library reports 50 lines inserted and 62 lines deleted.
This discrepancy suggests a potential issue in how line changes are computed or reported. I would appreciate your assistance in investigating this behavior.
For additional verification, I printed the edits of the hunk for that specific commit and obtained:
EditEditList[REPLACE(0-2,0-2), REPLACE(3-5,3-9), REPLACE(6-8,10-11), REPLACE(9-11,12-24), REPLACE(12-14,25-27), REPLACE(15-17,28-41), REPLACE(18-20,42-43), REPLACE(21-68,44-56), REPLACE(69-70,57-58)] Lines Added: 50 Lines Deleted: 62
My DiffFormatter is configured as follows:
try (DiffFormatter df = new DiffFormatter(DisabledOutputStream.INSTANCE)) {
df.setRepository(repo);
df.setDetectRenames(true);
df.getRenameDetector().setRenameScore(thresholdFileRename);
df.setDiffAlgorithm(DiffAlgorithm.getAlgorithm(DiffAlgorithm.SupportedAlgorithm.MYERS));
df.setDiffComparator(RawTextComparator.DEFAULT);
}
Expected behavior
I would expect the result to clearly indicate 70 lines removed and 58 added, exactly as reported by both the Git comparator and the Bitbucket diff tool.
git diff --numstat 793db0271eb27394223ff338d2905fa3dd94e346 e106a4c2deb516d68d9647e7d8b1c0bf8fa66ef8
70 58 src/main/resources/test.sql
Relevant log output
Other information
Public repo: https://github.com/omucci/IssueJgit
Git compare:https://github.com/omucci/IssueJgit/compare/e106a4c2deb516d68d9647e7d8b1c0bf8fa66ef8...793db0271eb27394223ff338d2905fa3dd94e346
- 主要言語
- Java
- スター
- 427
- フォーク
- 116
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eclipse-jgit/jgit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
eclipse-jgit/jgit#329 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
eclipse-jgit/jgit#327 ·
-
Repository.create(boolean bare) should provide a no-arg overload that uses isBare()再び着手できるかも @hardikyadav12 が 77 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
eclipse-jgit/jgit#297 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
eclipse-jgit/jgit#293 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
eclipse-jgit/jgit#288 ·
eclipse-jgit/jgit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
constellation-app/constellation#2613 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
Vakore/ZappierGames#334 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
IETF-Hackathon/pqc-certificates#369 ·
メンテナーはふだん 1 日以内に返信
-
? - Needs Triage bot_watch bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA/cudf-spark-jni#5594 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100