diff --git a/docs/parsers/git_log_s.md b/docs/parsers/git_log_s.md index 1bee665f..1ee737cb 100644 --- a/docs/parsers/git_log_s.md +++ b/docs/parsers/git_log_s.md @@ -8,6 +8,23 @@ jc - JSON Convert `git log` command output streaming parser > This streaming parser outputs JSON Lines (cli) or returns an Iterable of Dictionaries (module) +Can be used with the following format options: +- `oneline` +- `short` +- `medium` +- `full` +- `fuller` + +Additional options supported: +- `--stat` +- `--shortstat` + +The `epoch` calculated timestamp field is naive. (i.e. based on the +local time of the system the parser is run on) + +The `epoch_utc` calculated timestamp field is timezone-aware and is +only available if the timezone field is UTC. + Usage (cli): $ git log | jc --git-log-s @@ -23,7 +40,24 @@ Usage (module): Schema: { - "git_log_s": string, + "commit": string, + "author": string, + "author_email": string, + "date": string, + "epoch": integer, [0] + "epoch_utc": integer, [1] + "commit_by": string, + "commit_by_email": string, + "commit_by_date": string, + "message": string, + "stats" : { + "files_changed": integer, + "insertions": integer, + "deletions": integer, + "files": [ + string + ] + } # below object only exists if using -qq or ignore_exceptions=True "_jc_meta": { @@ -33,14 +67,14 @@ Schema: } } + [0] naive timestamp if "date" field is parsable, else null + [1] timezone aware timestamp availabe for UTC, else null + Examples: $ git log | jc --git-log-s - {example output} - ... - - $ git log | jc --git-log-s -r - {example output} + {"commit":"a730ae18c8e81c5261db132df73cd74f272a0a26","author":"Kelly...} + {"commit":"930bf439c06c48a952baec05a9896c8d92b7693e","author":"Kelly...} ... diff --git a/jc/parsers/git_log_s.py b/jc/parsers/git_log_s.py index d321928a..0687a9cd 100644 --- a/jc/parsers/git_log_s.py +++ b/jc/parsers/git_log_s.py @@ -3,6 +3,23 @@ > This streaming parser outputs JSON Lines (cli) or returns an Iterable of Dictionaries (module) +Can be used with the following format options: +- `oneline` +- `short` +- `medium` +- `full` +- `fuller` + +Additional options supported: +- `--stat` +- `--shortstat` + +The `epoch` calculated timestamp field is naive. (i.e. based on the +local time of the system the parser is run on) + +The `epoch_utc` calculated timestamp field is timezone-aware and is +only available if the timezone field is UTC. + Usage (cli): $ git log | jc --git-log-s @@ -18,7 +35,24 @@ Usage (module): Schema: { - "git_log_s": string, + "commit": string, + "author": string, + "author_email": string, + "date": string, + "epoch": integer, [0] + "epoch_utc": integer, [1] + "commit_by": string, + "commit_by_email": string, + "commit_by_date": string, + "message": string, + "stats" : { + "files_changed": integer, + "insertions": integer, + "deletions": integer, + "files": [ + string + ] + } # below object only exists if using -qq or ignore_exceptions=True "_jc_meta": { @@ -28,14 +62,14 @@ Schema: } } + [0] naive timestamp if "date" field is parsable, else null + [1] timezone aware timestamp availabe for UTC, else null + Examples: $ git log | jc --git-log-s - {example output} - ... - - $ git log | jc --git-log-s -r - {example output} + {"commit":"a730ae18c8e81c5261db132df73cd74f272a0a26","author":"Kelly...} + {"commit":"930bf439c06c48a952baec05a9896c8d92b7693e","author":"Kelly...} ... """ import re diff --git a/man/jc.1 b/man/jc.1 index cbf9319a..32cad953 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -1,4 +1,4 @@ -.TH jc 1 2022-05-01 1.19.0 "JSON Convert" +.TH jc 1 2022-05-02 1.19.0 "JSON Convert" .SH NAME jc \- JSONifies the output of many CLI tools and file-types .SH SYNOPSIS