refs: Centralize reference creation logic
refs: Introduce git_reference_create_with_log()
refs: Introduce git_reference_symbolic_create_with_log()
refs: Introduce git_reference_set_target_with_log()
refs: Introduce git_reference_symbolic_set_target_with_log()
refs: adjust to the new reflog API
refdb: add a `message` parameter for appending to the log

This is as yet unused.
reflog: integrate into the ref writing

Whenever a reference is created or updated, we need to write to the
reflog regardless of whether the user gave us a message, so we shouldn't
leave that to the ref frontend, but integrate it into the backend.

This also eliminates the race between ref update and writing to the
reflog, as we protect the reflog with the ref lock.

As an additional benefit, this reflog append on the backend happens by
appending to the file instead of parsing and rewriting it.
reflog: remove git_reflog_append_to()

This was a convenience method for the refs front-end to do the reflog
writing. This is now done in the backend and it has no more reason for
being.
fix typos in docs
Merge pull request #1975 from nikai3d/patch-2

fix typos in docs
Improve iconv finding for cmake

* add FindIconv helper for CMake iconv detection
* only default using iconv to ON for MacOS
* update pkg-config generation to include iconv dependency better
Merge pull request #1978 from libgit2/rb/cmake-find-iconv

Improve iconv finding for cmake
Fix bug making split deltas a COPIED targets

When FIND_COPIES is used in combination with BREAK_REWRITES for
rename detection, there was a bug where the split MODIFIED delta
was only used as a target for RENAME records and not for COPIED
records.  This fixes that, converting the split into a pair of
DELETED and COPIED deltas when that circumstance arises.
Add GIT_DIFF_FIND_DELETE_UNMODIFIED flag

When doing copy detection, it is often necessary to include
UNMODIFIED records in the git_diff so they are available as source
records for GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED.  Yet in the final
diff, often you will not want to have these UNMODIFIED records.
This adds a flag which marks these UNMODIFIED records for deletion
from the diff list so they will be removed after the rename detect
phase is over.
GIT_DIFF_FIND_REMOVE_UNMODIFIED sounds better
Merge pull request #1979 from libgit2/rb/diff-find-delete-unmod

Add GIT_DIFF_FIND_REMOVE_UNMODIFIED flag and fix copy detection bug
Introduce git_revert to revert a single commit
clean up state metadata more consistently
Updates to cancellation logic during download and indexing of packfile.