]> git.proxmox.com Git - libgit2.git/log
libgit2.git
10 years agoindexer: do multiple passes over the delta list
Carlos Martín Nieto [Wed, 2 Oct 2013 10:22:54 +0000 (12:22 +0200)]
indexer: do multiple passes over the delta list

Though unusual, a packfile may contain a delta whose base is a delta
that comes later. In order index such a packfile, we must not give up
on the first failure to resolve a delta, but keep it around.

If there is a pass which makes no progress, this indicates that the
packfile is broken, so fail accordingly.

11 years agoMerge pull request #1885 from ethomson/transport_register
Vicent Martí [Tue, 1 Oct 2013 21:00:30 +0000 (14:00 -0700)]
Merge pull request #1885 from ethomson/transport_register

Add git_transport_register, git_transport_unregister

11 years agoAdd git_transport_register, git_transport_unregister
Philip Kelley [Fri, 4 Jan 2013 19:39:05 +0000 (14:39 -0500)]
Add git_transport_register, git_transport_unregister

11 years agoMark git__timer as inline on OSX
Ben Straub [Tue, 1 Oct 2013 19:56:47 +0000 (12:56 -0700)]
Mark git__timer as inline on OSX

11 years agoMerge pull request #1882 from linquize/config-subsection-fix
Vicent Martí [Tue, 1 Oct 2013 12:54:54 +0000 (05:54 -0700)]
Merge pull request #1882 from linquize/config-subsection-fix

Config subsection name should allow to have ']' and '\\' should allow to escape any characters

11 years agoAdd negative test cases for config header with invalid characters
Linquize [Tue, 1 Oct 2013 01:46:56 +0000 (09:46 +0800)]
Add negative test cases for config header with invalid characters

11 years agoAdd test case to test ']' and '\\' characters in config subsection
Linquize [Mon, 30 Sep 2013 15:58:58 +0000 (23:58 +0800)]
Add test case to test ']' and '\\' characters in config subsection

11 years agoConfig subsection name should allow to have ']' and '\\' should allow to escape any...
Linquize [Mon, 30 Sep 2013 15:38:22 +0000 (23:38 +0800)]
Config subsection name should allow to have ']' and '\\' should allow to escape any characters

11 years agoMerge pull request #1879 from libgit2/redir-refactor
Vicent Martí [Mon, 30 Sep 2013 22:03:35 +0000 (15:03 -0700)]
Merge pull request #1879 from libgit2/redir-refactor

Redir refactor

11 years agoMerge pull request #1412 from jamill/push_progress
Vicent Martí [Mon, 30 Sep 2013 21:58:45 +0000 (14:58 -0700)]
Merge pull request #1412 from jamill/push_progress

Initial Implementation of progress reports during push

11 years agoMerge pull request #1881 from libgit2/ignore-submodules-in-stash
Vicent Martí [Mon, 30 Sep 2013 21:57:48 +0000 (14:57 -0700)]
Merge pull request #1881 from libgit2/ignore-submodules-in-stash

Never consider submodules for stashing

11 years agoEnsure submodule repos and indices are freed
Ben Straub [Mon, 30 Sep 2013 21:47:56 +0000 (14:47 -0700)]
Ensure submodule repos and indices are freed

...before the helper's cleanup method tries to delete their files.

11 years agoMerge pull request #1878 from libgit2/ntk/fix/warnings
Vicent Martí [Mon, 30 Sep 2013 19:18:19 +0000 (12:18 -0700)]
Merge pull request #1878 from libgit2/ntk/fix/warnings

Fix x86/x64 size_t related warnings

11 years agoInitial Implementation of progress reports during push
Jameson Miller [Thu, 19 Sep 2013 18:52:57 +0000 (14:52 -0400)]
Initial Implementation of progress reports during push

This adds the basics of progress reporting during push. While progress
for all aspects of a push operation are not reported with this change,
it lays the foundation to add these later. Push progress reporting
can be improved in the future - and consumers of the API should
just get more accurate information at that point.

The main areas where this is lacking are:

1) packbuilding progress: does not report progress during deltafication,
   as this involves coordinating progress from multiple threads.

