GIT: Get Tag Details of Current Checkout

About two weeks ago I migrated a project from CVS to git. After migration when we tried to build the project it kept failing.

On debugging, I figured that in build.xml (it’s a legacy project with a complex ANT build script) they were trying to figure out from which tag it has been checked out by reading the Tag file in the .CVS folder.

Since this file wasn’t going to be there in the cloned git repo, I started looking ways to achieve this in git. I finally found a git command which gives the tag details of the current checkout, and it’s:

git describe

This command gives the details about the most recent tag reachable from it. You can read more about it at

To use it in ANT all one has to do is create a an executable git target and pass describe as its argument. Below is how we are getting the details:

[code lang=”xml”]
<target name="tag-details" >
<!– Get the closest tag string using git describe if possible –>
<echo message="Getting git tag details"/>
<exec executable="git" outputproperty="project.tag.details" failifexecutionfails="false">
<arg value="describe"/>


Hibernate: Dynamic Insert

While doing code-review I came across hibernate’s dynamic-insert property and found it really useful. dynamic-insert is a boolean attribute of class element as defined in hibernate-mapping-3.0.dtd. This is an optional attribute of the class element and if not defined explicitly defaults to false.

As the name says, setting this property to true makes insert query generated by hibernate dynamic i.e. it will include only non-null values of DTO in the prepared statement.

Let’s explore this with the help of an example, for which I’m using PostgreSQL 9 and Hibernate 5.1.0.

India Travel

Kerala Travelogue – Alleppey


The main attraction of Alleppey is houseboat and we started searching for houseboat from the day we decided we were going to Kerala. We couldn’t finalize any from the ones we found online and finally our uncle who had been to Kerala a few months ago gave us the contact details of guy on whose houseboat they had stayed. After some lengthy discussions and a bit of haggling we finalized on Deluxe Houseboat Plan which would cost us ₹7000. In the deluxe plan the AC would work only during the night time and include lunch, evening snacks, dinner and breakfast. The check-in timing would be 12PM and checkout at 9AM.

Now, Munnar to Alleppey is about 180km and takes almost 6 hours to reach there accounting for a couple of halts in between. We were planning to stay only for one night in Alleppey and that too on the houseboat. So to make it on time for the house boat check-in at 12PM we would have to leave latest by 6 AM and would leave us too tired to enjoy the houseboat. So we decided that we will stay one night in Alleppey then next day go to the houseboat.

Day 1

As planned we post checkout we headed to Munnar Tea Museum and left from there for Alleppy by 12 o’clock. We took one halt for lunch on the way and reached Alleppey by 4 o’clock.

Our booking for Alleppey too were done via Oyo rooms and the hotel was A.J Park. The hotel’s interior were good and the rooms were also good, clean but cramped. Despite being Oyo Premium the room didn’t even have mini refrigerator and toilet paper was missing.

A.J.Park’s Lobby
Our Room @ A.J.Park
Our Room @ A.J.Park
Our Room @ A.J.Park

In the evening we headed towards Alleppey beach which was 1.8 km from the hotel, so we went there walking. We spent the evening on the beach, saw the beautiful sunset and then came back to hotel restaurant for dinner.

Alleppey beach
Old piers at Alleppey beach
Sunset at Alleppey beach
India Travel

Kerala Travelogue – Kochi

Kochi was our entry point to Kerala and stayed there for 2 days.

Day 1

We took a direct flight from Mumbai to Kochi and it took 2 hours to reach there. Kochi Airport has prepaid taxi facility, a little on the expensive side but very safe. We booked a non ac prepaid taxi to our hotel at M.G. Road, Erankulam and it cost us ₹830 for the 35 km trip and it took us close to 1 hour to reach the hotel.

The weather was hot and humid I would say slightly more humid than Mumbai.

We had booked our rooms via Oyo at Grand Hotel, M.G. Road. When we reached, we were told our booking was of standard room but were being upgraded to Execute room, WOW! The room was clean and spacious.

After checking in, we had our lunch in Grand hotel itself. We were really excited to try Kerala cuisine, so we ordered a Vaza Ilayil Pollicha Meen and a Kerala Chicken Thali. As the quantity of an individual thali would have been too much for me, we thought we will share it, but were told sharing a thali is not allowed in restaurant. Then the waiter himself suggested that along with one chicken thali you order one plate plain rice then you both can share gravy but not rice. After some time, we got to know that they provide unlimited rice with thali that’s why sharing is not allowed

M.G. Road is the city center of Kochi, where you’ll see everything from Government Offices, High Court to local and branded stores. So, in evening we headed to see Marine Drive which was just 15 minutes’ walk from the hotel. The real surprise for us was that maximum shops closed after sunset