• Show log

    Commit

  • Hash : 0b5ba0d7
    Author : Edward Thomson
    Date : 2019-06-06T16:36:23

    Rename opt init functions to `options_init`
    
    In libgit2 nomenclature, when we need to verb a direct object, we name
    a function `git_directobject_verb`.  Thus, if we need to init an options
    structure named `git_foo_options`, then the name of the function that
    does that should be `git_foo_options_init`.
    
    The previous names of `git_foo_init_options` is close - it _sounds_ as
    if it's initializing the options of a `foo`, but in fact
    `git_foo_options` is its own noun that should be respected.
    
    Deprecate the old names; they'll now call directly to the new ones.
    

  • README.md

  • Writing Clar tests for libgit2

    For information on the Clar testing framework and a detailed introduction please visit:

    https://github.com/vmg/clar

    • Write your modules and tests. Use good, meaningful names.

    • Make sure you actually build the tests by setting:

        cmake -DBUILD_CLAR=ON build/
    • Test:

        ./build/libgit2_clar
    • Make sure everything is fine.

    • Send your pull request. That’s it.

    Memory leak checks

    These are automatically run as part of CI, but if you want to check locally:

    Linux

    Uses valgrind:

    $ cmake -DBUILD_CLAR=ON -DVALGRIND=ON ..
    $ cmake --build .
    $ valgrind --leak-check=full --show-reachable=yes --num-callers=50 --suppressions=../libgit2_clar.supp \
      ./libgit2_clar

    macOS

    Uses leaks, which requires XCode installed:

    $ MallocStackLogging=1 MallocScribble=1 MallocLogFile=/dev/null CLAR_AT_EXIT="leaks -quiet \$PPID" \
      ./libgit2_clar