2) network progress: reports progress as objects and bytes are going
   to be written to the subtransport (instead of as client gets
   confirmation that they have been received by the server) and leaves
   out some of the bytes that are transfered as part of the push protocol.
   Basically, this reports the pack bytes that are written to the
   subtransport. It does not report the bytes sent on the wire that
   are received by the server. This should be a good estimate of
   progress (and an improvement over no progress).

11 years agoMerge pull request #1883 from libgit2/ntk/fix/empty_first_commit_line
Vicent Martí [Mon, 30 Sep 2013 16:40:15 +0000 (09:40 -0700)]
Merge pull request #1883 from libgit2/ntk/fix/empty_first_commit_line

Remove leading newlines from commit message

11 years agocommit: Trim message leading newlines
nulltoken [Mon, 30 Sep 2013 09:30:28 +0000 (11:30 +0200)]
commit: Trim message leading newlines

Fix libgit2/libgit2sharp#522

11 years agoTabify indentations
nulltoken [Mon, 30 Sep 2013 09:18:06 +0000 (11:18 +0200)]
Tabify indentations

11 years agoTest that submodules don't affect stashing
Justin Spahr-Summers [Sat, 28 Sep 2013 04:39:28 +0000 (21:39 -0700)]
Test that submodules don't affect stashing

11 years agoNever consider submodules for stashing
Justin Spahr-Summers [Sat, 28 Sep 2013 00:07:06 +0000 (17:07 -0700)]
Never consider submodules for stashing

11 years agoMerge pull request #1880 from ethomson/refdb_h_oopsie
Vicent Martí [Fri, 27 Sep 2013 20:27:11 +0000 (13:27 -0700)]
Merge pull request #1880 from ethomson/refdb_h_oopsie

Add refdb.h to git2.h, reorder git2.h sanely

11 years agoAdd refdb.h to git2.h, reorder git2.h sanely
Edward Thomson [Fri, 27 Sep 2013 20:08:24 +0000 (16:08 -0400)]
Add refdb.h to git2.h, reorder git2.h sanely

11 years agoTighten up url-connection utility
Ben Straub [Thu, 26 Sep 2013 23:48:08 +0000 (16:48 -0700)]
Tighten up url-connection utility

11 years agoWHOOPS
Ben Straub [Thu, 26 Sep 2013 23:36:05 +0000 (16:36 -0700)]
WHOOPS

11 years agoMake sure utility doesn't leak memory
Ben Straub [Thu, 26 Sep 2013 23:25:34 +0000 (16:25 -0700)]
Make sure utility doesn't leak memory

11 years agoAdjust to new utility signature
Ben Straub [Thu, 26 Sep 2013 23:25:05 +0000 (16:25 -0700)]
Adjust to new utility signature

11 years agoDeploy gitno_connection_data into transport (winhttp)
Ben Straub [Thu, 26 Sep 2013 23:20:30 +0000 (16:20 -0700)]
Deploy gitno_connection_data into transport (winhttp)

...and have that call manage replaced memory in the output structure.

11 years agoDeploy gitno_connection_data into transport
Ben Straub [Thu, 26 Sep 2013 22:58:41 +0000 (15:58 -0700)]
Deploy gitno_connection_data into transport

11 years agoFix warnings
nulltoken [Thu, 26 Sep 2013 10:00:35 +0000 (12:00 +0200)]
Fix warnings

11 years agoRefactor URL handling to use library call
Ben Straub [Thu, 26 Sep 2013 18:03:27 +0000 (11:03 -0700)]
Refactor URL handling to use library call

11 years agoMigrate redirect URL handling to common utility
Ben Straub [Thu, 26 Sep 2013 03:41:56 +0000 (20:41 -0700)]
Migrate redirect URL handling to common utility

11 years agoWhy are we disabling redirects?
Ben Straub [Wed, 25 Sep 2013 21:25:38 +0000 (14:25 -0700)]
Why are we disabling redirects?

11 years agoMerge pull request #1877 from libgit2/win32-redirects
Ben Straub [Wed, 25 Sep 2013 21:12:07 +0000 (14:12 -0700)]
Merge pull request #1877 from libgit2/win32-redirects

Win32: handle http->https redirects

