Currently teh log parser vcs_git is pretty horrible code. i'm currently refactoring and rewriting it to be much easier to understand and use. The base for this is the oop branch by marvil07, you can follow my efforts here: http://github.com/CorniI/versioncontrol_git/tree/oop-refactored but beware, it's currently broken.

Comments

sdboyer’s picture

The log parser is one of those things that should ultimately be based on our gitlib/cligit implementation...although I know from doing this with versioncontrol_svn that integration isn't SO tight that it can't be pretty easily refactored in later. However, it does seem like more work to need to refactor later...I'd kinda rather see cligit done first?

CorniI’s picture

well, it's nearly done ;)
The code should be pretty clear now, and extracting the parts we need for a libgit should be easy. Also, for phase 1, do we need anything more than a log parser?
The next step is imho writing a post-recieve (I think) hook which inserts the pushed commits into the db as well, using some extra information like for branch creation/deletion.

sdboyer’s picture

Fair enough, we don't need it for phase 1 - not for this, or anything else. And that it's nearly done is the most important thing anyway.

Yup, I was just looking this morning to see if we had any post-receive hooks. Don't think we do, and that's definitely the next step.

CorniI’s picture

Version: » 6.x-2.x-dev
StatusFileSize
new40.51 KB

So, i did this. marvil07 reviewed the patch already and is fine with it. The attached patch is against the oop branch and fixes some issues the port had as well.
This doesn't break any existing functionality (at least by intention :D) but doesn't add more than branch deletion.

CorniI’s picture

Status: Active » Needs review
marvil07’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new40.31 KB

I just notice Druplicon message on IRC, we need auto-lists for notify isssues to maintainers :-)

Well, yep, I review the changes, and I just re-rolled the patch against the DRUPAL-6--2 branch to make it easy to try.

Please note that, since there was the vcs api bug #714198: VersioncontrolRepository::getLabels is broken, you need the last dev tarball to try it.

Maybe a sdboyer try before the commit? :-)

CorniI’s picture

StatusFileSize
new39.85 KB

Here is the patch i really meant to attach, it only has minor changes and should apply cleanly on marvil07's oop branch. Please note that i've got some additional commits in my oop branch which aren't in marvil07's but which are in this patch. They are only minor, though.

marvil07’s picture

Status: Reviewed & tested by the community » Needs review

marking as need review again to avoid forget re-reading it :-)

sdboyer’s picture

Issue tags: +git phase 2

need this for phase 2 of the migration

CorniI’s picture

well given that this patch is ready in my opinion and just awaits your review...
marvil should be fine by doing a diff of my new patch to the patch he already reviewed...

sdboyer’s picture

yeah, it's on me :) i'll get to it ASAP

sdboyer’s picture

Status: Needs review » Fixed

This is _awesome_. So glad I went through this. I've incorporated it locally into my changes, so marking it fixed, though I can't commit back to CVS for the next couple days until the corresponding entity changes in the main versioncontrol branch get stable, too.

sdboyer’s picture

Nevermind, just gonna put this in straightaway since it applies well to the pre-entities work.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

sdboyer’s picture

@CorniI Now that I've finally gone through most of all this in considerable detail, I finally figured out what's been bothering me about it. I found the way you broke up some of the logic in the log parser to be counterintuitive. I liked that there was a clean, easily-readable top-level function (versioncontrol_git_log_update_repository()) that called lots of secondary functions (e.g., versioncontrol_git_log_parse_and_insert_commit()). But there was another level beyond that second one, which is where it started to get irksome. I don't mind deep nesting in general - the problem I was having here was that most of these functions contain important logical components, like invoking the git binary to retrieve some data. Removing that logic from the main flow of code forced me to switch between the main function and subfunction repeatedly, which made for a difficult grokking experience. So again, while I'm all for breaking up code into logical segments, moving data retrieval too far away from data manipulation can lead to confusion.

  • Commit cc309ca on 6.x-2.x, fix-invalid-default-branches, fullsync-memory by sdboyer:
    Issue #714228 by CorniI: Cleanup and refactor of versioncontrol_git's...