All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: El_Hoy <eloyesp@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Making git grep ignore binary the default
Date: Fri, 17 Oct 2025 14:29:46 -0700	[thread overview]
Message-ID: <xmqqsefhxlmd.fsf@gitster.g> (raw)
In-Reply-To: <CAPapNH0C3+bU-RUO6oFHUKLjKuNdm-aXgsFTHFobYVrJXWzr=g@mail.gmail.com> (El Hoy's message of "Fri, 17 Oct 2025 12:00:27 -0300")

El_Hoy <eloyesp@gmail.com> writes:

> I've found that there is a flag (`git grep -I`) to ignore binary
> files, it works great, but I've found no way to make it the default.
>
> It would be great to have a config for this. This way a possible
> implementation implies:
>
> - Adding a config `grep.ignoreBinary` that defaults to false, keeping
> the current default.
>
> - Adding a flag `git grep --include-binary` to revert the default. But
> maybe the `-a, --text` flag already does that.
>
> Also, maybe the next git version (3.0) can default to ignore-binary as
> a better default.

I am tempted to suggest not to do any of the above.

Simply because we have never needed to do something similar to "-a"
and "-I" that we added in early 2006 for the past nearly 20 years.
Also because GNU does not have any such thing to force "-a" or "-I"
as default.  The biggest reason is that it would be surprising if
such a change does not break existing scripts that have been written
by people over the years.




  reply	other threads:[~2025-10-17 21:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 15:00 Making git grep ignore binary the default El_Hoy
2025-10-17 21:29 ` Junio C Hamano [this message]
2025-10-17 23:29   ` Thomas Braun
2025-10-18  0:52     ` brian m. carlson
2025-10-18 14:16       ` rsbecker
2025-10-20 15:24       ` Thomas Braun
2025-10-20 17:20         ` El_Hoy
2025-10-21  7:27           ` Jeff King
2025-10-18 10:22   ` Jeff King
2025-10-18 16:01     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqsefhxlmd.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=eloyesp@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.