[GH-ISSUE #169] Authorship Tracking Lost When Commit is Reset and Recommitted #66

Closed
opened 2026-03-02 04:11:35 +03:00 by kerem · 9 comments
Owner

Originally created by @AtnesNess on GitHub (Oct 29, 2025).
Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/169

Version

git-ai 1.0.10

Summary

When a commit with AI-generated code is reset (e.g., git reset --soft HEAD~1) and then recommitted, the AI authorship tracking is completely lost. The recommitted code is attributed to the human author instead of preserving the original AI authorship.

Steps to Reproduce

  1. Create a commit with AI-generated code:
# AI generates code
cat > module.py <<EOF
def function():
    print("AI generated")
    return 1
EOF

git-ai checkpoint mock_ai module.py
git add module.py
git commit -m "AI creates module.py"
  1. Verify AI authorship is tracked:
git-ai stats HEAD
# Shows: ai_additions: 3, human_additions: 0
  1. Reset the commit (soft reset to keep staged files):
git reset --soft HEAD~1
  1. Recommit the same changes:
git commit -m "AI creates module.py (recommitted)"
  1. Check authorship again:
git-ai stats HEAD
# Shows: human_additions: 3, ai_additions: 0  ❌

Expected Behavior

The authorship tracking should persist after reset and recommit. The recommitted code should still show:

{
  "ai_additions": 3,
  "human_additions": 0,
  "tool_model_breakdown": {
    "mock_ai::unknown": {
      "ai_additions": 3
    }
  }
}

Actual Behavior

After reset and recommit, all AI authorship is lost:

{
  "ai_additions": 0,
  "human_additions": 3,
  "tool_model_breakdown": {}
}

Environment

  • OS: Linux 6.8.0-1040-aws
  • Shell: zsh
  • git version 2.51.1
  • git-ai version: 1.0.10
Originally created by @AtnesNess on GitHub (Oct 29, 2025). Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/169 ## Version git-ai 1.0.10 ## Summary When a commit with AI-generated code is reset (e.g., `git reset --soft HEAD~1`) and then recommitted, the AI authorship tracking is completely lost. The recommitted code is attributed to the human author instead of preserving the original AI authorship. ## Steps to Reproduce 1. Create a commit with AI-generated code: ```bash # AI generates code cat > module.py <<EOF def function(): print("AI generated") return 1 EOF git-ai checkpoint mock_ai module.py git add module.py git commit -m "AI creates module.py" ``` 2. Verify AI authorship is tracked: ```bash git-ai stats HEAD # Shows: ai_additions: 3, human_additions: 0 ``` 3. Reset the commit (soft reset to keep staged files): ```bash git reset --soft HEAD~1 ``` 4. Recommit the same changes: ```bash git commit -m "AI creates module.py (recommitted)" ``` 5. Check authorship again: ```bash git-ai stats HEAD # Shows: human_additions: 3, ai_additions: 0 ❌ ``` ## Expected Behavior The authorship tracking should persist after reset and recommit. The recommitted code should still show: ```json { "ai_additions": 3, "human_additions": 0, "tool_model_breakdown": { "mock_ai::unknown": { "ai_additions": 3 } } } ``` ## Actual Behavior After reset and recommit, all AI authorship is lost: ```json { "ai_additions": 0, "human_additions": 3, "tool_model_breakdown": {} } ``` ## Environment - OS: Linux 6.8.0-1040-aws - Shell: zsh - git version 2.51.1 - git-ai version: 1.0.10
kerem closed this issue 2026-03-02 04:11:35 +03:00
Author
Owner

@mm-zacharydavison commented on GitHub (Oct 29, 2025):

I believe this is fixed in latest main branch, here's the test.

<!-- gh-comment-id:3463972073 --> @mm-zacharydavison commented on GitHub (Oct 29, 2025): I believe this is fixed in latest `main` branch, here's the [test](https://github.com/acunniffe/git-ai/blob/d70dcc625abd9d0d22f74165ae95ba44958b26d5/tests/reset.rs#L40).
Author
Owner

@AtnesNess commented on GitHub (Oct 29, 2025):

I'm using version 1.0.10 which should have that logic implemented. However, it doesn't seem to work well

<!-- gh-comment-id:3464961528 --> @AtnesNess commented on GitHub (Oct 29, 2025): I'm using version 1.0.10 which should have that logic implemented. However, it doesn't seem to work well
Author
Owner

@mm-zacharydavison commented on GitHub (Oct 30, 2025):

you're right, it does look like that's there.
I tried to reproduce your report with an integration test and couldn't, I wonder if it's something else about your repository / environment.

Can you provide a repo that reproduces the issue?

<!-- gh-comment-id:3467220167 --> @mm-zacharydavison commented on GitHub (Oct 30, 2025): you're right, it does look like that's there. I tried to reproduce your report with an integration test and couldn't, I wonder if it's something else about your repository / environment. Can you provide a repo that reproduces the issue?
Author
Owner

@AtnesNess commented on GitHub (Oct 30, 2025):

You can reproduce it in any local repo. Here is a bash script to reproduce the steps.

> git-ai -v
1.0.10
#!/bin/bash
set -e

# Script to reproduce git-ai issue #169
# Two AI commits, reset last commit, then recommit
# Tests whether AI attribution is preserved after reset/recommit

echo "==================================================================="
echo "git-ai Issue #169: Reset and Recommit Attribution Bug"
echo "==================================================================="
echo ""

# Check if git-ai is available
if ! command -v git-ai &> /dev/null; then
    echo "ERROR: git-ai not found in PATH"
    echo "Please ensure git-ai is installed and in your PATH"
    exit 1
fi

# Create a temporary directory for reproduction
REPRO_DIR=$(mktemp -d)
echo "Creating clean repository in: $REPRO_DIR"
cd "$REPRO_DIR"

# Initialize git repository
echo ""
echo "Step 1: Initializing git repository..."
git init
git config user.email "test@example.com"
git config user.name "Test User"

# Create initial commit
echo "# Test Project" > README.md
git add README.md
git commit -m "Initial commit"

# COMMIT 1: AI creates first file
echo ""
echo "Step 2: Creating Commit 1 - AI creates module1.py..."
cat > module1.py <<'EOF'
def function_one():
    print("AI generated function 1")
    return 1
EOF

git-ai checkpoint mock_ai module1.py
git add module1.py
git commit -m "Commit 1: AI creates module1.py"

commit1_sha=$(git rev-parse HEAD)
echo "  Commit 1 SHA: $commit1_sha"

echo "=== Blame for module1.py ==="
blame1=$(git-ai blame module1.py)
echo "$blame1"

# Get stats for commit 1
echo ""
echo "Step 3: Checking Commit 1 stats..."
stats_commit1=$(git-ai stats "$commit1_sha" --json 2>&1 | grep '^{')
echo "$stats_commit1" | jq '.' 2>/dev/null || echo "$stats_commit1"

# COMMIT 2: AI creates second file
echo ""
echo "Step 4: Creating Commit 2 - AI creates module2.py..."
cat > module2.py <<'EOF'
def function_two():
    print("AI generated function 2")
    return 2
def helper():
    return "helper"
EOF

git-ai checkpoint mock_ai module2.py
git add module2.py
git commit -m "Commit 2: AI creates module2.py"


commit2_sha=$(git rev-parse HEAD)
echo "  Commit 2 SHA: $commit2_sha"

echo "=== Blame for module2.py ==="
blame1=$(git-ai blame module2.py)
echo "$blame1"


# Get stats for commit 2 (before reset)
echo ""
echo "Step 5: Checking Commit 2 stats (BEFORE reset)..."
stats_commit2_before=$(git-ai stats "$commit2_sha" --json 2>&1 | grep '^{')
echo "$stats_commit2_before" | jq '.' 2>/dev/null || echo "$stats_commit2_before"

# RESET: Reset the last commit
echo ""
echo "Step 6: Resetting last commit (soft reset)..."
git reset --soft HEAD~1

current_sha=$(git rev-parse HEAD)
echo "  Current HEAD: $current_sha"
echo "  Should match Commit 1: $commit1_sha"

if [ "$current_sha" = "$commit1_sha" ]; then
    echo "  ✓ HEAD is back at Commit 1"
else
    echo "  ✗ ERROR: HEAD should be at Commit 1"
fi

echo ""
echo "  Git status after reset:"
git status --short

# RECOMMIT: Commit the changes again
echo ""
echo "Step 7: Recommitting the changes..."
git commit -m "Commit 2 (recommitted): AI creates module2.py"

commit2_new_sha=$(git rev-parse HEAD)
echo "  New Commit 2 SHA: $commit2_new_sha"

# Get stats for the recommitted commit
echo ""
echo "Step 8: Checking Commit 2 stats (AFTER reset and recommit)..."
stats_commit2_after=$(git-ai stats "$commit2_new_sha" --json 2>&1 | grep '^{')
echo "$stats_commit2_after" | jq '.' 2>/dev/null || echo "$stats_commit2_after"

# Check blame for both files
echo ""
echo "Step 9: Checking blame outputs..."
echo ""
echo "=== Blame for module1.py ==="
blame1=$(git-ai blame module1.py)
echo "$blame1"

echo ""
echo "=== Blame for module2.py ==="
blame2=$(git-ai blame module2.py)
echo "$blame2"

# Verify results
echo ""
echo "==================================================================="
echo "VERIFICATION"
echo "==================================================================="
echo ""

# Check if attribution is preserved
if echo "$stats_commit2_before" | grep -q '"ai_additions":5'; then
    echo "✅ PASS: Commit 2 (before reset) shows ai_additions: 5"
else
    echo "❌ FAIL: Commit 2 (before reset) does NOT show ai_additions: 5"
    ai_add_before=$(echo "$stats_commit2_before" | grep -o '"ai_additions":[0-9]*' || echo "not found")
    echo "   Actual: $ai_add_before"
fi

if echo "$stats_commit2_after" | grep -q '"ai_additions":5'; then
    echo "✅ PASS: Commit 2 (after recommit) shows ai_additions: 5"
else
    echo "❌ FAIL: Commit 2 (after recommit) does NOT show ai_additions: 5"
    ai_add_after=$(echo "$stats_commit2_after" | grep -o '"ai_additions":[0-9]*' || echo "not found")
    echo "   Actual: $ai_add_after"
fi

if echo "$blame1" | grep -q "mock_ai"; then
    echo "✅ PASS: module1.py shows mock_ai attribution"
else
    echo "❌ FAIL: module1.py does NOT show mock_ai attribution"
fi

if echo "$blame2" | grep -q "mock_ai"; then
    echo "✅ PASS: module2.py shows mock_ai attribution"
else
    echo "❌ FAIL: module2.py does NOT show mock_ai attribution"
fi

echo ""
echo "==================================================================="
echo "Repository Location: $REPRO_DIR"
echo "==================================================================="



<!-- gh-comment-id:3469911237 --> @AtnesNess commented on GitHub (Oct 30, 2025): You can reproduce it in any local repo. Here is a bash script to reproduce the steps. ``` > git-ai -v 1.0.10 ``` ``` #!/bin/bash set -e # Script to reproduce git-ai issue #169 # Two AI commits, reset last commit, then recommit # Tests whether AI attribution is preserved after reset/recommit echo "===================================================================" echo "git-ai Issue #169: Reset and Recommit Attribution Bug" echo "===================================================================" echo "" # Check if git-ai is available if ! command -v git-ai &> /dev/null; then echo "ERROR: git-ai not found in PATH" echo "Please ensure git-ai is installed and in your PATH" exit 1 fi # Create a temporary directory for reproduction REPRO_DIR=$(mktemp -d) echo "Creating clean repository in: $REPRO_DIR" cd "$REPRO_DIR" # Initialize git repository echo "" echo "Step 1: Initializing git repository..." git init git config user.email "test@example.com" git config user.name "Test User" # Create initial commit echo "# Test Project" > README.md git add README.md git commit -m "Initial commit" # COMMIT 1: AI creates first file echo "" echo "Step 2: Creating Commit 1 - AI creates module1.py..." cat > module1.py <<'EOF' def function_one(): print("AI generated function 1") return 1 EOF git-ai checkpoint mock_ai module1.py git add module1.py git commit -m "Commit 1: AI creates module1.py" commit1_sha=$(git rev-parse HEAD) echo " Commit 1 SHA: $commit1_sha" echo "=== Blame for module1.py ===" blame1=$(git-ai blame module1.py) echo "$blame1" # Get stats for commit 1 echo "" echo "Step 3: Checking Commit 1 stats..." stats_commit1=$(git-ai stats "$commit1_sha" --json 2>&1 | grep '^{') echo "$stats_commit1" | jq '.' 2>/dev/null || echo "$stats_commit1" # COMMIT 2: AI creates second file echo "" echo "Step 4: Creating Commit 2 - AI creates module2.py..." cat > module2.py <<'EOF' def function_two(): print("AI generated function 2") return 2 def helper(): return "helper" EOF git-ai checkpoint mock_ai module2.py git add module2.py git commit -m "Commit 2: AI creates module2.py" commit2_sha=$(git rev-parse HEAD) echo " Commit 2 SHA: $commit2_sha" echo "=== Blame for module2.py ===" blame1=$(git-ai blame module2.py) echo "$blame1" # Get stats for commit 2 (before reset) echo "" echo "Step 5: Checking Commit 2 stats (BEFORE reset)..." stats_commit2_before=$(git-ai stats "$commit2_sha" --json 2>&1 | grep '^{') echo "$stats_commit2_before" | jq '.' 2>/dev/null || echo "$stats_commit2_before" # RESET: Reset the last commit echo "" echo "Step 6: Resetting last commit (soft reset)..." git reset --soft HEAD~1 current_sha=$(git rev-parse HEAD) echo " Current HEAD: $current_sha" echo " Should match Commit 1: $commit1_sha" if [ "$current_sha" = "$commit1_sha" ]; then echo " ✓ HEAD is back at Commit 1" else echo " ✗ ERROR: HEAD should be at Commit 1" fi echo "" echo " Git status after reset:" git status --short # RECOMMIT: Commit the changes again echo "" echo "Step 7: Recommitting the changes..." git commit -m "Commit 2 (recommitted): AI creates module2.py" commit2_new_sha=$(git rev-parse HEAD) echo " New Commit 2 SHA: $commit2_new_sha" # Get stats for the recommitted commit echo "" echo "Step 8: Checking Commit 2 stats (AFTER reset and recommit)..." stats_commit2_after=$(git-ai stats "$commit2_new_sha" --json 2>&1 | grep '^{') echo "$stats_commit2_after" | jq '.' 2>/dev/null || echo "$stats_commit2_after" # Check blame for both files echo "" echo "Step 9: Checking blame outputs..." echo "" echo "=== Blame for module1.py ===" blame1=$(git-ai blame module1.py) echo "$blame1" echo "" echo "=== Blame for module2.py ===" blame2=$(git-ai blame module2.py) echo "$blame2" # Verify results echo "" echo "===================================================================" echo "VERIFICATION" echo "===================================================================" echo "" # Check if attribution is preserved if echo "$stats_commit2_before" | grep -q '"ai_additions":5'; then echo "✅ PASS: Commit 2 (before reset) shows ai_additions: 5" else echo "❌ FAIL: Commit 2 (before reset) does NOT show ai_additions: 5" ai_add_before=$(echo "$stats_commit2_before" | grep -o '"ai_additions":[0-9]*' || echo "not found") echo " Actual: $ai_add_before" fi if echo "$stats_commit2_after" | grep -q '"ai_additions":5'; then echo "✅ PASS: Commit 2 (after recommit) shows ai_additions: 5" else echo "❌ FAIL: Commit 2 (after recommit) does NOT show ai_additions: 5" ai_add_after=$(echo "$stats_commit2_after" | grep -o '"ai_additions":[0-9]*' || echo "not found") echo " Actual: $ai_add_after" fi if echo "$blame1" | grep -q "mock_ai"; then echo "✅ PASS: module1.py shows mock_ai attribution" else echo "❌ FAIL: module1.py does NOT show mock_ai attribution" fi if echo "$blame2" | grep -q "mock_ai"; then echo "✅ PASS: module2.py shows mock_ai attribution" else echo "❌ FAIL: module2.py does NOT show mock_ai attribution" fi echo "" echo "===================================================================" echo "Repository Location: $REPRO_DIR" echo "===================================================================" ```
Author
Owner

@svarlamov commented on GitHub (Nov 1, 2025):

Thank you for the report and test shell script!

Image

Confirming that this is fixed in 1.0.13

<!-- gh-comment-id:3475730163 --> @svarlamov commented on GitHub (Nov 1, 2025): Thank you for the report and test shell script! <img width="635" height="228" alt="Image" src="https://github.com/user-attachments/assets/fe6242ca-20e3-44d5-b0f5-61050bb54014" /> Confirming that this is fixed in 1.0.13
Author
Owner

@AtnesNess commented on GitHub (Nov 3, 2025):

1.0.13
bash test.sh
===================================================================
git-ai Issue #169: Reset and Recommit Attribution Bug
===================================================================

Creating clean repository in: /tmp/tmp.5kDP4F9Ru7

Step 1: Initializing git repository...
Initialized empty Git repository in /tmp/tmp.5kDP4F9Ru7/.git/
[main (root-commit) 411436b] Initial commit
 1 file changed, 1 insertion(+)
 create mode 100644 README.md
you  ████████████████████████████████████████ ai
     100%                                   0%

Step 2: Creating Commit 1 - AI creates module1.py...
ai_agent mock_ai changed 1 file(s) that have changed since the last commit
[main 978970a] Commit 1: AI creates module1.py
 1 file changed, 3 insertions(+)
 create mode 100644 module1.py
you  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ai
     0%                                  100%
     100% AI code accepted
  Commit 1 SHA: 978970a74cb9076914738fee75e5eab9630a3c0c
=== Blame for module1.py ===
978970a (mock_ai 2025-11-03 20:21:26 +0000 1) def function_one():
978970a (mock_ai 2025-11-03 20:21:26 +0000 2)     print("AI generated function 1")
978970a (mock_ai 2025-11-03 20:21:26 +0000 3)     return 1

Step 3: Checking Commit 1 stats...
{
  "human_additions": 0,
  "mixed_additions": 0,
  "ai_additions": 3,
  "ai_accepted": 3,
  "total_ai_additions": 3,
  "total_ai_deletions": 0,
  "time_waiting_for_ai": 0,
  "git_diff_deleted_lines": 0,
  "git_diff_added_lines": 3,
  "tool_model_breakdown": {
    "mock_ai::unknown": {
      "ai_additions": 3,
      "mixed_additions": 0,
      "ai_accepted": 3,
      "total_ai_additions": 3,
      "total_ai_deletions": 0,
      "time_waiting_for_ai": 0
    }
  }
}

Step 4: Creating Commit 2 - AI creates module2.py...
ai_agent mock_ai changed 1 file(s) that have changed since the last commit
[main 56be14f] Commit 2: AI creates module2.py
 1 file changed, 5 insertions(+)
 create mode 100644 module2.py
you  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ai
     0%                                  100%
     100% AI code accepted
  Commit 2 SHA: 56be14fde11e38cec1c2d3f8d953471467abbad6
=== Blame for module2.py ===
56be14f (mock_ai 2025-11-03 20:21:26 +0000 1) def function_two():
56be14f (mock_ai 2025-11-03 20:21:26 +0000 2)     print("AI generated function 2")
56be14f (mock_ai 2025-11-03 20:21:26 +0000 3)     return 2
56be14f (mock_ai 2025-11-03 20:21:26 +0000 4) def helper():
56be14f (mock_ai 2025-11-03 20:21:26 +0000 5)     return "helper"

Step 5: Checking Commit 2 stats (BEFORE reset)...
{
  "human_additions": 0,
  "mixed_additions": 0,
  "ai_additions": 5,
  "ai_accepted": 5,
  "total_ai_additions": 5,
  "total_ai_deletions": 0,
  "time_waiting_for_ai": 0,
  "git_diff_deleted_lines": 0,
  "git_diff_added_lines": 5,
  "tool_model_breakdown": {
    "mock_ai::unknown": {
      "ai_additions": 5,
      "mixed_additions": 0,
      "ai_accepted": 5,
      "total_ai_additions": 5,
      "total_ai_deletions": 0,
      "time_waiting_for_ai": 0
    }
  }
}

Step 6: Resetting last commit (soft reset)...
  Current HEAD: 978970a74cb9076914738fee75e5eab9630a3c0c
  Should match Commit 1: 978970a74cb9076914738fee75e5eab9630a3c0c
  ✓ HEAD is back at Commit 1

  Git status after reset:
A  module2.py

Step 7: Recommitting the changes...
[main 38355ad] Commit 2 (recommitted): AI creates module2.py
 1 file changed, 5 insertions(+)
 create mode 100644 module2.py
you  ████████████████████████████████████████ ai
     100%                                   0%
  New Commit 2 SHA: 38355ad343d0435d320b29f9a5d587203a579ef4

Step 8: Checking Commit 2 stats (AFTER reset and recommit)...
{
  "human_additions": 5,
  "mixed_additions": 0,
  "ai_additions": 0,
  "ai_accepted": 0,
  "total_ai_additions": 0,
  "total_ai_deletions": 0,
  "time_waiting_for_ai": 0,
  "git_diff_deleted_lines": 0,
  "git_diff_added_lines": 5,
  "tool_model_breakdown": {}
}

Step 9: Checking blame outputs...

=== Blame for module1.py ===
978970a (mock_ai 2025-11-03 20:21:26 +0000 1) def function_one():
978970a (mock_ai 2025-11-03 20:21:26 +0000 2)     print("AI generated function 1")
978970a (mock_ai 2025-11-03 20:21:26 +0000 3)     return 1

=== Blame for module2.py ===
38355ad (Test User 2025-11-03 20:21:26 +0000 1) def function_two():
38355ad (Test User 2025-11-03 20:21:26 +0000 2)     print("AI generated function 2")
38355ad (Test User 2025-11-03 20:21:26 +0000 3)     return 2
38355ad (Test User 2025-11-03 20:21:26 +0000 4) def helper():
38355ad (Test User 2025-11-03 20:21:26 +0000 5)     return "helper"

===================================================================
VERIFICATION
===================================================================

✅ PASS: Commit 2 (before reset) shows ai_additions: 5
❌ FAIL: Commit 2 (after recommit) does NOT show ai_additions: 5
   Actual: "ai_additions":0
✅ PASS: module1.py shows mock_ai attribution
❌ FAIL: module2.py does NOT show mock_ai attribution

===================================================================
Repository Location: /tmp/tmp.5kDP4F9Ru7
===================================================================
<!-- gh-comment-id:3482449463 --> @AtnesNess commented on GitHub (Nov 3, 2025): ```> git-ai -v 1.0.13 ``` ``` bash test.sh =================================================================== git-ai Issue #169: Reset and Recommit Attribution Bug =================================================================== Creating clean repository in: /tmp/tmp.5kDP4F9Ru7 Step 1: Initializing git repository... Initialized empty Git repository in /tmp/tmp.5kDP4F9Ru7/.git/ [main (root-commit) 411436b] Initial commit 1 file changed, 1 insertion(+) create mode 100644 README.md you ████████████████████████████████████████ ai 100% 0% Step 2: Creating Commit 1 - AI creates module1.py... ai_agent mock_ai changed 1 file(s) that have changed since the last commit [main 978970a] Commit 1: AI creates module1.py 1 file changed, 3 insertions(+) create mode 100644 module1.py you ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ai 0% 100% 100% AI code accepted Commit 1 SHA: 978970a74cb9076914738fee75e5eab9630a3c0c === Blame for module1.py === 978970a (mock_ai 2025-11-03 20:21:26 +0000 1) def function_one(): 978970a (mock_ai 2025-11-03 20:21:26 +0000 2) print("AI generated function 1") 978970a (mock_ai 2025-11-03 20:21:26 +0000 3) return 1 Step 3: Checking Commit 1 stats... { "human_additions": 0, "mixed_additions": 0, "ai_additions": 3, "ai_accepted": 3, "total_ai_additions": 3, "total_ai_deletions": 0, "time_waiting_for_ai": 0, "git_diff_deleted_lines": 0, "git_diff_added_lines": 3, "tool_model_breakdown": { "mock_ai::unknown": { "ai_additions": 3, "mixed_additions": 0, "ai_accepted": 3, "total_ai_additions": 3, "total_ai_deletions": 0, "time_waiting_for_ai": 0 } } } Step 4: Creating Commit 2 - AI creates module2.py... ai_agent mock_ai changed 1 file(s) that have changed since the last commit [main 56be14f] Commit 2: AI creates module2.py 1 file changed, 5 insertions(+) create mode 100644 module2.py you ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ai 0% 100% 100% AI code accepted Commit 2 SHA: 56be14fde11e38cec1c2d3f8d953471467abbad6 === Blame for module2.py === 56be14f (mock_ai 2025-11-03 20:21:26 +0000 1) def function_two(): 56be14f (mock_ai 2025-11-03 20:21:26 +0000 2) print("AI generated function 2") 56be14f (mock_ai 2025-11-03 20:21:26 +0000 3) return 2 56be14f (mock_ai 2025-11-03 20:21:26 +0000 4) def helper(): 56be14f (mock_ai 2025-11-03 20:21:26 +0000 5) return "helper" Step 5: Checking Commit 2 stats (BEFORE reset)... { "human_additions": 0, "mixed_additions": 0, "ai_additions": 5, "ai_accepted": 5, "total_ai_additions": 5, "total_ai_deletions": 0, "time_waiting_for_ai": 0, "git_diff_deleted_lines": 0, "git_diff_added_lines": 5, "tool_model_breakdown": { "mock_ai::unknown": { "ai_additions": 5, "mixed_additions": 0, "ai_accepted": 5, "total_ai_additions": 5, "total_ai_deletions": 0, "time_waiting_for_ai": 0 } } } Step 6: Resetting last commit (soft reset)... Current HEAD: 978970a74cb9076914738fee75e5eab9630a3c0c Should match Commit 1: 978970a74cb9076914738fee75e5eab9630a3c0c ✓ HEAD is back at Commit 1 Git status after reset: A module2.py Step 7: Recommitting the changes... [main 38355ad] Commit 2 (recommitted): AI creates module2.py 1 file changed, 5 insertions(+) create mode 100644 module2.py you ████████████████████████████████████████ ai 100% 0% New Commit 2 SHA: 38355ad343d0435d320b29f9a5d587203a579ef4 Step 8: Checking Commit 2 stats (AFTER reset and recommit)... { "human_additions": 5, "mixed_additions": 0, "ai_additions": 0, "ai_accepted": 0, "total_ai_additions": 0, "total_ai_deletions": 0, "time_waiting_for_ai": 0, "git_diff_deleted_lines": 0, "git_diff_added_lines": 5, "tool_model_breakdown": {} } Step 9: Checking blame outputs... === Blame for module1.py === 978970a (mock_ai 2025-11-03 20:21:26 +0000 1) def function_one(): 978970a (mock_ai 2025-11-03 20:21:26 +0000 2) print("AI generated function 1") 978970a (mock_ai 2025-11-03 20:21:26 +0000 3) return 1 === Blame for module2.py === 38355ad (Test User 2025-11-03 20:21:26 +0000 1) def function_two(): 38355ad (Test User 2025-11-03 20:21:26 +0000 2) print("AI generated function 2") 38355ad (Test User 2025-11-03 20:21:26 +0000 3) return 2 38355ad (Test User 2025-11-03 20:21:26 +0000 4) def helper(): 38355ad (Test User 2025-11-03 20:21:26 +0000 5) return "helper" =================================================================== VERIFICATION =================================================================== ✅ PASS: Commit 2 (before reset) shows ai_additions: 5 ❌ FAIL: Commit 2 (after recommit) does NOT show ai_additions: 5 Actual: "ai_additions":0 ✅ PASS: module1.py shows mock_ai attribution ❌ FAIL: module2.py does NOT show mock_ai attribution =================================================================== Repository Location: /tmp/tmp.5kDP4F9Ru7 =================================================================== ```
Author
Owner

@svarlamov commented on GitHub (Nov 3, 2025):

@AtnesNess The script is still passing for me with version 1.0.15. What's your version of git? I'm running 2.51.0

<!-- gh-comment-id:3482934993 --> @svarlamov commented on GitHub (Nov 3, 2025): @AtnesNess The script is still passing for me with version `1.0.15`. What's your version of `git`? I'm running `2.51.0`
Author
Owner

@AtnesNess commented on GitHub (Nov 4, 2025):

It's 2.51.2..

I also see that it is reproducible within rust:latest docker

 docker run --rm -v "$(pwd):/workspace" -w /workspace rust:latest bash -c "curl -sSL https://raw.githubusercontent.com/acunniffe/git-ai/main/install.sh | bash && source ~/.bashrc && bash test.sh"

Where test.sh is the script above

<!-- gh-comment-id:3483279165 --> @AtnesNess commented on GitHub (Nov 4, 2025): It's 2.51.2.. I also see that it is reproducible within `rust:latest` docker ``` docker run --rm -v "$(pwd):/workspace" -w /workspace rust:latest bash -c "curl -sSL https://raw.githubusercontent.com/acunniffe/git-ai/main/install.sh | bash && source ~/.bashrc && bash test.sh" ``` Where `test.sh` is the script above
Author
Owner

@svarlamov commented on GitHub (Nov 4, 2025):

I'm sorry this was my bad... My system was pointing to debug releases of those versions still. This only fails in the release version, not the debug versions. Reopening

<!-- gh-comment-id:3483639599 --> @svarlamov commented on GitHub (Nov 4, 2025): I'm sorry this was my bad... My system was pointing to debug releases of those versions still. This only fails in the release version, not the debug versions. Reopening
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#66
No description provided.