git-js icon indicating copy to clipboard operation
git-js copied to clipboard

git.log should support single string format

Open drschwabe opened this issue 3 years ago • 1 comments

Git offers a set of built-in single string formats ie- 'oneline, short, full, fuller' so git-js's git.log fn's format option should likewise adopt this shortcut to return the set of key/values which correspond to each said format.

git.log({ format : 'fuller'})

would return Git's 'fuller' set of values; from pretty-formats.txt

commit <hash>
Author:     <author>
AuthorDate: <author-date>
Commit:     <committer>
CommitDate: <committer-date>

(as a JS obj)

drschwabe avatar Jan 03 '23 23:01 drschwabe

Thanks for the suggestion. If you're up for submitting a pull request, the options are currently parsed in https://github.com/steveukx/git-js/blob/d84dd63812f42d3502fcc6f623998623a322b20b/simple-git/src/lib/tasks/log.ts#L93

steveukx avatar Sep 23 '23 13:09 steveukx