11 years agoMerge pull request #1876 from arrbee/fix-error-handling-docs
Vicent Martí [Wed, 25 Sep 2013 21:08:32 +0000 (14:08 -0700)]
Merge pull request #1876 from arrbee/fix-error-handling-docs

Bring error handling docs up to date

11 years agoWin32: handle http->https redirects
Ben Straub [Wed, 25 Sep 2013 19:13:09 +0000 (12:13 -0700)]
Win32: handle http->https redirects

11 years agoThe error handling docs are out of date
Russell Belfer [Wed, 25 Sep 2013 18:53:02 +0000 (11:53 -0700)]
The error handling docs are out of date

The error handling docs date back to the early error redesign
work and don't match up with the route we actually took.  This
brings them in line with actual practice both for external users
and internal implementors, and notes some of the exceptions and
possible bugs.

11 years agoMerge pull request #1875 from ethomson/refdb_not_odb
Vicent Martí [Wed, 25 Sep 2013 16:36:09 +0000 (09:36 -0700)]
Merge pull request #1875 from ethomson/refdb_not_odb

That's the refdb, it's not the odb...

11 years agoThat's the refdb, it's not the odb...
Edward Thomson [Wed, 25 Sep 2013 14:49:25 +0000 (10:49 -0400)]
That's the refdb, it's not the odb...

11 years agoMerge pull request #1873 from mikeando/doc_cleanup
Vicent Martí [Wed, 25 Sep 2013 08:41:17 +0000 (01:41 -0700)]
Merge pull request #1873 from mikeando/doc_cleanup

Cleaned up some tables in checkout-internals doc

11 years agoMerge pull request #1874 from mikeando/doc_cleanup2
Vicent Martí [Wed, 25 Sep 2013 08:40:43 +0000 (01:40 -0700)]
Merge pull request #1874 from mikeando/doc_cleanup2

Fixed formatting of diff-internals.md

11 years agoFixed formatting of diff-internals.md
Mike Anderson [Wed, 25 Sep 2013 03:14:06 +0000 (11:14 +0800)]
Fixed formatting of diff-internals.md

Indentation for lists was not working correctly.

11 years agoCleaned up some tables in checkout-internals doc
Mike Anderson [Tue, 24 Sep 2013 08:43:06 +0000 (16:43 +0800)]
Cleaned up some tables in checkout-internals doc

The markdown wasn't rendering correctly.

11 years agoMerge pull request #1872 from libgit2/config-isolate-xdg
Vicent Martí [Tue, 24 Sep 2013 22:55:51 +0000 (15:55 -0700)]
Merge pull request #1872 from libgit2/config-isolate-xdg

Make tests pass if XDG config exists

11 years agoMake tests pass if XDG config exists
Russell Belfer [Fri, 20 Sep 2013 23:58:04 +0000 (16:58 -0700)]
Make tests pass if XDG config exists

11 years agoMerge pull request #1871 from libgit2/cross-protocol-redirects-alt
Vicent Martí [Tue, 24 Sep 2013 22:21:44 +0000 (15:21 -0700)]
Merge pull request #1871 from libgit2/cross-protocol-redirects-alt

Alternative fix for cross protocol redirects

11 years agoPrevent HTTPS to HTTP redirect
Russell Belfer [Tue, 24 Sep 2013 21:50:06 +0000 (14:50 -0700)]
Prevent HTTPS to HTTP redirect

11 years agoDisconnect path string to preserve after redirect
Russell Belfer [Tue, 24 Sep 2013 21:07:08 +0000 (14:07 -0700)]
Disconnect path string to preserve after redirect

The subtransport path was relying on pointing to data owned by
the remote which meant that after a redirect, the updated path
was getting lost for future requests.  This updates the http
transport to strdup the path and maintain its own lifetime.

This also pulls responsibility for parsing the URL back into the
http transport and isolates the functions that parse and free that
connection data so that they can be reused between the initial
parsing and the redirect parsing.

11 years agoMerge pull request #1869 from ethomson/fs_iterator_race_2
Vicent Martí [Tue, 24 Sep 2013 19:01:24 +0000 (12:01 -0700)]
Merge pull request #1869 from ethomson/fs_iterator_race_2

Ignore files that disappear while iterating

