[GH-ISSUE #494] Formatting changes should preserve original attribution (v1.1.1) #169

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

Originally created by @txf0096 on GitHub (Feb 9, 2026).
Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/494

Version

git-ai v1.1.1

Expected Behavior

When formatting code (adding/removing whitespace), the attribution should be preserved from the original author, regardless of who makes the formatting change.

Test Case 1: Human formats AI code

# 1. AI writes code with spaces
cat > test.py << 'EOF'
def foo():
    return    1
EOF
git add test.py
git-ai checkpoint mock_ai test.py
git commit -m "AI: initial code"

# git-ai blame:
# de8455b (mock_ai ... 2)     return    1
# stats: 0% you, 100% ai ✓

# 2. Human removes spaces  
cat > test.py << 'EOF'
def foo():
    return 1
EOF
git add test.py
git commit -m "Human: format code"

# git-ai blame:
# 8fca055 (Test User ... 2)     return 1
# stats: 100% you, 0% ai ✗

Expected: Line 2 should preserve mock_ai attribution
Actual: Line 2 changes to Test User attribution

Test Case 2: AI formats Human code

# 1. Human writes code
cat > test.py << 'EOF'
def foo():
    return 1
EOF
git add test.py
git commit -m "Human: initial code"

# git-ai blame:
# eb055b7 (Test User ... 2)     return 1
# stats: 100% you, 0% ai ✓

# 2. AI adds spaces
cat > test.py << 'EOF'
def foo():
    return    1
EOF
git add test.py
git-ai checkpoint mock_ai test.py
git commit -m "AI: format code"

# git-ai blame:
# f06eb85 (Test User ... 2)     return    1
# stats: 100% you, 0% ai ✓

Expected: Line 2 should preserve Test User attribution
Actual: Line 2 correctly preserves Test User attribution ✓

Summary

Test Case 1 is problematic - when a human formats AI code, the attribution incorrectly changes to the human. Test Case 2 works correctly - AI formatting human code preserves the human attribution.

For consistency, both formatting operations should preserve the original attribution using INHERIT rules, but currently only Test Case 2 works as expected.

Originally created by @txf0096 on GitHub (Feb 9, 2026). Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/494 ### Version git-ai v1.1.1 ### Expected Behavior When formatting code (adding/removing whitespace), the attribution should be preserved from the original author, regardless of who makes the formatting change. ### Test Case 1: Human formats AI code ```bash # 1. AI writes code with spaces cat > test.py << 'EOF' def foo(): return 1 EOF git add test.py git-ai checkpoint mock_ai test.py git commit -m "AI: initial code" # git-ai blame: # de8455b (mock_ai ... 2) return 1 # stats: 0% you, 100% ai ✓ # 2. Human removes spaces cat > test.py << 'EOF' def foo(): return 1 EOF git add test.py git commit -m "Human: format code" # git-ai blame: # 8fca055 (Test User ... 2) return 1 # stats: 100% you, 0% ai ✗ ``` **Expected**: Line 2 should preserve `mock_ai` attribution **Actual**: Line 2 changes to `Test User` attribution ### Test Case 2: AI formats Human code ```bash # 1. Human writes code cat > test.py << 'EOF' def foo(): return 1 EOF git add test.py git commit -m "Human: initial code" # git-ai blame: # eb055b7 (Test User ... 2) return 1 # stats: 100% you, 0% ai ✓ # 2. AI adds spaces cat > test.py << 'EOF' def foo(): return 1 EOF git add test.py git-ai checkpoint mock_ai test.py git commit -m "AI: format code" # git-ai blame: # f06eb85 (Test User ... 2) return 1 # stats: 100% you, 0% ai ✓ ``` **Expected**: Line 2 should preserve `Test User` attribution **Actual**: Line 2 correctly preserves `Test User` attribution ✓ ### Summary Test Case 1 is problematic - when a human formats AI code, the attribution incorrectly changes to the human. Test Case 2 works correctly - AI formatting human code preserves the human attribution. For consistency, both formatting operations should preserve the original attribution using INHERIT rules, but currently only Test Case 2 works as expected.
Author
Owner

@svarlamov commented on GitHub (Feb 9, 2026):

Is the inter commit move feature flag enabled?

<!-- gh-comment-id:3873561355 --> @svarlamov commented on GitHub (Feb 9, 2026): Is the inter commit move feature flag enabled?
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#169
No description provided.