Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve kart log --help #493

Open
craigds opened this issue Oct 25, 2021 · 1 comment
Open

Improve kart log --help #493

craigds opened this issue Oct 25, 2021 · 1 comment

Comments

@craigds
Copy link
Member

craigds commented Oct 25, 2021

kart log seems a pretty important command but the docs are lacking:

$ kart log --help
Usage: kart log [OPTIONS] [ARGS]...

  Show commit logs

Options:
  -o, --output-format [text|json|json-lines]
  --json-style [extracompact|compact|pretty]
                                  How to format the output. Only used with
                                  --output-format=json

  --with-feature-count [veryfast|fast|medium|good|exact]
                                  Adds a 'feature_count' (the number of
                                  features modified in this diff) to JSON
                                  output.If the value is 'exact', the feature
                                  count is exact (this may be slow.)
                                  Otherwise, the feature count will be
                                  approximated with varying levels of
                                  accuracy.

  --help                          Show this message and exit.

This is because it's a thin wrapper of git log, so we didn't implement any args really, we just pass whatever we're given on to git log.

We should probably either:

  • parse the args/options using click, just so they show up properly in the help text.
  • override the help text function so it displays meaningful args even though we're not parsing them
@craigds
Copy link
Member Author

craigds commented Nov 18, 2021

Seems like the best option is to stop forwarding unknown arguments to git log, and instead parse the whole command line (with a subset of the options git supports), and throw usage errors for unknown options.

Many of the git log options make no sense in a kart context, and supporting them just means we can't stop forwarding to git later (which we'll almost certainly want to do.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant