Created
October 26, 2025 18:43
-
-
Save baldwindavid/826768b3dbe976f071068bc1612c55cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # Usage: git_blame_viewer.sh <file> [line] | |
| # Shows git blame for the file, optionally jumping to a specific line | |
| file="${1:-}" | |
| line="${2:-}" | |
| if [[ -z "$file" ]]; then | |
| echo "Error: No file provided" | |
| exit 1 | |
| fi | |
| if [[ ! -f "$file" ]]; then | |
| echo "Error: File not found: $file" | |
| exit 1 | |
| fi | |
| # Run git blame through delta | |
| # Delta handles paging and formatting automatically | |
| git blame "$file" | delta |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment