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

Log formatting options #544

Merged
merged 3 commits into from
Jan 25, 2022
Merged

Log formatting options #544

merged 3 commits into from
Jan 25, 2022

Conversation

craigds
Copy link
Member

@craigds craigds commented Jan 17, 2022

Description

Expands the --output-format / -o flag to handle format/style modifiers, and deprecates --json-style=compact which was used for JSON output specifically.

e.g. these are now supported:

  • --output-format=text (same as default)
  • --output-format=text:%H
  • --output-format=text:oneline
  • --output-format=json:compact
  • --output-format=json:pretty
  • --output-format=json (same as pretty)

the text modifiers are only available in log at present (todo: we should add them to show at some point) but the json ones are available in all commands that json is accepted

Related links:

Checklist:

  • Have you reviewed your own change?
  • Have you included test(s)?
  • Have you updated the changelog?

@craigds craigds changed the title Log pretty Log formatting options Jan 17, 2022
@craigds craigds requested a review from olsen232 January 25, 2022 23:06
* Deprecate `--json-style` option, except in `create-patch`.
* Accept json style in `--output-format`, e.g. `-o json:compact`
* For `log` only, accept text formatstring in `--output-format`, e.g.
  * `-o text:oneline`
  * `-o text:%H` (show only hashes)
  * passed directly to git, so see 'PRETTY FORMATS' in `git help log`

`--json-style` is still accepted but deprecated with a warning.

Fixes #542
@craigds craigds merged commit 2d3fa79 into master Jan 25, 2022
@craigds craigds deleted the log-pretty branch January 25, 2022 23:13
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

Successfully merging this pull request may close these issues.

log: output formatting options
2 participants