You already answered a part of your question ( --break inserts an empty line between files, --heading prints the file name separately, and -n or --line-number gives line numbers in each line).
The rest are just color options that are set in git config via the color.grep.<slot> entries. See the documentation for more details, but note that depending on what you requested, I think this does the trick:
[alias] ack = -c color.grep.linenumber=\"bold yellow\" \ -c color.grep.filename=\"bold green\" \ -c color.grep.match=\"reverse yellow\" \ grep --break --heading --line-number
(this is expressed as you see it in git config --global --edit , as quoting is messy).
Or, to configure it with one command:
git config --global alias.ack '-c color.grep.linenumber="bold yellow" -c color.grep.filename="bold green" -c color.grep.match="reverse yellow" grep --break --heading --line-number'
Add or subtract -c options to change any colors you like, and / or set them to your default preference by setting color.grep.<name> = color instead of using the git ack alias.
torek source share