ontodev/cogs

Smooth some rough edges

jamesaoverton opened this issue · 3 comments

I used cogs connect to connect to an existing Google Sheet with a "prefix" sheet. That was fine. Then I wanted to add that file to tests/prefix.tsv, but it was harder than I expected:

$ cogs add tests/prefix.tsv -t prefix
CRITICAL: 'tests/prefix.tsv' is neither an existing path nor an ignored sheet 
$ cogs add prefix
CRITICAL: 'prefix' is neither an existing path nor an ignored sheet
$ cogs fetch
$ cogs add prefix
$ ls prefix.tsv
ls: cannot access 'prefix.tsv': No such file or directory
$ cogs pull
$ ls prefix.tsv
prefix.tsv
$ cogs mv prefix.tsv tests/
prefix.tsv and tests/ both exist - 'mv' will overwrite the contents of tests/.
Do you wish to proceed? [y/n] n
$ cogs mv prefix.tsv tests/prefix.tsv
$ ls tests/
prefix.tsv

I think a few things would have made this much easier:

  1. cogs connect should run fetch
  2. cogs add tests/prefix.tsv -t prefix should just work
  3. maybe since tests/prefix.tsv doesn't exist locally cogs add should fetch it
  4. cogs mv prefix.tsv tests/ should see that tests/ is a directory and move the file into it rather than overwriting

When you say fetch, do you mean pull? If we just fetch, there will be no local copies, only the remote tracked copies in the .cogs directory.

Currently cogs connect does not know about tracked or ignored sheets, so you can’t cogs add as I expected, until you run cogs fetch.

OK - that makes sense to me. Number 3, I think, we should hold off on. Maybe just add to the docs that you should fetch or pull after adding an ignored sheet, just in case the user doesn't want to fetch everything for some reason.