giff
visualizes the differences between the current HEAD
and a specified branch in a git repository using a formatted table output in your terminal. The differences are displayed with color-coded additions and deletions for better readability.
- Branch Comparison: Compare changes between the current HEAD and a specified branch.
- Color-coded Output: Additions are displayed in green and deletions in red.
- Table Formatting: Uses
comfy_table
to format the output.
- Rust (latest stable version)
- Git
- A terminal supporting ANSI escape codes for color output
This project uses the following Rust crates:
clap
: For command-line argument parsing.comfy_table
: For creating and formatting tables.crossterm
: For terminal manipulation.regex
: For parsing git diff output.
cargo install giff
git clone https://github.com/bahdotsh/giff.git
cd giff
cargo install --path .
giff -b branch //by default, the branch will be main
![Screenshot 2024-08-06 at 3 34 30 PM](https://private-user-images.githubusercontent.com/26796930/355406246-c196df7d-90e9-41f5-ab8e-cce1356740a3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjU0MDIsIm5iZiI6MTczODk2NTEwMiwicGF0aCI6Ii8yNjc5NjkzMC8zNTU0MDYyNDYtYzE5NmRmN2QtOTBlOS00MWY1LWFiOGUtY2NlMTM1Njc0MGEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDIxNTE0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmMGQxMGU2ODEwODgyMjgzMjhiNDM5MmJkZjJkMmMyMDA5ODRjY2UzODAyMTk5MWZhZjI5YzkzY2U4ZjQ2NzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.MEI7vfmT_PGJp-h9fGxe5sDY0cHIbemU6zRZRf2lb_A)