Today I have committed the build number component for Yii framework.
This component is very simple but yet powerful and useful for industrial and enterprise-wide applications.
The project is hosted on GitHub - https://github.com/yev/yiiGitBuildNumber
Affichage des articles dont le libellé est Git. Afficher tous les articles
Affichage des articles dont le libellé est Git. Afficher tous les articles
vendredi 25 janvier 2013
jeudi 9 février 2012
Maven BuildNumber plugin - short revision id for Git
Today, I would like to explain the improvement for maven plugin - buildNumber, that I talked in my previous message - short revision id for Git SCM.
IMPORTANT : This feature is present in the maven-buildnumber-plugin 1.1 version.
<shortRevisionLength>
in the
<configuration>
section. For exemple:
Some implementation details
UPDATED: If your maven build can't find the dependency for maven-buildnumber-plugin 1.1 , try to force the dependency update by adding option "-U" for your mvn command.
Libellés :
buildnumber,
Git,
java,
maven,
rev-parse,
short revision
mercredi 8 février 2012
My first Open Source commitment - Git short revision
Today, my patches for 2 maven projects have been accepted by the maven-buildNumber-plugin's project lead Olivier Lamy.

One of the web Java project, I currently working on, is fully automated with Maven. One interesting and useful thing is to have the date & the revision number at the bottom of the web page. Like this:
It was done with excellent maven plugin buildNumber - http://mojo.codehaus.org/buildnumber-maven-pluginThe problem was that the project SCM migrated from the SVN to Git. And the revision ID in Git is too long. In fact it's SHA-1 sequence that should be unique across the world and all possible revisions... So the build id at the bottom of the page was so ugly for business users that I receive the task to make it shorter.
After asking the question about the git short revision id in StackOverflow.com and in the user's mailing lists of the maven, I understood that the buildNumber plugin does not support this feature. And the project Lead, Olivier Lamy, gracefully proposed to me to make a patch and pointed out the first java class I have to look at.
After asking the question about the git short revision id in StackOverflow.com and in the user's mailing lists of the maven, I understood that the buildNumber plugin does not support this feature. And the project Lead, Olivier Lamy, gracefully proposed to me to make a patch and pointed out the first java class I have to look at. The code he sent me was very clear and I quickly figured out how to add the new feature that I called shortRevisionLength.
After one day of working I have sent the patch to Olivier and created 2 issues on the codehouse JIRA server:
After one day of working I have sent the patch to Olivier and created 2 issues on the codehouse JIRA server:- http://jira.codehaus.org/browse/MBUILDNUM-86
- http://jira.codehaus.org/browse/SCM-664
I added some test cases and the documentation patch as well.
The next day the patch has been approved and integrated in the SVN. So, the next version of buildNumber plugin 1.1 contains some peace of code from Ukraine :) Nice.
mercredi 25 mai 2011
Git killer features
After 3 weeks of working with Git (the DCVS written by Linus Torwalds), I definitely can say that it is a great technology. 
What are the killer features of Git for me:
Git - pdf book about git
I can recommend to download a free PDF book "Git Community Book" about git from http://book.git-scm.com
As long as I learning Git, as more I understand its powerfull.
If you are asking yourself what you need to learn right now? What is the next major revolution in the IT world? Maybe, the answer will be Git.
What are the killer features of Git for me:
- Distributed – I can develop normally even without Internet and access to the central repository. It’s a great feature to make small and concise commits while developing at home, during the weekend.
- Rich history revision mechanism – the search within the log-history is wonderful. With
git log –sSecurityManager
I can find, for example, all commits that introduce or remove the SecurityManager class. Attention, the search is performed on the source code and not on the commit log. It’s a best tool for making the code live analysis. - Git bisect – automatically find a failing commit using the binary search and a set of unit tests. If you don’t use the CI server (shame on you :)), you can nevertheless quickly find a bad commit. Git bisect command will run the tests against the project snapshots. Each snapshot is associated with a particular commit. I did not try to use this command yet. But, the concept is great.
- CMD – git is a command line based tool. You can script the commands, make aliasing etc. CMD speed up your productivity. Of course, for making the merge it’s not so trivial, but the guys from Eclipse will soon release a completely functional version of the plugin eGit.
- git cherry-pick - reintegate an existing commit to the current branch. How many times you have forgot to switch to the correct branch before making a commit? I have been confronted with this painfull mistake quite often. Now you don't have to report your commit manually to the correct branch. The magic cherry-pick command will make it four you!
I have worked with git on Windows and Mac. Git for Mac is a stable and I have not noticed any problem. It is not the case for Windows...
Git remote tags problems
For running Git on Windows box, you have to install msysgit (I used 1.7.4.msysgit.0). The one problem I encountered with msysgit, it was that I could not push my tag to the remote repo. The commandgit push --tags origin masterdid not create a tag remotely. The same command executed on Mac did the job correctly.
Git - pdf book about git
I can recommend to download a free PDF book "Git Community Book" about git from http://book.git-scm.com
As long as I learning Git, as more I understand its powerfull.
Inscription à :
Articles (Atom)


