iterative / ldb

Apache License 2.0
3 stars 0 forks source link

ADD: includes duplicate objects into the count of "added" #128

Open volkfox opened 2 years ago

volkfox commented 2 years ago

Cosmetic issue. Reproduction: we instantiate a dataset and add workspace, it reports all objects as "added" despite the fact they were not added (duplicates).

$ ldb instantiate
Instantiating working dataset ds:cats...

Copied dataset to workspace.
  Data objects:         5
  Annotations:          1

dkh$ ldb add ./
Adding to working dataset...
Added 5 data objects to ds:cats

^^^^^

But...

$ ldb status
Workspace directory: '.'

ds:cats
  Num data objects:        5
  Num annotations:         1

No unsaved changes.
jonburdo commented 2 years ago

The output has since been changed to show only the number of newly added items. But now we don't see the number of selected items (i.e. if 5 items are selected, but they are all in the working dataset already, then we just show 0). So to show complete output, we should show selected and added counts for data objects and annotations, similar to the way ldb index show found and new files:

$ ldb add ./
Adding to working dataset...
  Selected data objects:      5
  Selected annotations:       5
  New data objects:           0
  New annotations:            0