My project has a large number of json configuration files. Some of them change their content in accordance with development tasks (new fields are added, old values are changed), but absolutely all of them change 4 fields with each new change: 2 id and 2 dates.(this is done automatically and I cannot influence this in any way)
I need those files for which only 2 ids and 2 dates have changed not to be included in changes (like "assume unchanged"). Changes should only include those files that have changed something other than 2 ids and 2 dates.changes that i need to ignore
Now I have doubts that this is even possible to do using git.
I read about clear and smudge filters, but as I understand it, it can substitute a regex expression so that it is automatically replaced with some constant value, but I need the file to be completely ignored when committing by condition.
Your doubts are correct. Git doesn't provide a way to ignore tracked files.
The FAQ mentions this:
If you're working with tools that automatically change these files, perhaps you should move the actual files elsewhere and copy them into an ignored location where the tools will look for them, possibly with a script.
You're correct that a smudge or clean filter won't work here because when you're using the clean filter, you don't know the current state (or, for that matter, the file name). Thus, you can't intrinsically know what output to produce, since your goal is to not modify certain fields at all.