git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin/blame: ignore nonexistent ignore files

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 20, 2025, 05:35 UTC
Message-ID
<CAPig+cT1BNXRotrz=rnVgvhQjZZwYgsAOQMonHFFTPfK-C0LOQ@mail.gmail.com>
In-Reply-To
<xmqqo6wr95r6.fsf@gitster.g>
On Sat, Apr 19, 2025 at 5:54 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
> "jade via GitGitGadget" <gitgitgadget@gmail.com> writes:
> > It's currently a problem to put blame.ignoreRevsFile in a global
> > gitconfig, for example, to use the GitHub (and other) supported filename
> > of .git-blame-ignore-revs by default if present in a repo, since the
> > current implementation exits the process if it fails to open the file.
>
> An alternative design that goes along the following lines may be
> more palatable:
>
>  - The way to spell for the users to specify a path that is
>    optional, either as the value of a command line option or a
>    configuration variable, is to prefix it with ":(optional)".  E.g.
>
>     [blame]
>         ignoreRevsFile = ":(optional).git-blame-ignore"
>
>     $ git blame --ignore-revs-file=":(optional).git-blame-ignore"
>
>  - For command line options, all commands that use parse-options API
>    would automatically benefit by updating parse-options.c and tweak
>    its handling of OPTION_FILENAME; when the specified string begins
>    with ":(optional)", you strip the prefix and see if the remainder
>    or the string names an existing file.  If it does, you use the
>    filename as the value of that command line option; otherwise you
>    pretend that the option didn't even exist on the command line.

For what it's worth, an initial implementation of ":(optional)" exists[*]. It was eventually dropped from Junio's "seen" branch merely because it never received any reviews, not due to any particular problem with it.

[*]: https://lore.kernel.org/git/20241014204427.1712182-1-gitster@pobox.com/
Previous: Junio C Hamano
Message 3 of 3 in “builtin/blame: ignore nonexistent ignore files”
  1. builtin/blame: ignore nonexistent ignore filesjade via GitGitGadget, Apr 19, 2025
  2. Junio C HamanoApr 19, 2025
  3. Eric SunshineApr 20, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.