Archive

Archive for the ‘Git’ Category

Git Internals – a diagram

March 31, 2010 Leave a comment

A beautiful diagram from Git Internals:

Highly recommended! Both PDF and screencast are really good.

Categories: Git Tags:

Hudson: Git and Maven plugins

March 27, 2010 6 comments

Suddenly, something went wrong .. :(
A usual Hudson job pulling sources from Git repository started to fail with NPE:

Parsing POMs
[nexttags-CI] $ c:\Winny\java\jdk1.6.0_18\/bin/java -Xmx1024m -XX:MaxPermSize=512m -cp c:\dev\hudson-slave\maven-agent.jar;C:\Winny\java\apache-maven-2.2.1\boot\classworlds-1.1.jar hudson.maven.agent.Main C:\Winny\java\apache-maven-2.2.1 C:\dev\hudson-slave\slave.jar c:\dev\hudson-slave\maven-interceptor.jar 3841 c:\dev\hudson-slave\maven2.1-interceptor.jar
<===[HUDSON REMOTING CAPACITY]===>channel started
channel stopped
ERROR: Processing failed due to a bug in the code. Please report this to users@hudson.dev.java.net
java.lang.NullPointerException
	at java.util.Hashtable.put(Hashtable.java:394)
	at java.util.Hashtable.putAll(Hashtable.java:466)
	at hudson.maven.MavenBuilder.call(MavenBuilder.java:156)
	at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:688)
	at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:632)
	at hudson.remoting.UserRequest.perform(UserRequest.java:114)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:270)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)

What ?! But it worked half an hour ago. Hmm, that’s interesting …

After re-installing Hudson from scratch, installing it locally on my machine, going back and forward with versions, creating simple jobs doing absolutely nothing except pulling sources from various Git projects and running "mvn clean" .. I still couldn’t git rid of this error.

Well, it was clearly time for some debugging and .. here we go!

For some reason Git plugin started to pass null value for GIT_BRANCH environment variable.
This caused Maven plugin to fail in System.getProperties().putAll(systemProps) call.

The solution was to use "master" as default Git branch instead of "**" or empty String:

My versions were: Hudson v1.352, Git plugin v0.8.1

P.S
Some Hudson links:

Categories: Git, Hudson, Maven Tags: , ,

Git GUI Here

March 20, 2010 Leave a comment

Rather than right-clicking the folder and choosing “Git GUI Here” ..

"git-gui.bat":

@echo off
start d:\winny\Git\bin\wish.exe d:\winny\Git\libexec\git-core\git-gui --working-dir %*

assuming msysgit is installed at "d:\winny\Git"

Now, I only need to type "git-gui ." to launch it:

Much better. Hate it when someone forces me to use a mouse ..

Categories: Git, PC Tags:
Follow

Get every new post delivered to your Inbox.