Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git plugin #125

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion artemis/experiments/experiment_record_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from artemis.general.tables import build_table
from six import string_types


def get_record_result_string(record, func='deep', truncate_to = None, array_print_threshold=8, array_float_format='.3g', oneline=False):
"""
Get a string representing the result of the experiment.
Expand Down
42 changes: 42 additions & 0 deletions artemis/experiments/git_tools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

from git import Git

import git
from git import Repo
from sys import argv
import sys
from git.exc import InvalidGitRepositoryError


def get_git_repo_for_current_run():
path = sys.argv[0]
git_repo = git.Repo(path, search_parent_directories=True)
git_root = git_repo.git.rev_parse("--show-toplevel")
print git_root


def save_working_copy(message = 'autocommit'):

g = Git(get_git_repo_for_current_run())

g.stash()

g.checkout('-B', 'artemis-experiments')

g.stash('apply')

unmerged_files = g.diff('--name-only', '--diff-filter=U')

print unmerged_files

g.commit('-am', message)

g.checkout('-')

g.stash('pop')


print 'ff'


save_working_copy()