Commit Graph

2660 Commits

Author SHA1 Message Date
Ben Kalman 467bdc9bc1 Let csv-importer take the metadata date as a flag (#2196) 2016-07-29 10:44:08 -07:00
Mike Gray 0e71059695 updating tour to match current output (#2199) 2016-07-29 13:28:24 -04:00
Mike Gray 5af05997fc initial go sdk tour (#2198) 2016-07-29 13:08:45 -04:00
cmasone-attic 593a649296 Merge pull request #2189 from cmasone-attic/issue2169
Remove NewSerializer
2016-07-29 08:00:52 -07:00
Erik Arvidsson dba9e5584b Print percentages in diff summary (#2195)
For example:

```
0 insertions (0.00%), 5,405 deletions (0.28%), 45 changes (0.00%), (1,938,935 entries vs 1,933,530 entries)
```

Fixes #2194
Towards #2031
2016-07-28 18:04:33 -07:00
Ben Kalman b2096234fd Make the output pager close the pipes it creates (#2187)
This makes less exit properly - before, it wasn't properly restoring the
terminal sometimes, and keyboard input stopped working.
Fixes https://github.com/attic-labs/noms/issues/2180.
2016-07-28 17:55:18 -07:00
Ben Kalman 6d2710a04e Simplify the channel logic in diff.go/summary.go (#2190)
Earlier I'd used 2 channels and selected over them, but as I found
elsewhere, this doesn't scale very well. It's simpler to just use a
close channel with a buffer size of 1.
2016-07-28 17:44:20 -07:00
Erik Arvidsson ff88ff2a65 Commit type: Compute the type for meta too (#2185)
This changes to compute the type for the meta field in a similar
way to how we compute the type for the value field.

Fixes #2179
2016-07-28 17:14:35 -07:00
Erik Arvidsson a995d5dafc Disallow nil in Value Equals (#2156)
We do not allow nil in any other places as a Vale so there is
little reason to allow it Equals

Fixes #2155
2016-07-28 16:58:33 -07:00
Rafael Weinstein 74ba1012c2 sequence.getOffset => sequence.cumulativeNumLeaves (#2193)
sequence.getOffset was problematic and didn't have a clear meaning. In addition it was causing a bunch of +1 code at call sites. This patch replaces it with cumulativeNumLeaves which has a clearer meaning.
2016-07-28 16:55:41 -07:00
Erik Arvidsson 26b94cf816 Minor cleanup of noms diff code (#2191) 2016-07-28 16:55:37 -07:00
Rafael Weinstein 1dc71c7f27 Align JS & Go impl of binary search (#2192) 2016-07-28 16:44:49 -07:00
Chris Masone b0112ba52b Remove NewSerializer
NewSerializer spun up a goroutine within itself. We've decided
this is an anti-pattern. Furthermore, we were using this inside
our remote database handler code, and a panic inside that goroutine
could take down the server. The callsites now use Serialize() directly.

Fixes #2169
2016-07-28 16:05:03 -07:00
Erik Arvidsson b20bec9b23 noms diff --summarize (#2183)
Shows number of changes between two top level values.

```
noms diff -summarize $l::#t5p4im6uug7n5m72frr0dnjnkm04e4ph.value $l::#ueo0utduuqsf9vrntrhn25lnc19m848l.value
```

Prints:

```
13,636 insertions, 0 deletions, 107 changes, (1,919,894 values vs 1,933,530 values)
```

Where the numbers are updated as more data is computed from the diff.

Towards #2031
2016-07-28 15:01:27 -07:00
Ben Kalman c1472fdd03 Make sure top-down and left-right diff finish before returning from best (#2184)
Leaving them running will cause a few database reads after
orderedSequenceDiffBest returns, and it looks like this is causing a
deadlock (see https://github.com/attic-labs/noms/issues/2165). I've also
seen a log related crash which goes away after this patch.
2016-07-28 14:57:31 -07:00
Ben Kalman 8330f3b7f3 Print closing brace for struct diff (#2178) 2016-07-27 17:36:14 -07:00
Ben Kalman deab7606b2 Fix empty sequence in getCompositeChildSequence (#2167)
Based on a patch by mike@mikegray.org
2016-07-27 17:12:35 -07:00
Ben Kalman 7998f302be Don't quote struct field names in diff (#2177) 2016-07-27 16:14:35 -07:00
Erik Arvidsson b0e77c250c Cleanup Struct Diff (#2160)
- Too have same API as all the other diff methods
- Send changes to channel without intermediary slices and without the
need to union and sort the fields
2016-07-27 14:56:22 -07:00
cmasone-attic a2c406512a Merge pull request #2171 from cmasone-attic/issue2170
Add comment explaining DynamoDB table format to dynamo_store.go
2016-07-27 13:16:18 -07:00
Chris Masone afb50a6272 Add comment explaining DynamoDB table format to dynamo_store.go
Fixes #2170
2016-07-27 12:37:13 -07:00
Aaron Boodman df2831b0fb Update intro.md 2016-07-27 08:49:42 -07:00
Ben Kalman 57bd3d2540 Make map diff print headers for each block of additions/deletions (#2166)
Previously a header was only printed once per entire map. This led to a
confusing diff where if a map like:

```
{
  "a": {
    "b": 1
  }
}
```

changed to:

```
{
  "a": {
    "b": 2
  },
  "c": {
    "d": 3
  }
}
```

then the diff would be:

```
/["a"]
- "b": 1
+ "b": 2
+ "c": {
+   "d": 3
+ }
```

which makes it look like the "c" change is part of the ["a"]["b"] one.

After this change, the diff will be:

```
/["a"]
- "b": 1
+ "b": 2
/
+ "c": {
+   "d": 3
+ }
```

I also fixed up a bit of the diff formatting in this change.
2016-07-26 16:48:33 -07:00
Erik Arvidsson 7a4436e9b5 Remove Type name property (#2161)
Only struct types have a name property and this was left over from
an earlier refactoring.
2016-07-26 15:31:43 -07:00
Ben Kalman b7653d3875 Fix 2 deadlocks in orderedSequenceDiffBest causing noms log to hang (#2153)
First: diff wasn't checking whether it had stopped before sending the
final set of changes. If the caller had stopped - and therefore no
longer reading from the changes channel - diff would hang.

Second: the same close channel was being used on 2 threads and it was
possible for both to read the close signal - causing the other to hang.
2016-07-26 14:09:20 -07:00
cmasone-attic 72e134bf85 Merge pull request #2159 from vinibaggio/dynamo-store-accepts-aws-config
go/chunks: adds convenience constructor for DynamoStore.
2016-07-26 13:45:30 -07:00
Vinicius Baggio Fuentes 9e7f1aaef7 go/chunks: changes convenience constructor for DynamoStore.
The convenience constructor changed in this patch takes in a aws.Config
object directly. This allows any implementation of the mentioned interface
to be passed in to Noms's Dynamo store -- giving flexibility for client
code to add their own credential acquisition mechanisms, for instance.

[fixes #2151]
2016-07-26 11:52:09 -07:00
Aaron Boodman f6b368b8db Update cli-tour.md 2016-07-25 15:51:49 -07:00
Erik Arvidsson 97093afa8c Rename csv StringToType to StringToValue (#2154) 2016-07-25 14:46:11 -07:00
Erik Arvidsson fcf9161d6a Include the meta field when pulling (#2152)
We need to also pull over the meta field. The references in meta are
already getting pulled over by `Chunks()`. If we do not pull over the
meta field we get a different commit value, with a different hash
which leads to newer pulls not being able to merge cleanly.

Fixes #2112
2016-07-25 14:28:04 -07:00
Aaron Boodman 9c059345e1 Update README.md 2016-07-25 14:14:48 -07:00
Rafael Weinstein b57377c1ed Chunk over value (non-type) serialization bytes (#2130)
Chunk over value (non-type) serialization bytes
2016-07-25 11:02:26 -07:00
Aaron Boodman cabc7aeb8c Emit more information when version check fails (#2145) 2016-07-24 22:34:30 -07:00
Aaron Boodman 4458091ad3 Update README.md 2016-07-24 18:27:27 -07:00
Aaron Boodman a23052a1dd csv-import: add flexibility to handling of numbers and booleans (#2141)
* Default empty csv cells to reasonable values.

It would probably be better to have more control over this, or even
better, some kind of 'null' value. But I think this is perfectly
reasonable initial behavior, and much more compatible with other
code.

* Support more spellings of "true" and "false"

* csv-import: provide more helpful value parse errors
2016-07-23 23:01:38 -07:00
Ben Kalman 270ba908cd Introduce samples/go/blob-get, utility which downloads a noms blob (#2127)
... from a noms database. Right now it's very slow (< 100kb/s).
2016-07-22 17:50:33 -07:00
Dan Willhite 27848fbe02 Merge pull request #2124 from willhite/work
Treat diffing of structs of different types, like maps
2016-07-22 15:37:12 -07:00
Dan Willhite c12402668a Treat diffing of structs of different types, like maps. (#2062) 2016-07-22 14:49:51 -07:00
Erik Arvidsson ed5f913014 JS: Fix cyclic dependency (#2129)
Lazily create valueCommitType too.
2016-07-22 14:00:33 -07:00
Ben Kalman b68f8eb309 Make diff depth first, fix error handling (#2125)
This fixes several diff-is-slow and log-is-slow bugs, and a bug where
diff was hanging in some error conditions.
2016-07-22 12:55:59 -07:00
Erik Arvidsson cb8d44b3f9 Merge pull request #2120 from arv/commit-no-meta
Commit type should always have a meta field
2016-07-21 18:29:45 -07:00
Erik Arvidsson 68e92092e5 Commit type: Inner parents struct should also have meta
This changes so that all commit struct types have a meta field
(which might be an empty struct).

Increment the serialization version since the old data does not
necessarily have the meta field.

Fixes ##2112
2016-07-21 18:25:17 -07:00
Erik Arvidsson 1ef3eb5cfa Add EqualsIgnoreHashes
Fixes #2077
2016-07-21 18:24:45 -07:00
Ben Kalman 0a176caa3d Write a new ordered diff algorithm that combines top-down and left-right (#2110)
The left-right diff is expected to return results earlier, whereas the
top-down approach is faster overall. This new diff algorithm runs both:
- early results are returned from the left-right diff.
- if/when top-down catches up, left-right is stopped and the rest of the
  changes are returned from top-down.
2016-07-21 15:40:05 -07:00
Aaron Boodman 521e120c74 Fix double-escaping in csv.Read. (#2122)
Fixes #2109
2016-07-21 15:33:35 -07:00
Rafael Weinstein 717745f2fc Refactor sequence_chunker.Done() (#2076)
Go SequenceChunker Refactor
2016-07-21 14:51:32 -07:00
Aaron Boodman f5b8b9f248 Don't escape the zero character in struct fields (#2121)
Toward #2109
2016-07-21 14:05:33 -07:00
Erik Arvidsson 44052aaa5d Add another test for subtypes with empty structs (#2118) 2016-07-21 13:15:55 -07:00
zcstarr d23efba595 paths: encode number keys without exponential encoding (#2101)
* changes here change Path index encoding from exponential to straight integer numeric format

* added flag to hrsWriter to support different float encoding formats per suggestion

* changes here consolidate encoded value logic and leave it up to the producers of hrsWriter to specify the floatFormat
2016-07-21 12:45:59 -07:00
Dan Willhite c9c5cc8340 Merge pull request #2117 from willhite/commit-fix
Simplify basic commit type for validation check
2016-07-21 12:41:32 -07:00