• Show log

    Commit

  • Hash : 9679df57
    Author : lhchavez
    Date : 2020-02-08T20:47:24

    mwindow: set limit on number of open files
    
    There are some cases in which repositories accrue a large number of
    packfiles. The existing mwindow limit applies only to the total size of
    mmap'd files, not on their number. This leads to a situation in which
    having lots of small packfiles could exhaust the allowed number of open
    files, particularly on macOS, where the default ulimit is very low
    (256).
    
    This change adds a new configuration parameter
    (GIT_OPT_SET_MWINDOW_FILE_LIMIT) that sets the maximum number of open
    packfiles, with a default of 128. This is low enough so that even macOS
    users should not hit it during normal use.
    
    Based on PR #5386, originally written by @josharian.
    
    Fixes: #2758
    

  • 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