11 years agoIgnore files that disappear while iterating
Edward Thomson [Tue, 24 Sep 2013 18:52:58 +0000 (14:52 -0400)]
Ignore files that disappear while iterating

On occasion, files can disappear while we're iterating the
filesystem, between calls to readdir and stat.  Let's pretend
those didn't exist in the first place.

11 years agoProperly parse urls that include protocol://
Ben Straub [Mon, 23 Sep 2013 18:37:35 +0000 (11:37 -0700)]
Properly parse urls that include protocol://

11 years agoAllow redirects to use same host
Ben Straub [Mon, 23 Sep 2013 19:09:23 +0000 (12:09 -0700)]
Allow redirects to use same host

11 years agoMerge pull request #1865 from arrbee/various-cleanups
Vicent Martí [Tue, 24 Sep 2013 17:32:40 +0000 (10:32 -0700)]
Merge pull request #1865 from arrbee/various-cleanups

Various warning cleanup and minor fixes

11 years agoMerge pull request #1864 from libgit2/minimize-regex-usage
Vicent Martí [Tue, 24 Sep 2013 17:30:43 +0000 (10:30 -0700)]
Merge pull request #1864 from libgit2/minimize-regex-usage

Minimize regex usage

11 years agoFix up filebuf tests a bit
Russell Belfer [Tue, 24 Sep 2013 17:20:16 +0000 (10:20 -0700)]
Fix up filebuf tests a bit

11 years agoFix incorrect return code in crlf filter
Russell Belfer [Tue, 24 Sep 2013 17:11:20 +0000 (10:11 -0700)]
Fix incorrect return code in crlf filter

The git_buf_text_gather_stats call returns a boolean indicating if
the file looks like binary data.  That shouldn't be an error; it
should be used to skip CRLF processing though.

11 years agoMerge pull request #1867 from ethomson/remove_not_delete
Russell Belfer [Tue, 24 Sep 2013 16:30:02 +0000 (09:30 -0700)]
Merge pull request #1867 from ethomson/remove_not_delete

'del' instead of 'delete' for the poor C++ users

11 years ago'del' instead of 'delete' for the poor C++ users
Edward Thomson [Tue, 24 Sep 2013 15:04:14 +0000 (11:04 -0400)]
'del' instead of 'delete' for the poor C++ users

11 years agoFix warnings in Makefile.embed
Russell Belfer [Tue, 24 Sep 2013 04:59:32 +0000 (21:59 -0700)]
Fix warnings in Makefile.embed

11 years agoClean up unnecessary git_buf_printf calls
Russell Belfer [Tue, 24 Sep 2013 04:52:42 +0000 (21:52 -0700)]
Clean up unnecessary git_buf_printf calls

This replaces some git_buf_printf calls with simple calls to
git_buf_put instead.  Also, it fixes a missing va_end inside
the git_buf_vprintf implementation.

11 years agoFix warnings on Windows 64-bit build
Russell Belfer [Mon, 23 Sep 2013 20:40:23 +0000 (13:40 -0700)]
Fix warnings on Windows 64-bit build

11 years agoClean up newly introduced warnings
Russell Belfer [Mon, 23 Sep 2013 20:34:01 +0000 (13:34 -0700)]
Clean up newly introduced warnings

The attempt to "clean up warnings" seems to have introduced some
new warnings on compliant compilers.  This fixes those in a way
that I suspect will also be okay for the non-compliant compilers.

Also this fixes what appears to be an extra semicolon in the
repo initialization template dir handling (and as part of that
fix, handles the case where an error occurs correctly).

11 years agoRemove regex usage from places that don't need it
Russell Belfer [Mon, 23 Sep 2013 20:31:15 +0000 (13:31 -0700)]
Remove regex usage from places that don't need it

In revwalk, we are doing a very simple check to see if a string
contains wildcard characters, so a full regular expression match
is not needed.

In remote listing, now that we have git_config_foreach_match with
full regular expression matching, we can take advantage of that
and eliminate the regex here, replacing it with much simpler string
manipulation.

11 years agoMerge pull request #1863 from linquize/typo
Vicent Martí [Sun, 22 Sep 2013 20:46:39 +0000 (13:46 -0700)]
Merge pull request #1863 from linquize/typo

