Repository navigation
Say which copy of a session you are reading, and pick one with -a everywhere - #21
Merged
Merged
Conversation
…-a everywhere A session copied between accounts keeps its id, and the commands that read one session disagreed about how to choose a copy: show took -a, log, export and view rejected it, and none of them said which copy they had picked. `ccli log 1087b979 -a default` failed with "flag provided but not defined". show, log, export and view now all take -a <account>, which means the same as writing <account>:<id>; naming two different accounts is refused, and an unknown account is reported. Without one they use the copy with the latest activity, as before, and now say on stderr which copy that is and how to pick another. view without an id takes -a as a filter on its list, as the list commands do. A copy's turn list explained nothing about its blank costs. log now writes `copied` in the COST column of the turns that came in with a copy or a fork, from the ledger's byte ranges, and a line under the table names where they came from and where their usage counts. show's copies section says the same in one line. The README gains a "Sessions, copies and accounts" reference: what an account, session, copy, fork, turn and agent are, how to name each, and for every command what it works on and what -a means there. The tutorial and DESIGN.md follow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A session copied between accounts keeps its id.
showtook-ato pick a copy, butlog,exportandviewrejected it (ccli log 1087b979 -a defaultfailed), and none of them said which copy they had chosen.show,log,exportandviewall take-a <account>, the same as writing<account>:<id>. Naming two different accounts is refused; an unknown account is reported.viewwithout an id takes-aas a list filter, like the list commands.ccli log, turns that came in with a copy or a fork showcopiedin the COST column, and a line under the table says where they came from and where their usage counts (from the ledger's byte ranges, so only for copies ccli made).show's copies section says the same in one line.-ameans. Tutorial and DESIGN.md follow.Test plan
go vet ./...,gofmt -l .,go test ./...-a;log -a workmarking copied turns andlog default:<id>not; conflicting accounts refused; unknown account refused; notes for a copy and a fork.ccli log 1087b979names the talcum copy and marks turns 1 to 99 as copied from default;ccli log 1087b979 -a defaultreads default's copy;-a defaultwithtalcum:1087b979is refused.-hof every list command shows-aas documented.