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

pager

Annotate git diff output with AI attribution markers.

Usage

git diff | whogitit pager [OPTIONS]

Description

The pager command reads git diff output from stdin and annotates added lines with AI attribution markers. This provides inline visibility into which diff lines were AI-generated directly in your terminal.

Options

OptionDescription
--no-colorDisable colored output
-v, --verboseShow detailed attribution info (model, timestamps)
--no-pagerOutput directly to stdout instead of through pager

Attribution Markers

Added lines are prefixed with attribution markers:

MarkerColorMeaning
GreenAI-generated line, unchanged
YellowAI-generated line, modified by human
(none)-Human-written or original line

Setup

Option 1: Replace default git pager

Configure git to use whogitit for all diff output:

git config --global core.pager "whogitit pager"

Option 2: Create git aliases

Create specific aliases for AI-annotated commands:

git config --global alias.ai-diff '!git diff | whogitit pager --no-pager'
git config --global alias.ai-show '!git show "$@" | whogitit pager --no-pager'
git config --global alias.ai-log '!git log -p "$@" | whogitit pager --no-pager'

Examples

Basic usage

git diff HEAD~1 | whogitit pager

Compare branches

git diff main..feature | whogitit pager

Verbose output

git diff | whogitit pager --verbose

Output includes edit IDs and similarity percentages for AI-modified lines.

Pipe to less manually

git diff | whogitit pager --no-pager | less -R

The -R flag tells less to interpret color codes.

View commit with attribution

git show abc123 | whogitit pager

Output Example

diff --git a/src/main.rs b/src/main.rs
@@ -40,4 +45,8 @@ impl Server {
● +    fn handle_error(e: Error) -> Result<()> {
● +        log::error!("Failed: {}", e);
● +        retry_with_backoff(|| reconnect())
● +    }
◐ +    // Added timeout handling
  +    const TIMEOUT: u64 = 30;  // Human-added

Troubleshooting

Annotations not appearing

  1. Ensure attribution data exists:

    whogitit blame <file>
    
  2. Fetch git notes:

    git fetch origin refs/notes/whogitit:refs/notes/whogitit
    
  3. Verify whogitit is in PATH:

    which whogitit
    

Colors not working

If colors don’t appear in your pager:

# Use -R flag with less
git diff | whogitit pager --no-pager | less -R

# Or disable colors
git diff | whogitit pager --no-color

Slow performance on large diffs

For very large diffs, the pager needs to look up attribution for each file. Consider using --no-pager and piping through head to preview:

git diff | whogitit pager --no-pager | head -100

See Also