Tuesday, May 12, 2015

Missing Change-ID error in GIT + Gerrit configured environment







If you get the "ERROR: missing Change-Id in commit message footer" message when submitting into your git repository that is using gerrit for code reviews, here is the quick solution to resolve this.  






















******************************************************************************************************
devel@ubuntu:~/arpita/automation_repo/automation$ git-submit
Counting objects: 108, done
Delta compression using up to 4 threads.
Compressing objects: 100% (75/75), done.
Writing objects: 100% (100/100), 95.98 KiB | 0 bytes/s, done.
Total 100 (delta 12), reused 0 (delta 0)
remote: Resolving deltas: 100% (12/12)
remote: Processing changes: refs: 1, done   
remote: ERROR: missing Change-Id in commit message footer
remote: Suggestion for commit message:
remote: Merge branch 'master' of ssh://intouch3-gerrit.int.domain.com:29418/repo-automation
remote:
remote: Change-Id: I4ebe05b43e78d0c91a5f0de51e0b8ebc940309e4
remote:
remote: Hint: To automatically insert Change-Id, install the hook:
remote:   gitdir=$(git rev-parse --git-dir); scp -p -P 29418 arpita.pathak@intouch3-gerrit.int.domain.com:hooks/commit-msg ${gitdir}/hooks/
remote:
remote:
To ssh://arpita.pathak@repo-gerrit.int.domain.com:29418/repo-automation
 ! [remote rejected] HEAD -> refs/for/master (missing Change-Id in commit message footer)
error: failed to push some refs to 'ssh://arpita.pathak@repo-gerrit.int.domain.com:29418/repo-automation'
********************************************************************************************************

 Solution :
 *********************************************************************************************************

devel@ubuntu:~/arpita/automation_repo/automation$ git rebase -i
Successfully rebased and updated refs/heads/master.
 *********************************************************************************************************

The command opens up a file that allows you to "pick" the commit you want from a list. The others are abandoned. All the lines other than the relevant one should be deleted from this file and press <Ctrl+X> to continue.

 *********************************************************************************************************
  GNU nano 2.2.6 File: ...utomation/.git/rebase-merge/git-rebase-todo

 pick 88e13ed All POC code from Impetus

# Rebase 3c2b37b..88e13ed onto 3c2b37b
#
# Commands:
#  p, pick = use commit
#  r, reword = use commit, but edit the commit message
#  e, edit = use commit, but stop for amending
#  s, squash = use commit, but meld into previous commit
#  f, fixup = like "squash", but discard this commit's log message
#  x, exec = run command (the rest of the line) using shell
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
***********************************************************************************************************



Executing a submit now, git push will now work as expected.

Tuesday, March 25, 2014

How To

Increase the Primary File Partition on Ubuntu running on VMPlayer


It should have been a simple few steps to achieve expanding the primary file partition on my Ubuntu VM , however that was not to be. Below are the steps that I executed to successfully increase the partition size. Looking at different sites I found that my VM refused to react the same way that was stated in all the available solutions. These little obstacles are explained below and the corresponding solution that resolved it.
  • Download the GParted Live CD , you will need this tool to increase your disk size. Download the version that supports your VM, I used xxx-0.18.0-1-i486.iso version.
  • Power off your VM, from the VM Player Menu.Select your Virtual Machine Settings and change the Connection to "Use ISO image" and browse to the freshly downloaded GParted ISO. This will effectively mount the image without having to burn it onto a CD.
  •  Select Hard Disk from the same screen and increase to the desired number.
  • Reboot the guest OS. Quickly press F2 on the VMware preboot load screen to enter the virtual VMware BIOS. Go to the Boot tab and bring the CD-ROM drive to the top by scrolling to it and clicking + repeatedly. Now save and exit. The next time the OS tries to boot, it will first try to load the LiveCD.   GParted should load after a few minutes where everything should be very straightforward.
    • Well, it did not work that way for me. No matter what I did I could not boot off the live cd. I tried F2 and Esc multiple times to get into the BIOS menu, tried increasing the Boot Delay to 5000 in the .vmx file, tried some more F2 in super speed mode, but to no avail. I simply could not invoke the Gparted GUI from the live cd. You can execute it when the VM is up but then you cannot unmount your primary partition and therefore cannot resize it.  

    • I had to enable the grub menu so that while booting all my boot options are displayed. I did this by hashing out the #GRUB_HIDDEN_TIMEOUT="0"
      option in the /etc/default/grub file. When in the grub menu screen, I selected "c", and then "exit" out of the grub command line.
    • On exiting, the VM immediately boots off the Gparted iso ! Voila ! From now onwards it is pretty intuitive. Select your language and the default start mode, then the Gparted Live screen is active and you will be able to see your partitions. There are multiple images at the GParted Site that helps clarify the different options.
  • But we are not done yet. My partitions were structured as in the image below (simple and usually the default). My primary partition seemed to be locked even though I had booted off the iso. Turns out that you cannot increase the Primary partition unless you SwapOff and delete your Swap/Extended partition. The option to "Resize" remained disabled for me until I deleted these partitions.  
  • Once the the Resize option is enabled for the primary partition, make the required changes and Apply them. You can redo and undo partitions as needed.
  • Recreate an extended partition and then allocate as linux swap. Remember about SwapOn before you exit the tool. Here is a snapshot of my partitions after the changes. 
The solution seemed so simple but my environment seemed to resist the changes. I did not want to recreate my VM as by now I had lost track of all the packages and tools that I had installed and would need to do that all over again.

Thought I would jot it down for future use ...