Wednesday, March 18, 2015

RHEL 7: Disable Firewall

Unlike previous versions, RHEL 7 uses the firewalld service instead of the iptables service for its firewall. The firewall can be completely disabled with the following systemctl commands:

systemctl disable firewalld
systemctl stop firewalld


CentOS 7: Disable Firewall

Unlike previous versions, CentOS 7 uses the firewalld service instead of the iptables service for its firewall. The firewall can be completely disabled with the following systemctl commands:

systemctl disable firewalld
systemctl stop firewalld


Friday, January 30, 2015

Gerrit git review fails for initial empty repository

Gerrit is a code review tool built on and for git - a distributed version control system. When creating a project with gerrit, the user has an option to either create a completely empty repository (where an existing project could be imported) or to create a repository with an initial empty commit, as follows:

# gerrit create-project --empty-commit --name myproject
Without the initial empty commit, the underlying git repository is left empty without any revisions or branches.

Another tool used in conjunction with gerrit is git-review. This tool simplifies creation and management of reviews from the command line.

If a user attempts to run git-review on a repository while using the completely empty gerrit repository as the remote, the command may fail since there is no master branch yet created in the remote repository.

# git review
Errors running git rebase -i remotes/origin/master
fatal: Needed a single revision
invalid upstream remotes/origin/master

# git review -R
Had trouble running git log  --decorate --oneline HEAD --not remotes/origin/master --
fatal: bad revision 'remotes/origin/master'

For the first commit, the user can circumvent git-review and instead push directly to gerrit using git.

# git push origin HEAD:refs/for/master
As a result, a new review will be created in gerrit which can then be merged into the project's master branch. After an initial commit is merged into the master branch, the git-review command can be used as usual.

If the above command fails, complaining about the commit message "missing Change-Id in commit message footer" then simply amend the suggested Change-Id to the the commit message.

# git commit --amend