Error while using Control Freak on for Merge Commits
Hello Team,
Recently we have installed Control Freak add-on which is working great. However, we are seeing errors for merged commits as one of the merged commit doesn’t fulfill Jira issue policy and after that merge commits are not allowed to push.
Could you please help us detailed steps to resolve this before pushing our changes without modifying Control Freak Settings.
Counting objects: 114, done.
Compressing objects: 100% (36/36)
Writing objects: 100% (52/52)
Writing objects: 100% (52/52), 4.78 KiB, done.
Total 52 (delta 20), reused 2 (delta 1)
remote: Control Freak: Commit 812c9f94cdf4cfa4 rejected.
remote:
remote: Control Freak
remote: -----
remote: Commit 812c9f94cdf4cfa4 rejected.
remote: It does not reference a JIRA ticket in its commit message.
remote:
remote: Note: JIRA references must be in the first line of the commit message.
remote:
remote: To see the commit message:
remote:
remote: git show -s 812c9f94cdf4cfa4
remote:
remote: To edit the commit message:
remote:
remote: git rebase --interactive
remote:
remote: (Mark the commits to edit with 'reword' in the dialog).
remote: -----
remote:
To ssh://git@atlgit-01.us.manh.com:7999/unik/nike-wm2017.git
! [remote rejected] release/NIKE/WMOS-2017/PHASE1/SDN -> release/NIKE/WMOS-2017/PHASE1/SDN (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@atlgit-01.us.manh.com:7999/unik/nike-wm2017.git'
git did not exit cleanly (exit code 1) (7235 ms @ 1/8/2020 3:47:53 PM)
Counting objects: 114, done.
Compressing objects: 100% (36/36)
Writing objects: 100% (52/52)
Writing objects: 100% (52/52), 4.78 KiB, done.
Total 52 (delta 20), reused 2 (delta 1)
remote: Control Freak: Commit rejected. Foxtrot merges not allowed on "release/NIKE/WMOS-2017/PHASE1/SDN".
remote:
remote: Control Freak
remote: -----
remote: Commit rejected. Foxtrot merges not allowed on "release/NIKE/WMOS-2017/PHASE1/SDN".
remote:
remote: Commit a78868291167395c contains a foxtrot merge.
remote: A rebase will repair the problem:
remote:
remote: git rebase
remote:
remote: Alternatively, redo the merge in the opposite direction.
remote: -----
remote:
To ssh://git@atlgit-01.us.manh.com:7999/unik/nike-wm2017.git
! [remote rejected] release/NIKE/WMOS-2017/PHASE1/SDN -> release/NIKE/WMOS-2017/PHASE1/SDN (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@atlgit-01.us.manh.com:7999/unik/nike-wm2017.git'
git did not exit cleanly (exit code 1) (7532 ms @ 1/8/2020 3:51:10 PM)
Comments (2)
-
repo owner -
repo owner - changed status to on hold
Waiting to hear back if suggestions helped.
- Log in to comment
This looks tricky. Not really a Control-Freak problem but more a problem of your company’s branching/merge traditions and policy combined with your current Control-Freak settings being hard to navigate at times.
I do see one small issue: Control-Freak is recommending you do “git rebase --interactive” to reword the merge commit’s message, but of course that won’t work, since “git rebase” drops all merges. Try this instead: “git rebase --interactive --preserve-merges”.
Caveat: git’s own documentation warns that interactive rebase + --preserve-merges is okay for rewording commit messages, but the ordering of the commits for the interactive rebase should not be adjusted. Here’s the snippet from Git’s own documentation:
I’m curious to know if “git rebase --interactive --preserve-merges” helps get you out of this knot !
Also, if you find your engineers are constantly bumping into the “Foxtrot Merges Not Allowed” error, try to get them to use “git pull --rebase” instead of “git pull” as much as possible. Blog post here: https://mergebase.com/doing-git-wrong/2018/03/07/fun-with-git-pull-rebase/