• Show log

    Commit

  • Hash : d8233feb
    Author : Patrick Steinhardt
    Date : 2019-10-18T09:24:14

    reflog: allow adding entries with newlines in their message
    
    Currently, the reflog disallows any entries that have a message with
    newlines, as that would effectively break the reflog format, which may
    contain a single line per entry, only. Upstream git behaves a bit
    differently, though, especially when considering stashes: instead of
    rejecting any reflog entry with newlines, git will simply replace
    newlines with spaces. E.g. executing 'git stash push -m "foo\nbar"' will
    create a reflog entry with "foo bar" as entry message.
    
    This commit adjusts our own logic to stop rejecting commit messages with
    newlines. Previously, this logic was part of `git_reflog_append`, only.
    There is a second place though where we add reflog entries, which is the
    serialization code in the filesystem refdb. As it didn't contain any
    sanity checks whatsoever, the refdb would have been perfectly happy to
    write malformatted reflog entries to the disk. This is being fixed with
    the same logic as for the reflog itself.
    

  • 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