For the last several weeks, I was working more on ZF2′s OpenId component + on (to be announced here soon) my own project, so wasn’t able to dedicate as much time to Phing as I’d love to. Despite that, couple of updates to git-tasks are on their way for the announced Phing 2.4.5.

First of all, I was able to finish off ticket #618, and integrate tasks contributed by Evan Kaufman (huge thanks and all the credits go to him). He supplied task files, which after number of slight updates, addition of unit tests, and documentation were pushed into trunk.

So, in Phing 2.4.5 we will have GitLog and GitTag tasks, which are quite handy and certainly will enable one to have more flexible build scripts.

GitLogTask is a wrapper around git-log, and here are couple of examples:

<property name="repo.dir" value="./relative/path/to/repo" />
<resolvepath propertyName="repo.dir.resolved" file="${repo.dir}" />

<!-- clone repository -->
<gitclone
    repository="git://github.com/path/to/repo/repo.git"
    targetPath="${repo.dir.resolved}" />

<gitlog
    paths="${repo.dir.resolved}"
    format="oneline"
    maxCount="2"
    stat="true"
    noMerges="false"
    since="Sun Jan 23 23:55:42 2011 +0300"
    until="Mon Jan 24 09:59:33 2011 +0300"
    outputProperty="logs"
    repository="${repo.dir.resolved}" />
<echo>${logs}<echo>
<!-- Dump logs with relative dates -->
<gitlog
    format="medium"
    date="relative"
    repository="${repo.dir.resolved}" />
<!-- Dump logs in custom format -->
<gitlog
    format="The author of %H was %an <%ae>"
    repository="${repo.dir.resolved}" />

GitTagTask is a wrapper around git-tag, and, again, here are couple of examples:

<property name="repo.dir" value="./relative/path/to/repo" />
<resolvepath propertyName="repo.dir.resolved" file="${repo.dir}" />

<!-- clone repository -->
<gitclone
    repository="git://github.com/path/to/repo/repo.git"
    targetPath="${repo.dir.resolved}" />

<!-- Create tags named "ver1.0"  out of current HEAD -->
<gittag repository="${repo.dir.resolved}" name="ver1.0" />

<!-- Force tag (re)creation even if one already exists -->
<gittag
    repository="${repo.dir.resolved}"
    name="ver1.0" force="true"/>

<!-- Create tag name "ver1.0" on a given commit  -->
<gittag repository="${tmp.dir.resolved}"
    name="ver1.0"
    commit="c573116f395d36497a1ac1dba565ecd3d3944277" />

<!-- Or in more general case: create tag name "ver1.0" on a given object -->
<gittag repository="${tmp.dir.resolved}"
    name="ver1.0"
    object="c573116f395d36497a1ac1dba565ecd3d3944277" />

<!-- Create tag with annotation and message -->
<gittag
    repository="${repo.dir.resolved}"
    name="ver1.0"
    annotate="true" message="Version 1.0 tag"/>

<!-- Delete tag -->
<gittag
    repository="${repo.dir.resolved}"
    name="ver1.0" delete="true" />

Another thing I was able to work on, is enabling separate commit creation on fast-forward merging (see fastForwardCommit option in GitMergeTask and –ff/–no-ff in official git-merge docs).

Please note that Michiel smashed lots of other bugs and created several enhancements, so stay tuned for upcoming release of Phing :)

That’s all for today – have a green build!

,

Just a tiny note: Glad to announce that Phing 2.4.3 is out and is ready to be used!

Lots of bug fixes + PHPUnit 3.5 Support + GitTasks = Phing 2.4.3!!

See full release notes and let us know if you spot anything broken!

Happy phinging :)

In preparation of what should have been a minor bug-fix release (2.4.3), me and Michiel have not only smashed bugs, but introduced quite a few features as well. The feature that I spend most of my time on was implementation of equal support for Git as we had for Subversion.

It’s been quite a lot of time from the first request by Steven Roussey to actually having GitTasks available in Phing. But finally we have them:

I already planned enhancements, but these ones should get you up and running!

Although I have created those tasks from scratch, I should mention three persons without whose work this undertaking of mine wouldn’t be that interesting and rewarding: Kousuke Ebihara, Beau Simensen, and Zachary Danger.

Kousuke is the guy behind PEAR’s VersionControl_Git – which made it ridiculously easy to write git manipulating magic. Beau and Zach, beside creating custom git tasks to which I always turned for road-map and inspiration, also constantly pushed me forward, by providing feedback and asking when I will finally make GitTasks available to general public.

Thank you, guys, for your marvelous work!

I really hope that you will find those tasks helpful, and if you spot any issue you will make sure to hit me back, so that I can improve the code.

That’s all – wish you sane an non-broken builds!