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

Re: [PATCH 0/2] Add --no-filters option to git-add

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 20, 2021, 14:10 UTC
Message-ID
<YDEYaVibMFo1OJZs@camp.crustytoothpaste.net>
In-Reply-To
<c660bf7b-cd59-43d4-a374-11997f0b15d1@collabora.co.uk>
On 2021-02-20 at 09:30:58, Andrej Shadura wrote:
Show 38 quoted lines
> On 20/02/2021 09:06, Andrej Shadura wrote:
> > On 19/02/2021 23:36, brian m. carlson wrote:
> >> So I think that while this might be a useful escape hatch for users, I
> >> definitely want to see a compelling rationale for it and a big warning
> >> in the documentation and an update to the relevant entry in the Git FAQ
> >> before we accept such a patch.
> 
> Here’s my proposal for the updated manpage description of the option:
> 
> --no-filters::
> 
> Add the contents as is, ignoring any input filter that would have been
> chosen by the attributes mechanism, including the end-of-line
> conversion. Note that this option is not intended for interactive use,
> since files added this way will always show up as modified if Git were
> to apply transformations to them, making the situation potentially very
> confusing.
> 
> And here the FAQ entry extended:
> 
> It is also possible for perpetually modified files to occur on any
> platform if a smudge or clean filter is in use on your system but a file
> was previously committed without running the smudge or clean filter.  To
> fix this, run the following on an otherwise clean working tree:
> +
> ----
> $ git add --renormalize .
> ----
> +
> Another situation where perpetually modified may appear on any platform
> is when a file has been committed without running any filters (including
> the end-of-line conversion), but the `.gitattributes` file states that
> this file requires a conversion.  In this case, you can either
> renormalize the files if this happened by mistake, or modify
> `.gitattributes` or `$GIT_DIR/info/attributes` as described above to
> exempt the file from the conversion if this was intentional.
> 
> (I will send an updated patch set when we agree on the wording.)

This seems fine. Thanks for being open to addressing my concerns, and I agree that your use case seems like a good one and that this is a valuable feature.

-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US
Previous: Andrej ShaduraNext: Andrej Shadura via GitGitGadget
Message 7 of 11 in “Add --no-filters option to git-add”
  1. 0/2 Add --no-filters option to git-addAndrej Shadura via GitGitGadget, Feb 19, 2021
  2. 1/2 add: add option --no-filters to disable attribute-based filteringAndrej Shadura via GitGitGadget, Feb 19, 2021
  3. 2/2 hash-object: use the new HASH_RAW flag instead of setting path to NULLAndrej Shadura via GitGitGadget, Feb 19, 2021
  4. brian m. carlsonFeb 19, 2021
  5. Andrej ShaduraFeb 20, 2021
  6. Andrej ShaduraFeb 20, 2021
  7. brian m. carlsonFeb 20, 2021
  8. 0/2 Add --no-filters option to git-addAndrej Shadura via GitGitGadget, Feb 20, 2021
  9. 1/2 add: add option --no-filters to disable attribute-based filteringAndrej Shadura via GitGitGadget, Feb 20, 2021
  10. 2/2 hash-object: use the new HASH_RAW flag instead of setting path to NULLAndrej Shadura via GitGitGadget, Feb 20, 2021
  11. Junio C HamanoFeb 20, 2021

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.