Skip to main content

Module ffi

Module ffi 

Source
Expand description

Safe FFI bindings to libgit2’s filter system

Provides type-safe wrappers around git2/sys/filter.h

Structs§

GitFilter
Filter structure (must match libgit2’s git_filter)
GitWriteStreamBase
Base writestream structure (matches libgit2’s git_writestream) Custom writestreams should embed this at the start of their struct
OpaqueGitFilter
OpaqueGitFilterSource
OpaqueGitWriteStream

Constants§

GIT_FILTER_CLEAN
Filter mode for cleaning (workdir → ODB)
GIT_FILTER_SMUDGE
Filter mode for smudging (ODB → workdir)
GIT_FILTER_TO_WORKTREE
Flag indicating operation is towards worktree (checkout operation)
GIT_FILTER_VERSION
Current filter structure version for ABI compatibility
GIT_PASSTHROUGH
Filter passthrough - filter declines to process this file
LIBGIT2_MWINDOW_SIZE
Memory window size for large file operations (8 MB)

Functions§

git_filter_global_init⚠
Initialize the global filter registry (internal libgit2 function)
git_filter_init⚠
Initialize a git_filter with default values
git_filter_register⚠
Register a filter with libgit2
git_filter_source_flags⚠
Get filter source flags (e.g., GIT_FILTER_TO_WORKTREE)
git_filter_source_mode⚠
Get filter source mode (clean or smudge)
git_filter_source_path⚠
Get filter source path
git_filter_source_repo⚠
Get filter source repo
git_filter_unregister⚠
Unregister a filter

Type Aliases§

FilterCheckFn
FilterCleanupFn
FilterInitializeFn
FilterShutdownFn
FilterStreamFn
WriteStreamCloseFn
WriteStreamFreeFn
WriteStreamWriteFn
Writestream callback types