Skip to content
Merged
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
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ module to PyPI.
## How to update launchable/jar/exe_deploy.jar

```
bazel build //src/main/java/com/launchableinc/ingest/commits:exe_deploy.jar
bazel test //...
cp bazel-bin/src/main/java/com/launchableinc/ingest/commits/exe_deploy.jar launchable/jar/exe_deploy.jar
```
./build-java.sh
```

# Installing CLI

Expand Down
5 changes: 5 additions & 0 deletions build-java.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -ex
bazel build //src/main/java/com/launchableinc/ingest/commits:exe_deploy.jar
bazel test //...
cp bazel-bin/src/main/java/com/launchableinc/ingest/commits/exe_deploy.jar launchable/jar/exe_deploy.jar

Binary file modified launchable/jar/exe_deploy.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.launchableinc.ingest.commits;

import static com.google.common.collect.ImmutableList.toImmutableList;
import static java.util.Arrays.*;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
Expand All @@ -27,6 +28,7 @@
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import org.apache.http.Header;
Expand All @@ -39,10 +41,9 @@
import org.apache.http.impl.client.HttpClientBuilder;
import org.eclipse.jgit.diff.DiffAlgorithm.SupportedAlgorithm;
import org.eclipse.jgit.diff.DiffEntry;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.InvalidObjectIdException;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.errors.StopWalkException;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectReader;
Expand All @@ -53,7 +54,6 @@
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.revwalk.filter.CommitTimeRevFilter;
import org.eclipse.jgit.revwalk.filter.OrRevFilter;
import org.eclipse.jgit.revwalk.filter.RevFilter;
import org.eclipse.jgit.submodule.SubmoduleWalk;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -64,6 +64,7 @@
public class CommitGraphCollector {
private static final Logger logger = LoggerFactory.getLogger(CommitGraphCollector.class);
private static final ObjectMapper objectMapper = new ObjectMapper();
private static final boolean LCHIB544 = System.getenv("LAUNCHABLE_DEBUG_LCHIB544")!=null;

/**
* Root repository to start processing.
Expand Down Expand Up @@ -172,7 +173,7 @@ public void close() throws IOException {
private ImmutableList<ObjectId> getAdvertisedRefs(HttpResponse response) throws IOException {
JsonParser parser = new JsonFactory().createParser(response.getEntity().getContent());
String[] ids = objectMapper.readValue(parser, String[].class);
return Arrays.stream(ids)
return stream(ids)
.map(
s -> {
try {
Expand Down Expand Up @@ -410,6 +411,12 @@ private JSCommit transform(RevCommit r) throws IOException {
ConfigConstants.CONFIG_KEY_ALGORITHM,
SupportedAlgorithm.HISTOGRAM);

if (LCHIB544) {
System.err.printf("Commit %s parents=%s%n",
r.name(),
stream(r.getParents()).map(AnyObjectId::name).collect(Collectors.joining(",")));
}

for (RevCommit p : r.getParents()) {
CountingDiffFormatter diff = new CountingDiffFormatter(git);
List<DiffEntry> files = diff.scan(p.getTree(), r.getTree());
Expand All @@ -434,6 +441,11 @@ private JSCommit transform(RevCommit r) throws IOException {
}
c.getParentHashes().put(p.name(), changes);
}

if (LCHIB544) {
System.err.println(objectMapper.writeValueAsString(c));
}

return c;
}

Expand Down
Loading