[GH-ISSUE #17] Overlapping/intersecting line ranges cause incorrect line counts #5

Closed
opened 2026-03-02 04:11:12 +03:00 by kerem · 1 comment
Owner

Originally created by @jalalatlassian on GitHub (Sep 2, 2025).
Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/17

Problem
When git-ai returns overlapping or intersecting line ranges (e.g., [44,44] and [44,55]), the total line count calculation becomes incorrect due to double-counting.

Example

  • Line ranges: [44,44] and [44,55]
  • Expected total: 12 lines (44-55 inclusive)
  • Current behavior: May count line 44 twice

Expected Behavior
Overlapping ranges should be merged or handled to avoid double-counting lines.

Current Behavior
Line ranges can overlap or intersect, leading to inflated line counts when ranges are processed independently.

Impact

  • Leads to inflated line counts and inaccurate contribution metrics
  • Makes it difficult to calculate accurate lines of code statistics
  • Affects analytics and reporting based on git-ai data

Additional Context
This issue particularly affects scenarios where line ranges have intersections like [44,44] followed by [44,55], where line 44 gets counted multiple times.

Originally created by @jalalatlassian on GitHub (Sep 2, 2025). Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/17 **Problem** When git-ai returns overlapping or intersecting line ranges (e.g., `[44,44]` and `[44,55]`), the total line count calculation becomes incorrect due to double-counting. **Example** - Line ranges: `[44,44]` and `[44,55]` - Expected total: 12 lines (44-55 inclusive) - Current behavior: May count line 44 twice **Expected Behavior** Overlapping ranges should be merged or handled to avoid double-counting lines. **Current Behavior** Line ranges can overlap or intersect, leading to inflated line counts when ranges are processed independently. **Impact** - Leads to inflated line counts and inaccurate contribution metrics - Makes it difficult to calculate accurate lines of code statistics - Affects analytics and reporting based on git-ai data **Additional Context** This issue particularly affects scenarios where line ranges have intersections like `[44,44]` followed by `[44,55]`, where line 44 gets counted multiple times.
kerem closed this issue 2026-03-02 04:11:12 +03:00
Author
Owner

@acunniffe commented on GitHub (Sep 3, 2025):

Confirming this is seen when using stats_delta command? Probably an issue with the merging of multiple authorship logs

<!-- gh-comment-id:3249403604 --> @acunniffe commented on GitHub (Sep 3, 2025): Confirming this is seen when using `stats_delta` command? Probably an issue with the merging of multiple authorship logs
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#5
No description provided.