Skip to content

Conversation

@dankessler
Copy link
Member

This was prompted by issue #18, which requested that the svmbatch history be integrated into the main methods core repository.

I did some git wizardry to make this cleaner, which I'll explain here and may help in the future.

My goal was for development of this to look like it had branched off of MethodsCore, rather than being developed independently. This required me to use some fancy filter-branch and rebase tricks.

Development Repository (svmbatch)

First, I went to the svmbatch repository where I had been developing all of this as the root tree.

Clean Up History

To clean up the history, which included some merges I didn't care about seeing as merges, I ran

git rebase

Filter-branch to put root in subtree

My goal was for it to look as if I had developed everything in a subtree called /svmbatch/

git filter-branch --tree-filter '
mkdir -p svmbatch ;
mv `ls | grep -xv svmbatch` svmbatch/' HEAD

This went and, and for each commit reachable from HEAD (my current branch)

  1. Checked out the tree associated with each commit
  2. made directory svmbatch if it didn't already exist. the -p flag (among other things) suppresses errors when that subdirectory already exists
  3. moves all content (except for svmbatch itself) into svmbatch
  4. Recommits it

in my local MethodsCore repo

I next needed to read in this history, and make it look like it had branched off of MethodsCore's develop branch

Reading in the data

git remote add svmbatch <path to svmbatch repository> #this adds a new remote named svmbatch
git fetch svmbatch

When I run this I get a complaint about not common commits, which is totally to be expected since they their histories don't intersect. We'll fix this in a minute.

You can appreciate the nonintersection if you run gitk --all and you'll see the two unconnected lineages.

Basing things on develop

git checkout remotes/svmbatch/<branchname> -b svmbatch #checkout the remote branch as a local one
git rebase --onto develop --root #This will include the delta of current branch's root commit vs a hypothetical empty commit

All Done!

Go ahead and run gitk --all and you'll now see that it looks as if I grabbed MethodsCore, checked out develop as a new branch called svmbatch, then did all of my work in the subtree svmbatch (of course, the time stamps suggest otherwise).

Fixed file references to include '+orig'. Successful test run through on garbage data

Updated readme file
1] If directory specified by svmdir doesn't exist, it will attempt to make it for you.

2] If you give the script an additional argument of 1, it will run a leave-one-out crossvalidation for you.
Added ability to do totem mode, significant rearrangement of argument/parameter processing, etc.
…nable settings for older, non-totem and linear applications.
…tionality is broken until it gets written back in. Hardcoded for crossval, which probably doesn't work anyway
…e small typo that had no present impact, but may if we use "test rules" in the future
… cases, rather than doing so with replacement after each LOOCV
…atch work into the MethodsCore repo. It should not be viewed as the "final" svmbatch product
@ghost ghost assigned dankessler Mar 7, 2012
@dankessler
Copy link
Member Author

I'm going to assume this is ok with everybody and go ahead and merge it in.

dankessler added a commit that referenced this pull request Mar 7, 2012
Pull svmbatch development history into main MethodsCore repo
@dankessler dankessler merged commit 20970da into UMPsychMethodsCore:develop Mar 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant