Skip to content

Instantly share code, notes, and snippets.

Kristof Meixner Mercynary

Block or report user

Report or block Mercynary

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Mercynary
Mercynary / retrievingdatasets.java
Created Jul 12, 2016
Retrieving the dataset commit and re-executing the query
View retrievingdatasets.java
String workingTreeDir = getWorkingTreeDir();
Git git = new Git(repository));
// Checking out the query branch and loading the query
git.checkout().setName("refs/heads/queries").call();
Path path = Paths.get(workingTreeDir, DigestUtils.sha1Hex(pid) + ".query");
Properties properties = properties.load(Files.newBufferedReader(path))
// Extracting the commit hash from the metadata file
Query query = new DefaultQuery(properties.getProperty("commit"));
@Mercynary
Mercynary / savingqueries.java
Created Jul 12, 2016
Saving query files in the queries branch
View savingqueries.java
Git git = new Git(repository);
String pid = query.getPid().getIdentifier();
PersonIdent personIdent = new PersonIdent("Jane Doe","doe@gmail.com");
String message = "Created query file for PID=" + pid;
// Building the SHA1 hash for the PID
String fileName = DigestUtils.sha1Hex(pid) + ".query";
// Retrieving the queries branch
git.checkout().setName("refs/heads/queries").call();
@Mercynary
Mercynary / gitbranchcreation.java
Created Jul 12, 2016
Creating the CSV and metadata branch
View gitbranchcreation.java
Git git = new Git(repository);
// Creating the master branch if it doesn't exist
ObjectId head = repository.resolve("refs/heads/master");
if (head != null) { return; }
// Creating the initial commit on the branch
git.commit().setMessage("Initial commit").call();
String readmeFileName = "README.md";
You can’t perform that action at this time.