| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Introduce `git_blob_data_is_binary` to examine a blob's data, instead of
the blob itself. A replacement for `git_buf_is_binary`.
|
| |
|
|
|
|
|
|
|
| |
Using a `git_oid *` in filter options was a mistake; it is a deviation
from our typical pattern, and callers in some languages that GC may need
very special treatment in order to pass both an options structure and a
pointer outside of it.
|
|
|
|
|
| |
Provide a mechanism to filter using attribute data from a specific
commit (making use of `GIT_ATTR_CHECK_INCLUDE_COMMIT`).
|
| |
|
|\
| |
| | |
blob: fix name of `GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD`
|
| |
| |
| |
| |
| |
| | |
`GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD` is misspelled, it should be
`GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD`, and it would be if it were not
for the MacBook Pro keyboard and my inattentiveness.
|
| |
| |
| |
| | |
Adds info about initializing options with git_blob_filter_options_init
|
| |
| |
| |
| |
| |
| | |
The `git_blob_filter_options_init` function should be included, to allow
callers in FFI environments to let us initialize an options structure
for them.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Removes doc comment on `git_blob_filter_options.version`, moves
information to `git_blob_filter_options` doc comment to remain
consistent with other options structures' documentation.
`git_blob_filter_options_init` still needed; should be added in another
commit/PR (it's out of the scope of this PR, #5759), update this
documentation again.
|
|/
|
|
| |
Resolves #5756
|
| |
|
|
|
|
|
| |
Instead of using a signed type (`off_t`) use a new `git_object_size_t`
for the sizes of objects.
|
|
|
|
|
|
| |
Using an `enum` causes trouble when used with C++ as bitwise operations are not possible w/o casting (e.g., `opts.flags &= ~GIT_BLOB_FILTER_CHECK_FOR_BINARY;` is invalid as there is no `&=` operator for `enum`).
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
|
|
|
|
|
|
| |
When `GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD` is passed to
`git_blob_filter`, read attributes from `gitattributes` files that
are checked in to the repository at the HEAD revision. This passes
the flag `GIT_FILTER_ATTRIBUTES_FROM_HEAD` to the filter functions.
|
|
|
|
|
|
|
|
| |
Introduce `GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES`, which tells
`git_blob_filter` to ignore the system-wide attributes file, usually
`/etc/gitattributes`.
This simply passes the appropriate flag to the attribute loading code.
|
|
|
|
| |
Users should now use `git_blob_filter`.
|
|
|
|
|
| |
Provide a function to filter blobs that allows for more functionality
than the existing `git_blob_filtered_content` function.
|
|
|
|
|
|
| |
The majority of functions are named `from_something` (with an
underscore) instead of `fromsomething`. Update the blob functions for
consistency with the rest of the library.
|
|
|
|
| |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pair of `git_blob_create_frombuffer()` and
`git_blob_create_frombuffer_commit()` is meant to replace
`git_blob_create_fromchunks()` by providing a way for a user to write a
new blob when they want filtering or they do not know the size.
This approach allows the caller to retain control over when to add data
to this buffer and a more natural fit into higher-level language's own
stream abstractions instead of having to handle IO wait in the callback.
The in-memory buffer size of 2MB is chosen somewhat arbitrarily to be a
round multiple of usual page sizes and a value where most blobs seem
likely to be either going to be way below or way over that size. It's
also a round number of pages.
This implementation re-uses the helper we have from `_fromchunks()` so
we end up writing everything to disk, but hopefully more efficiently
than with a default filebuf. A later optimisation can be to avoid
writing the in-memory contents to disk, with some extra complexity.
|
|
|
| |
putting `0.` at the start of the line turns it into a numbered list.
|
|
|
|
|
|
|
|
|
| |
We currently recommend using `git_buf_grow` in order to make a buffer
make an owned copy of the memory it points to. This is not behaviour we
should encourage, so remove this recommendation.
The function itself is not changed, as we need to remain compatible, but
it will be changed not to allow usage on borrowed buffers.
|
|
|
| |
filter.h tells me that we check the first 8000 bytes.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
The callback to supply data chunks could return a negative value
to stop creation of the blob, but we were neither using GIT_EUSER
nor propagating the return value. This makes things use the new
behavior of returning the negative value back to the user.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
This begins the process of exposing git_filter objects to the
public API. This includes:
* new public type and API for `git_buffer` through which an
allocated buffer can be passed to the user
* new API `git_blob_filtered_content`
* make the git_filter type and GIT_FILTER_TO_... constants public
|
|
|
|
|
|
| |
This removes the GIT_INLINE versions of the simple git_object
accessors and standardizes them with a helper macro in src/object.h
to build the function bodies.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This moves the implementation of these two APIs into common code
that will be shared between the two. Also, this adds tests for
the `git_diff_blob_to_buffer` API. Lastly, this adds some extra
`const` to a few places that can use it.
|
| |
|
|
|
|
|
|
| |
Conflicts:
src/branch.c
tests-clar/refs/branches/create.c
|
| |
|
| |
|
| |
|
|
|
|
| |
This function will create blobs in the object database from files anywhere on the filesystem. This can be run against bare and non-bare repositories.
|
|
|
|
| |
Signed-off-by: schu <schu-github@schulog.org>
|
|
|
|
|
| |
There's no difference between `_free` and `_close` semantics: keep
everything with the same name to avoid confusions.
|
|
|
|
|
|
|
|
|
|
| |
1. The license header is technically not valid if it doesn't have a
copyright signature.
2. The COPYING file has been updated with the different licenses used in
the project.
3. The full GPLv2 header in each file annoys me.
|
|
|
|
| |
an error code".
|
| |
|
|
|
|
| |
given an OID prefix.
|
|
|
|
| |
MSVC doesn't swallow that.
|