For git clone, I am using the argument --filter=blob:none. This works for my use case.
Turns out, filtering is an optional server side feature. I learned this when I came across a server which doesn't support this, and to my surprise the git client downloaded everything anyway!!
$ git clone --single-branch --depth=1 --no-checkout --filter=blob:none ...
Cloning into `...`
warning: filtering not recognized by server, ignoring
warning: filtering not recognized by server, ignoring
remote: Couting objects: 12345, done.
Receiving objects: 99% ...
This is undesirable behavior which should NOT happen. Is there a way of:
- querying a git server ahead of time to ensure that filtering is enabled before cloning
- making this "warning" instead fatal; the git clone command should fail and not pull any remote files
Thanks.