patch to add git support

10 views
Skip to first unread message

michaelb

unread,
Aug 5, 2011, 7:36:29 PM8/5/11
to make-open-easy
I added Git support to moe-java. It adds classes based mostly off of
the mercurial code since the two are very similar. I couldn't fully
test it since the test code requires a missing package (
http://code.google.com/p/moe-java/issues/detail?id=1 ), and also the
documentation on some features is sparse, but commands such as
highest_revision, create_codebase, and change all work as expected, to
and from a git repo. It could probably be cleaned up more, and
possibly refactored with the hg code into base classes, but I'm
hesitant to do too much more without tests.

I'd be happy to mail [one of] you a diff or just push this to svn, if
you want.

cheers
--michaelb

michaelb

unread,
Aug 5, 2011, 7:51:05 PM8/5/11
to make-open-easy
here's a diff
https://gist.github.com/1128792
could probably be cleaned up a bit more but that's the idea

On Aug 5, 4:36 pm, michaelb <michae...@gmail.com> wrote:
> I added Git support to moe-java. It adds classes based mostly off of
> the mercurial code since the two are very similar. I couldn't fully
> test it since the test code requires a missing package (http://code.google.com/p/moe-java/issues/detail?id=1), and also the

Daniel Danger Bentley

unread,
Aug 8, 2011, 11:14:06 AM8/8/11
to make-op...@googlegroups.com, bhi...@google.com, sw...@google.com
Great! We're going to look at this today.

Thanks so much, we're really excited.
-Dan
--
"No Atlantis is too underwater or fictional." --Zach Anner

Michael Bethencourt

unread,
Aug 9, 2011, 2:34:21 PM8/9/11
to Samuel Swarr, make-op...@googlegroups.com
ah, great!

I wasn't going to clean it any more (after I got it working) until I
got the tests running and more documentation, since I wasn't sure how
much would change by then. I'll clean it up now. Also, yes, there may
be some overlap with HG. At some point it might be good to write a few
DVCS base classes which hg and git both extend.

On Tue, Aug 9, 2011 at 11:08 AM, Samuel Swarr <sw...@google.com> wrote:
> Hi Michael,
> We pushed out a new change to Java MOE that includes an Ant build that can
> also run tests. You should be able to write your own tests now for the Git
> classes. At first glance, the patch looked pretty good, however some things
> still need changing. For example, GitRevisionHistory's parseMetadata(...) is
> unchanged from HgRevisionHistory's implementation.
> Your patch might also need some refactoring since in the latest change, src/
> was renamed to java/ and tests/ was renamed to javatests/.
> We should also have a public site with Java MOE documentation and tutorials
> posted soon.

> --
> -Sam
>

Michael Bethencourt

unread,
Aug 12, 2011, 5:55:10 PM8/12/11
to Samuel Swarr, make-op...@googlegroups.com
Here is a better version of the Git client. I tested create_codebase,
change, highest_revision, and determine_metadata, and everything seems
to work. I wrote unit tests covering the same things as HG.
Unfortunately, it doesn't look like there is any way to escape the
info returned by git log, as there is in mercurial (No filters or
anything in git. Only thing that helps parsing is -z, but that doesn't
do much.)

Here is a diff for you guys to look at: https://gist.github.com/1143064

thanks
--michaelb

On Tue, Aug 9, 2011 at 11:52 AM, Samuel Swarr <sw...@google.com> wrote:
> We just posted a page on the wiki about Moe's directives. The ones that will
> be most useful for testing the Git stuff are create_codebase, change,
> highest_revision, and determine_metadata. More wiki pages describing the
> moe_config.txt file and CodebaseExpressions and RevisionExpressions will be
> posted shortly, so keep checking back. Thanks!

> --
> -Sam
>

Michael Bethencourt

unread,
Aug 19, 2011, 8:32:28 PM8/19/11
to Samuel Swarr, make-op...@googlegroups.com
I added HTTP support to MOE for the --project_config and --db paths.
You can now do stuff like: "java -jar moe.jar check_config
--config_file http://server/project_config". This patch makes it so a
company can use a simple REST API internally for maintaining projects,
and not have to worry about everything necessarily being on NFS. It is
backward compatible with old usage: if a path is given (without a
file:// or http:// scheme specifier), it will assume it is a file.

Here is the patch: https://gist.github.com/1158363

I also wrote a couple tiny Python utilities, which could (possibly) be
helpful to put in a bin or scripts directory or on the wiki or
something:
* https://gist.github.com/1158377
moe_config_server.py is a simple example server that implements the
REST api just mentioned. It serves up
"./projects/[project_name]/config.js" and
"./projects/[project_name]/moe.db"
* https://gist.github.com/1158379
moe.py is a wrapper around the main moe which looks for a JSON file
"~/.moerc" and saves the user from having to type --test_config and
--db with every call, and works with the above example server, so you
can just do commands like "moe.py project_name check_config"

Any feedback on the git client?

thanks
--michaelb

On Mon, Aug 15, 2011 at 10:57 AM, Samuel Swarr <sw...@google.com> wrote:
> Awesome thanks! We're looking at this now. I'll keep you updated.
>
> On Fri, Aug 12, 2011 at 5:55 PM, Michael Bethencourt <mich...@gmail.com>

> --
> -Sam
>

Reply all
Reply to author
Forward
0 new messages