Fix typo in documentation

11 years agomerge: reverse array and length parameter order
Carlos Martín Nieto [Sun, 22 Sep 2013 03:55:39 +0000 (05:55 +0200)]
merge: reverse array and length parameter order

Make it pair up with the one for commits. This fixes #1691.

11 years agoFix typo in documentation
Linquize [Sun, 22 Sep 2013 01:11:43 +0000 (09:11 +0800)]
Fix typo in documentation

11 years agoMerge pull request #1840 from linquize/warning
Vicent Martí [Sat, 21 Sep 2013 16:34:03 +0000 (09:34 -0700)]
Merge pull request #1840 from linquize/warning

Fix warning

11 years agoMerge pull request #1861 from ben/molo-valgrind
Vicent Martí [Fri, 20 Sep 2013 16:41:49 +0000 (09:41 -0700)]
Merge pull request #1861 from ben/molo-valgrind

OSX 10.8 + Valgrind

11 years agoMerge pull request #1859 from linquize/init.templatedir
Vicent Martí [Fri, 20 Sep 2013 16:22:19 +0000 (09:22 -0700)]
Merge pull request #1859 from linquize/init.templatedir

Make init.templatedir work

11 years agoCheck error value from git_futils_find_template_dir
Linquize [Fri, 20 Sep 2013 01:02:58 +0000 (09:02 +0800)]
Check error value from git_futils_find_template_dir

11 years agoSuppress noise from running Valgrind on OSX 10.8
Ben Straub [Thu, 19 Sep 2013 17:30:43 +0000 (10:30 -0700)]
Suppress noise from running Valgrind on OSX 10.8

11 years agoFix warning
Linquize [Sun, 8 Sep 2013 09:15:42 +0000 (17:15 +0800)]
Fix warning

11 years agoMake init.templatedir work
Linquize [Wed, 18 Sep 2013 15:06:10 +0000 (23:06 +0800)]
Make init.templatedir work

11 years agomsvc: No void* arithmetic on Windows
Vicent Marti [Wed, 18 Sep 2013 01:54:17 +0000 (03:54 +0200)]
msvc: No void* arithmetic on Windows

11 years agoMerge pull request #1860 from libgit2/cmn/indexer-hash
Vicent Martí [Wed, 18 Sep 2013 01:49:47 +0000 (18:49 -0700)]
Merge pull request #1860 from libgit2/cmn/indexer-hash

indexer: check the packfile trailer

11 years agoindexer: don't reiterate the class in the message
Carlos Martín Nieto [Wed, 18 Sep 2013 00:20:17 +0000 (02:20 +0200)]
indexer: don't reiterate the class in the message

11 years agoindexer: check the packfile trailer for correctness
Carlos Martín Nieto [Tue, 17 Sep 2013 15:44:05 +0000 (17:44 +0200)]
indexer: check the packfile trailer for correctness

The packfile trailer gets sent over and we should check whether it's
correct as part of our sanity checks of the packfile.

11 years agoMerge pull request #1858 from linquize/win32-template-dir
Vicent Martí [Tue, 17 Sep 2013 17:21:22 +0000 (10:21 -0700)]
Merge pull request #1858 from linquize/win32-template-dir

Configurable template dir for Win32

11 years agoMerge pull request #1847 from libgit2/filters-alternative
Vicent Martí [Tue, 17 Sep 2013 16:57:55 +0000 (09:57 -0700)]
Merge pull request #1847 from libgit2/filters-alternative

Alternative proposal for filter API

11 years agoUpdate clar and recreate cl_assert_equal_sz
Russell Belfer [Mon, 16 Sep 2013 22:08:35 +0000 (15:08 -0700)]
Update clar and recreate cl_assert_equal_sz

This updates clar to the version without cl_assert_equal_sz and
then adds a new version of that macro the clar_libgit2.h.  The new
version works around a strange issue that seemed to be arising on
release builds with VS 10 64-bit builds.

11 years agoBug fixes and cleanups
Russell Belfer [Mon, 16 Sep 2013 19:54:40 +0000 (12:54 -0700)]
Bug fixes and cleanups

This contains a few bug fixes and some header and API cleanups.

