-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
A couple examples #932
A couple examples #932
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for helping with the examples, it's much appreciated!
For this round, I only took a cursory look and liked what I saw. However, there are a couple of bigger requests I need to make before I can wave this through.
- Please do not start commits with
gix:
- this will makecargo smart-release
unhappy. If it's a feature you'd like to advertise in the changelog, thefeat:
prefix can be used. - Please do not use
structuopt
- it has been integrated intoclap
for a while now and is used here already. Please take a look atsrc/plumbing/options/mod.rs
to get an idea how to do this.
When done, I think I can make all remaining changes myself and merge.
Thanks a lot!
- Implements some of the functionality provided by `git ls-tree`. - Given the additional parsing of arguments, copying what libgit2 did and use `structopt` as an additional dev-dependencies.
- A rather naive first cut.
- Also, output updated to be equivalent to the one produced by running `git log --full-history <commit> <path>`. - Shouldn't have mixed author/commit time (it was always author time being displayed by default).
- Unless reverse is required - the git log DAG is unidirectional, the whole graph must be read in order for it to be reversed - libgit2 does this internally when the `GIT_SORT_REVERSE` is specified. See: https://github.com/libgit2/libgit2/blob/v1.6.4/src/libgit2/revwalk.c#L659-L669 - Include some comments that might hopefully help future readers.
- This set of filters will report (non)merge commits by filtering out commits with min/max number of parents - Also refactored the path filter logic and restructure the layout of the code block plus add in comments to make fit as an example.
- Also remember to test for empty list of paths and permit that through the filter as `any()` returns false on empty - likewise this applies to the check on list of parent_ids.
950956d
to
bd59bbe
Compare
Thanks for the very prompt review. I reworked (rebased the changes to where they belong, including the |
55efb98
to
6121b8f
Compare
…plications. Please note that these are just examples, which aren't necessarily production ready in terms of quality or performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the fixes!
I decided to put the examples to the top-level where they can use clap
naturally, which is also a nice differentiator between tiny examples in gix
and possibly larger examples in gitoxide
.
In any case, once CI is done this PR can be merged. Thanks again for contributing, I hope you have more ideas for examples and find time (and motivation) to implement them :).
This includes a couple examples based on the
git ls-tree
andgit log
command. I would have loved to include the--patch
flag, however I am completely unfamiliar with theimara-diff
library for generating diffs so I am going to leave that for someone else who might be more familiar with this, but I hope this is a good enough start to get that going.I did include
structopt
as an additionaldev-dependencies
to make passing CLI arguments more ergonomic.