Friday, January 14, 2011

How works..

The parsing code within (do a git clone works great great. The way the plug-in works is to do "git diff whatchanged --no-abbrev -M --pretty=raw" (see GitAPI).java. The diff structures that are parsed appears as follows:

tree 92b84d3b8bba31b80f011bf9f957190ad14b299c
parent 15a87109192f74dc9f82af23c9ffa047d8379622
author John Smith  1294997088 -0800
committer John Smith  1294997548 -0800

Within, the regex to parse through and extract the author, commiter, email address, timestamp, and time zone is performed. Everything looks great. Within the getAuthor() method, there is a line that attempts to create the user if the name does not exist. This line will create a User object with the csAuthor field passed-in, and a boolean field as the 2nd parameter determines whether to create a new account if the userid is not passed.

We can see a similar pattern in (you need to git clone

// register the user                                                                                                                                                               
        User user = createAccount(si.username,si.password1);
        user.addProperty(new Mailer.UserProperty(;
        return user;

No comments:

Post a Comment