Control Freak: Block Empty Commits doesn't seem to work

Issue #53 invalid
Puddleglum created an issue

Scenario: Default Development Production Release Branches Hotfix Branches (all set to X) An empty commit was nevertheless pushed:

$ git commit -a --allow-empty-message -m "" [master 6f8fdfa] 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 AndNowToSthCompletelyDifferent.txt $ git push Counting objects: 2, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (2/2), 232 bytes | 232.00 KiB/s, done. Total 2 (delta 1), reused 0 (delta 0) To ssh://bitbucket.xxxxxx e1d12ba..6f8fdfa master -> master

BB Server v5.14.1 Control Freak Version 2018.09.12

Comments (3)

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

    "Empty Commits" in this context refers to commits with no changes (e.g., "git commit --allow-empty"). It's not referring to the commit messages. I just checked and the control works correctly:

    git commit -m 'has message but nothing changed' --allow-empty 
    [master e7943e1] has message but nothing changed
    (master) ~/rep_1 git push
    Password for 'http://admin@localhost:7990': 
    Counting objects: 1, done.
    Writing objects: 100% (1/1), 211 bytes | 211.00 KiB/s, done.
    Total 1 (delta 0), reused 0 (delta 0)
    remote: 
    remote: Control Freak
    remote: -----
    remote: Commit rejected. Empty commits not allowed on "master".
    remote: 
    remote: Commit e7943e177137f694 is an empty commit.
    remote: 
    remote: A rebase will remove empty commits:
    remote: 
    remote:   git rebase
    remote: 
    remote: If the rebase complains that origin/master is up to date,
    remote: you can use the --force-rebase flag.
    remote: -----
    remote: 
    To http://localhost:7990/bitbucket/scm/project_1/rep_1.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    

    If you want to block empty commit messages you can use the "Jira Policy" control and set something appropriate inside the "Commit Messages Must - Match regex:" field.

    This will work even if you don't use Jira (simply uncheck everything in the "Jira References Must" section).

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

    Thanks for the bug report! Marking as INVALID because the "Block Empty Commits" control is not about commit messages. Please don't hesitate to comment or reopen if you disagree with this assessment.

  3. Log in to comment