-
Notifications
You must be signed in to change notification settings - Fork 897
Support only_follow_first_parent #1190
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
Conversation
CI builds are failing because I didn't configure a user for the test, so it can't sign commits; will fix and update. |
8ccbca4
to
f29f226
Compare
{ | ||
string path = SandboxStandardTestRepo(); | ||
string configPath = CreateConfigurationWithDummyUser(Constants.Identity); | ||
var options = new RepositoryOptions { GlobalConfigurationLocation = configPath }; |
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.
You shouldn't need the two lines above
Very clean PR
Thanks a lot for asking ❤️ Indeed, we tend to prefer cohesive (tests + new feature) commits. Once we agree on the content of the PR, before the merge, I'll eventually request you to squash them together. |
Thanks for the review, @nulltoken! I hadn't spotted Constants.Signature but I agree that that's a better way to get a signature. Will incorporate this change on Monday when I'm at the customer site where I need this. Regarding the |
@ninjeff Using |
f29f226
to
bd2f790
Compare
@nulltoken Pull request updated with stable commit IDs as discussed. Should I go ahead with squashing the commits? |
👍 |
The GitDescribeOptions struct used by git_describe_commit has an OnlyFollowFirstParent field, which corresponds to the --first-parent option in command-line Git. This commit adds the same option as a new property on the DescribeOptions class, with XML documentation from Git docs.
bd2f790
to
758f428
Compare
Done |
Support only_follow_first_parent
🎉 |
@ninjeff Awesome contribution. Thanks! ❤️ |
@nulltoken Thanks for merging! Looking forward to seeing it in a release 🚢 |
@ninjeff 🚢d Published as NuGet pre-release package |
Good stuff 👍 |
My team has been using
git describe --first-parent
to find the most recent tag on the current branch, allowing us to mine the following commits on that branch for issue IDs in our issue tracker. We recently switched to libgit2sharp, but discovered that the equivalent option from libgit2 (only_follow_first_parent
) is not supported in libgit2sharp - false is always passed for this struct field.This pull request adds an
OnlyFollowFirstParent
property toDescribeOptions
and a corresponding test.I've split the changes across three commits (adding the property, adding a failing test that uses the property, and adding the implementation) to support verifying that the test exercises the implementation. If this is excessive then let me know and I'll squash the changes into one commit.