libgit2 icon indicating copy to clipboard operation
libgit2 copied to clipboard

issue #3751 (Function to parse author and committer information from environment)

Open cpoerschke opened this issue 6 years ago • 3 comments

work-in-progress for issue #3751 (Function to parse author and committer information from environment)

cd build
cmake --build . && ./libgit2_clar -v -srepo::init

cpoerschke avatar Nov 12 '17 11:11 cpoerschke

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:

  1. completion of the include/git2/signature.h changes
  2. addition of the new APIs in CHANGELOG.md
  3. revisions in response to pull request (continuous integration and/or human) code review feedback

cpoerschke avatar Nov 13 '17 13:11 cpoerschke

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?

cpoerschke avatar Dec 22 '17 18:12 cpoerschke

I agree that this looks unrelated - I'll restart the AppVeyor build so that it passes and will review this soon. Thanks! 😁

ethomson avatar Dec 23 '17 10:12 ethomson