DEV Community

Pavol Z. Kutaj
Pavol Z. Kutaj

Posted on

How to Use Delta Pager without Headings

The aim of this page📝 is to explain how to configure Delta to omit hunk headers in git diff outputs, resulting in cleaner and more readable diffs. I have looked for it for quite some time — the feature is called Hunk Header. I have a data file of 80MB (Consul KV Dump with each KV per line) and need to compare past VS current (HEAD) version.
• Delta is a syntax-highlighting pager for git, diff, and grep outputs. 
• By default, git diff includes hunk headers, which can clutter the output.
• To remove these headers, configure Delta’s hunk-header-style to omit.
• This setting is specified in the Git configuration file.
• The configuration line to add is:

[delta]
    hunk-header-style = omit
Enter fullscreen mode Exit fullscreen mode

• This configuration instructs Delta to omit the hunk header section from the output. 
• After updating the configuration, run git diff as usual:

git diff -U0 <commit_hash> HEAD --color | delta
Enter fullscreen mode Exit fullscreen mode

• The -U0 option ensures only the modified lines are shown.
• The --color option enables syntax highlighting.
• The | delta pipes the output through Delta for enhanced formatting.
• This setup results in a cleaner diff display, focusing solely on the changes without additional semantic headers.

LINKS

https://github.com/dandavison/delta/issues/364
https://github.com/dandavison/delta
https://dandavison.github.io/delta/full—help-output.html

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay