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

Re: [PATCH] convert: legitimately disable clean/smudge filter with an empty override

From
Lars Schneider <larsxschneider@gmail.com>
Date
Jan 28, 2016, 09:27 UTC
Message-ID
<AB5433EB-2C86-4A71-9E9F-057AC3CC150A@gmail.com>
In-Reply-To
<xmqqr3h6bgbe.fsf@gitster.mtv.corp.google.com>
On 25 Jan 2016, at 02:25, Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> larsxschneider@gmail.com writes:
> 
>> From: Lars Schneider <larsxschneider@gmail.com>
>> 
>> A clean/smudge filter can be disabled if set to an empty string. However,
>> Git will try to run the empty string as command which results in a error
>> message per processed file.
> 
> The above two sentences do not make any sense to me.  You observe
> that the command refuses to work when the variable is set to an
> empty string--why then can you claim "filter can be disabled if set
> to an empty string"?  I'd consider that the system is not working
> with such a configuration, i.e. "filter cannot be disabled by
> setting it to empty; such a request will result in an error".

If I am not mistaken then Git exits with 0 (success) and an error message if the filter command is empty and the filter is not required. If the filter command is empty and the filter is required then Git will exit with 1 (error).

How about this?

If the clean/smudge command of a Git filter driver (filter.<driver>.smudge and filter.<driver>.clean) is set to an empty string ("") and the filter driver is not required (filter.<driver>.required=false) then Git will run successfully. However, Git will print an error for every file that is affected by the filter.

Teach Git to consider an empty clean/smudge filter as legitimately disabled and do not print an error message if the filter is not required.

Thanks, Lars

Show 12 quoted lines
> 
>> Teach Git to consider an empty clean/smudge filter as legitimately disabled
>> and do not print an error message.
> 
> On the other hand, this does make sense to me, as I do not think of
> a good way to say "earlier configuration entry said we should use
> this filter, but we actually do not want to use that one (or any)"
> because a configuration, unlike attributes entry, cannot be reset.
> The closest you can do is to set it to empty, so it may be a good
> new feature to do this.
> 
> 
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 11 in “convert: legitimately disable clean/smudge filter with an empty override”
  1. convert: legitimately disable clean/smudge filter with an empty overridelarsxschneider@gmail.com, Jan 24, 2016
  2. Torsten BögershausenJan 24, 2016
  3. Eric SunshineJan 24, 2016
  4. Lars SchneiderJan 27, 2016
  5. Lars SchneiderJan 27, 2016
  6. Jeff KingJan 24, 2016
  7. Lars SchneiderJan 27, 2016
  8. Junio C HamanoJan 25, 2016
  9. Lars SchneiderJan 28, 2016
  10. Junio C HamanoJan 28, 2016
  11. Junio C HamanoJan 28, 2016

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.