You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As is it stands currently we shell out to git-log when calling sno log. This means we are limited to the settings git-log supports for creating machine-readable log output, namely, --pretty. Current log output for machine consumption is generated with the following git-log arguments
const prettyFormat = [
"%H", // SHA
"%h", // short SHA
"%s", // summary
"%b", // body
// author identity string, matching format of GIT_AUTHOR_IDENT.
// author name <author email> <author date>
// author date format dependent on --date arg, should be raw
"%an <%ae> %ad",
"%cn <%ce> %cd",
"%P", // parent SHAs,
"%(trailers:unfold,only)",
].join(`%x${delimiter}`);
Currently, everything in prettyFormat is parsed out of a commit, except for the trailers, trailers are currently ignored.
Problems with --pretty
It is only aware of git concepts so we can't extract any sno specific information (ie also show me which datasets have been modified in this commit)
It's a pretty esoteric format
We can't extend it because it's part of git-log
I don't have any thoughts or opinions on how this should be done at this stage, or what format would be better. This is just to collect issues that need to be resolved as part of improving what machine-readable information we can pull out.
Problems found through usage
We want the ability to commits differently depending on their "location", ie whether they are a new commit and have not been pushed, or a commit that has been pushed, or a commit that has been fetched and not merged. Currently, this is handled by performing 3x calls to sno log filtering the commits by that criteria and merging the results
There's no way to extract this information with --pretty. Something workable is to include --stat and then parse the stat information but it' pretty awful, delimiters aren't in the right places so the stat output ends up on the wrong line and it's human-readable text
The text was updated successfully, but these errors were encountered:
machine readability is handled with -o json, and --dataset-changes
three simultaneous calls to log is not ideal, but not the worst either. A single call to kart log will suffice if you are willing to parse the parents to split it into three parts. It's tricky (and not git-standard) to find another way to output logs that not only makes parsing easier, but also works well for edge cases like multiple merge-parent candidates.
As is it stands currently we shell out to git-log when calling
sno log
. This means we are limited to the settingsgit-log
supports for creating machine-readable log output, namely,--pretty
. Current log output for machine consumption is generated with the followinggit-log
arguments--stat --date=raw -z --no-show-signature --no-color --pretty=${prettyFormat}
.Currently, everything in
prettyFormat
is parsed out of a commit, except for the trailers, trailers are currently ignored.Problems with
--pretty
I don't have any thoughts or opinions on how this should be done at this stage, or what format would be better. This is just to collect issues that need to be resolved as part of improving what machine-readable information we can pull out.
Problems found through usage
sno log
filtering the commits by that criteria and merging the results--pretty
. Something workable is to include--stat
and then parse the stat information but it' pretty awful, delimiters aren't in the right places so the stat output ends up on the wrong line and it's human-readable textThe text was updated successfully, but these errors were encountered: