Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

copy-notes

Copy AI attribution from one commit to another.

Usage

whogitit copy-notes <SOURCE> <TARGET> [OPTIONS]

Description

The copy-notes command copies attribution data from a source commit to a target commit. This is useful for:

  • Recovering attribution after cherry-pick operations
  • Manually fixing attribution after complex rebases
  • Copying attribution when the post-rewrite hook wasn’t installed

Arguments

ArgumentDescription
SOURCESource commit SHA (the commit with attribution)
TARGETTarget commit SHA (the commit to copy attribution to)

Options

OptionDescription
--dry-runShow what would be copied without actually copying

Examples

Copy attribution after cherry-pick

Cherry-pick doesn’t automatically transfer attribution:

# Cherry-pick a commit
git cherry-pick abc123

# Copy the attribution to the new commit
whogitit copy-notes abc123 HEAD

Preview before copying

whogitit copy-notes abc123 def456 --dry-run
# Would copy attribution: abc123 -> def456

Batch copy after rebase

If you rebased without the post-rewrite hook installed:

# Save old commits before rebase
git log --format='%H' main..HEAD > /tmp/old-commits.txt

# After rebase, save new commits
git log --format='%H' main..HEAD > /tmp/new-commits.txt

# Copy notes for each pair
paste /tmp/old-commits.txt /tmp/new-commits.txt | while read old new; do
  whogitit copy-notes "$old" "$new"
done

Automatic Preservation

For most rebase and amend operations, you don’t need this command. The post-rewrite hook (installed by whogitit init) automatically preserves attribution during:

  • git rebase
  • git commit --amend

Use copy-notes only for:

  • Cherry-pick operations (not covered by post-rewrite hook)
  • Repositories where post-rewrite hook wasn’t installed
  • Manual recovery scenarios

Exit Codes

CodeMeaning
0Success (or source has no attribution)
1Error (invalid commit, repository issues)

See Also