libgit2
libgit2 copied to clipboard
issue #3751 (Function to parse author and committer information from environment)
work-in-progress for issue #3751 (Function to parse author and committer information from environment)
cd build
cmake --build . && ./libgit2_clar -v -srepo::init
Hi @neshang - it was nice to meet you at the hackathon yesterday and to collaborate on the #3751 issue. Thanks especially for spotting that the initial git_signature_..._env
implementations did not work if only one of GIT_..._NAME
and GIT_..._EMAIL
was supplied -- this in test-driven-development (TDD) sort of style is now reflected in the test_repo_init__init_with_initial_commit_with_env_author_name_only
and test_repo_init__init_with_initial_commit_with_env_author_email_only
tests.
With the latest batch of commits the test failures we were debugging at the end of the hackathon are now also fixed: the problem was with the test code itself i.e. if test A sets an environment variable then it also needs to unset (or reset) it afterwards or else test B (running after test A) could fail if it assumes that the environment variable concerned is unset.
Also now present is some test coverage for the git_signature_committer_env
function, though I'm not sure if the
static void impl_test_repo_init__init_with_initial_commit(
...
int (*git_signature_func)(git_signature **out, git_repository *repo))
function pointer way of implementing that is perhaps a little too fancy a solution.
Next steps:
- completion of the
include/git2/signature.h
changes - addition of the new APIs in
CHANGELOG.md
- revisions in response to pull request (continuous integration and/or human) code review feedback
Pull request now updated to include docs in signature.h and CHANGELOG.md entry. Yet to look fully at the 'AppVeyor build failed' partial failure, from a quick look it seems unrelated?
I agree that this looks unrelated - I'll restart the AppVeyor build so that it passes and will review this soon. Thanks! 😁