The main API change is that filters should now use GIT_PASSTHROUGH
to indicate that they wish to skip processing a file instead of
GIT_ENOTFOUND.

The bug fixes include a possible out-of-range buffer access in
the ident filter, a filter ordering problem I introduced into the
custom filter tests on Windows, and a filter buf NUL termination
issue that was coming up on Linux.

11 years agoMore filtering tests including order
Russell Belfer [Mon, 16 Sep 2013 05:23:39 +0000 (22:23 -0700)]
More filtering tests including order

This adds more tests of filters, including the ident filter when
mixed with custom filters.  I was able to combine with the reverse
filter and demonstrate that the order of filter application with
the default priority constants matches the order of core Git.

Also, this fixes two issues in the ident filter: preventing ident
expansion on binary files and avoiding a NULL dereference when
dollar sign characters are found without Id.

11 years agoSome tests with ident and crlf filters
Russell Belfer [Sat, 14 Sep 2013 04:43:00 +0000 (21:43 -0700)]
Some tests with ident and crlf filters

Fixed the filter order to match core Git, too.

This test demonstrates an interesting behavior of core Git (which
is totally reasonable and which libgit2 matches, although mostly
by coincidence).  If you use the ident filter and commit a file
with a garbage ident in it, like '$Id: this is just garbage$' and
then immediately do a 'git checkout-index' with the new file, Git
will not consider the file out of date and will not overwrite the
file with an updated $Id$.  Libgit2 has the same behavior.  If you
remove the file and then do a checkout-index, it will be replaced
with a filtered version that has injected the OID correctly.

11 years agoAdd clar helper to create new commit from index
Russell Belfer [Thu, 5 Sep 2013 22:06:42 +0000 (15:06 -0700)]
Add clar helper to create new commit from index

There were a lot of places in the test code base that were creating
a commit from the index on the current branch.  This just adds a
helper to handle that case pretty easily.  There was only one test
where this change ended up tweaking the test data, so pretty easy
and mostly just a cleanup.

11 years agoAdd clar helpers for testing file equality
Russell Belfer [Fri, 13 Sep 2013 23:30:21 +0000 (16:30 -0700)]
Add clar helpers for testing file equality

These are a couple of new clar helpers for testing that a file
has expected contents that I extracted from the checkout code.

Actually wrote this as part of an abandoned earlier attempt at a
new filters API, but it will be useful now for some of the tests
I'm going to write.

11 years agoFix cleanup issues with new tests
Russell Belfer [Fri, 13 Sep 2013 20:41:33 +0000 (13:41 -0700)]
Fix cleanup issues with new tests

11 years agoFixing up some win32 issues with autocrlf
Russell Belfer [Fri, 13 Sep 2013 19:32:45 +0000 (12:32 -0700)]
Fixing up some win32 issues with autocrlf

11 years agoFix win32 warnings
Russell Belfer [Fri, 13 Sep 2013 16:50:05 +0000 (09:50 -0700)]
Fix win32 warnings

I wish MSVC understood that "const char **" is not a const ptr,
but it a non-const pointer to an array of const ptrs.  Does that
seem like too much to ask.

11 years agoMake filter tests somewhat more robust
Russell Belfer [Fri, 13 Sep 2013 16:44:30 +0000 (09:44 -0700)]
Make filter tests somewhat more robust

The global and system config could interfere with the filter
tests by imposing CRLF filtering where it was not anticipated.
This better isolates the tests from the system settings.

11 years agoRearrange clar submodule cleanup code
Russell Belfer [Fri, 13 Sep 2013 16:26:26 +0000 (09:26 -0700)]
Rearrange clar submodule cleanup code

11 years agoPort tests from PR 1683
Russell Belfer [Thu, 12 Sep 2013 21:48:24 +0000 (14:48 -0700)]
Port tests from PR 1683

This ports over some of the tests from
    https://github.com/libgit2/libgit2/pull/1683
by @yorah and @ethomson

11 years agoMove binary check to CRLF filter itself
Russell Belfer [Thu, 12 Sep 2013 21:47:15 +0000 (14:47 -0700)]
Move binary check to CRLF filter itself

