[GH-ISSUE #394] AI code percentage and code line attribution #148

Open
opened 2026-03-02 04:12:18 +03:00 by kerem · 0 comments
Owner

Originally created by @harvest-L on GitHub (Jan 22, 2026).
Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/394

Environment

  • git-ai version: 1.0.37
  • OS: Windows
  • Git workflow: Multi-user collaboration scenario
  • Related issue: #355
  • git-ai configuration file:
{
  "git_path": "C:\\Program Files\\Git\\cmd\\git.exe",
  "feature_flags": {
    "checkpoint_inter_commit_move": true
  }
}

A Scenario

  1. Start with a clean git repository
  2. Configure git user as test-a:
    git config user.name test-a
    
  3. Create file hello.js with content:
    function hello() {console.log('hello')}
    
  4. Commit the code
  5. Switch git user to test-b:
    git config user.name test-b
    
  6. Run git-ai checkpoint
  7. Modify the code to:
    console.log('a')
    function hello() {
        console.log('hello')
    }
    console.log('b')
    
  8. Run git-ai checkpoint mock_ai
  9. Commit the code
  10. Check attribution with git-ai blame hello.js

Actual Result

  • The commit result shows the current user at 60%, AI at 40%
  • All three lines of the hello() function are attributed to test-b (current user)
  • git-ai blame shows the three lines of the function as test-b, losing test-a's contribution

Problem

This scenario simulates a real-world collaborative workflow where different users review and enhance each other's code with AI assistance. While git-ai correctly identifies that AI only added 2 lines, which is excellent.

However, from the perspective of a single commit's code percentage, this metric seems distorted. The user test-b did not actually contribute these three lines of code, which brings confusion to users. At the same time, from the dimension of statistical metrics and individual contribution perspective, it seems to reduce the true proportion of an individual using AI to generate code.

Originally created by @harvest-L on GitHub (Jan 22, 2026). Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/394 ## Environment - git-ai version: 1.0.37 - OS: Windows - Git workflow: Multi-user collaboration scenario - Related issue: #355 - git-ai configuration file: ```json { "git_path": "C:\\Program Files\\Git\\cmd\\git.exe", "feature_flags": { "checkpoint_inter_commit_move": true } } ``` ## A Scenario 1. Start with a clean git repository 2. Configure git user as `test-a`: ```bash git config user.name test-a ``` 3. Create file `hello.js` with content: ```javascript function hello() {console.log('hello')} ``` 4. Commit the code 5. Switch git user to `test-b`: ```bash git config user.name test-b ``` 6. Run `git-ai checkpoint` 7. Modify the code to: ```javascript console.log('a') function hello() { console.log('hello') } console.log('b') ``` 8. Run `git-ai checkpoint mock_ai` 9. Commit the code 10. Check attribution with `git-ai blame hello.js` ## Actual Result - The commit result shows the current user at 60%, AI at 40% - All three lines of the `hello()` function are attributed to `test-b` (current user) - `git-ai blame` shows the three lines of the function as `test-b`, losing `test-a`'s contribution ## Problem This scenario simulates a real-world collaborative workflow where different users review and enhance each other's code with AI assistance. While git-ai correctly identifies that AI only added 2 lines, which is excellent. However, from the perspective of a single commit's code percentage, this metric seems distorted. The user `test-b` did not actually contribute these three lines of code, which brings confusion to users. At the same time, from the dimension of statistical metrics and individual contribution perspective, it seems to reduce the true proportion of an individual using AI to generate code.
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#148
No description provided.