Control Freak plugin offfers to block specific file types to commit. But How to utilize it.

Issue #135 closed
Former user created an issue

I can see that, there is an option to block specific file types in the configuration of the control freak plugin. but how to utilize it? I tried with different kinds of expressions like ( *.pdf and pdf and .pdf ) ...and nothing worked to block-pushing pdf files to the repository.

Please find the attached screenshot.

My question is, how to block specific files to be pushed to bitbucket central repository.

Thanks Mahesh

Comments (4)

  1. Julius Davies [bit-booster.com] repo owner

    (copy/pasting my reply on community.atlassian.com):

    Are you sure?  This is working for me (I'm the primary maintainer of this plugin):

    remote: Control Freak: Push rejected.
    remote: 
    remote: Control Freak
    remote: -----
    remote: Push rejected.
    remote: All files larger than 500 bytes are not permitted.
    remote: Specific files [*.exe, *.pdf, *.zip] larger than 200 bytes are also not permitted.
    remote: The following file is too large:
    remote: 
    remote: test.pdf (1723760 bytes)
    remote: 
    remote: You can push large files to this repository using 'git lfs':
    remote: git lfs track <path>
    remote: 
    

    There is one important loophole to know about with this control:  any file that already exists in the repo (on any branch or tag, including unreachable tags or branches, and including files deleted many commits ago - they are still present in the repo) cannot be blocked (based on contents, not based on filename).  The control only gets triggered during the phase where git-receive is calculating missing files to accept during the push, and since git-receive skips files that already exist on the server, regardless of their name, there is no way to block those.

    This means developers can also easily get around the control:  "git push random-file.allowed" and then rename to "random-file.pdf" in a later push.

    Is there any chance you guys are hitting against this loophole, where byte-for-byte identical files (regardless of name) cannot be blocked if they are already present in bitbucket?

    p.s.  the control happily accepts all of these:  pdf, .pdf, *.pdf

    (they all evaluate to the same file type)

  2. Julius Davies [bit-booster.com] repo owner

    They way you’ve configured things all NEW files than end in *.md should be blocked if they are 77 bytes or larger.

  3. Julius Davies [bit-booster.com] repo owner

    Closing since we cannot replicate this.

    Note: starting with Control Freak v2020.11.03 we always allow ALL files through that are between 50 - 300 bytes, since otherwise the Git-LFS pointer files get rejected!

  4. Log in to comment