Checkout should not reject binary files from filters, as a filter
may actually wish to operate on binary files.  The CRLF filter should
reject binary files itself if it wishes to.  Moreover, the CRLF
filter requires this logic so that users can emulate the checkout
data in their odb -> workdir filtering.

Conflicts:
src/checkout.c
src/crlf.c

11 years agoMerge git_buf and git_buffer
Russell Belfer [Thu, 12 Sep 2013 05:00:36 +0000 (22:00 -0700)]
Merge git_buf and git_buffer

This makes the git_buf struct that was used internally into an
externally available structure and eliminates the git_buffer.

As part of that, some of the special cases that arose with the
externally used git_buffer were blended into the git_buf, such as
being careful about git_buf objects that may have a NULL ptr and
allowing for bufs with a valid ptr and size but zero asize as a
way of referring to externally owned data.

11 years agoAdd ident filter
Russell Belfer [Wed, 11 Sep 2013 23:38:33 +0000 (16:38 -0700)]
Add ident filter

This adds the ident filter (that knows how to replace $Id$) and
tweaks the filter APIs and code so that git_filter_source objects
actually have the updated OID of the object being filtered when
it is a known value.

11 years agoAdd functions to manipulate filter lists
Russell Belfer [Wed, 11 Sep 2013 21:23:39 +0000 (14:23 -0700)]
Add functions to manipulate filter lists

Extend the git2/sys/filter API with functions to look up a filter
and add it manually to a filter list.  This requires some trickery
because the regular attribute lookups and checks are bypassed when
this happens, but in the right hands, it will allow a user to have
granular control over applying filters.

11 years agoUpdate filter registry code
Russell Belfer [Wed, 11 Sep 2013 19:45:37 +0000 (12:45 -0700)]
Update filter registry code

This updates the git filter registry to be a little cleaner and
plugs some memory leaks.

11 years agoAdd simple global shutdown hooks
Russell Belfer [Wed, 11 Sep 2013 19:45:20 +0000 (12:45 -0700)]
Add simple global shutdown hooks

Increasingly there are a number of components that want to do some
cleanup at global shutdown time (at least if there are not going
to be memory leaks).  This creates a very simple system of shutdown
hooks that will be invoked by git_threads_shutdown.  Right now, the
maximum number of hooks is hardcoded, but since adding a hook is
not a public API, it should be fine and I thought it was better to
start off with really simple code.

11 years agoFix longstanding valgrind warning
Russell Belfer [Wed, 11 Sep 2013 19:38:06 +0000 (12:38 -0700)]
Fix longstanding valgrind warning

There was a possible circumstance that could result in reading
past the end of a buffer.  This check fixes that.

11 years agoHook up filter initialize callback
Russell Belfer [Tue, 10 Sep 2013 23:53:09 +0000 (16:53 -0700)]
Hook up filter initialize callback

I knew I forgot something

11 years agoExtend public filter api with filter lists
Russell Belfer [Tue, 10 Sep 2013 23:33:32 +0000 (16:33 -0700)]
Extend public filter api with filter lists

This moves the git_filter_list into the public API so that users
can create, apply, and dispose of filter lists.  This allows more
granular application of filters to user data outside of libgit2
internals.

This also converts all the internal usage of filters to the public
APIs along with a few small tweaks to make it easier to use the
public git_buffer stuff alongside the internal git_buf.

11 years agoAdd attributes to filters and fix registry
Russell Belfer [Mon, 9 Sep 2013 23:57:34 +0000 (16:57 -0700)]
Add attributes to filters and fix registry

The filter registry as implemented was too primitive to actually
work once multiple filters were coming into play.  This expands
the implementation of the registry to handle multiple prioritized
filters correctly.

Additionally, this adds an "attributes" field to a filter that
makes it really really easy to implement filters that are based
on one or more attribute values.  The lookup and even simple value
checking can all happen automatically without custom filter code.

Lastly, with the registry improvements, this fills out the filter
lifecycle callbacks, with initialize and shutdown callbacks that
will be called before the filter is first used and after it is
last invoked.  This allows for system-wide initialization and
cleanup by the filter.

11 years agoMake git_filter_source opaque
Russell Belfer [Fri, 30 Aug 2013 23:02:07 +0000 (16:02 -0700)]
Make git_filter_source opaque