Jelmer Vernooij 1 месяц назад
Родитель
Сommit
2489986901
69 измененных файлов с 1203 добавлено и 1 удалено
  1. 2 0
      dulwich/__main__.py
  2. 2 0
      dulwich/annotate.py
  3. 2 0
      dulwich/approxidate.py
  4. 2 0
      dulwich/archive.py
  5. 10 0
      dulwich/attrs.py
  6. 2 0
      dulwich/bisect.py
  7. 27 0
      dulwich/bitmap.py
  8. 8 0
      dulwich/bundle.py
  9. 23 0
      dulwich/cli.py
  10. 43 0
      dulwich/client.py
  11. 2 0
      dulwich/cloud/__init__.py
  12. 4 0
      dulwich/cloud/gcs.py
  13. 31 0
      dulwich/commit_graph.py
  14. 23 0
      dulwich/config.py
  15. 2 0
      dulwich/contrib/__init__.py
  16. 5 0
      dulwich/contrib/diffstat.py
  17. 2 0
      dulwich/contrib/greenthreads.py
  18. 4 0
      dulwich/contrib/paramiko_vendor.py
  19. 7 0
      dulwich/contrib/release_robot.py
  20. 5 0
      dulwich/contrib/requests_vendor.py
  21. 20 0
      dulwich/contrib/swift.py
  22. 6 0
      dulwich/credentials.py
  23. 8 0
      dulwich/diff.py
  24. 18 0
      dulwich/diff_tree.py
  25. 5 0
      dulwich/dumb.py
  26. 24 0
      dulwich/errors.py
  27. 6 0
      dulwich/fastexport.py
  28. 6 0
      dulwich/file.py
  29. 6 0
      dulwich/filter_branch.py
  30. 11 0
      dulwich/filters.py
  31. 12 0
      dulwich/gc.py
  32. 8 0
      dulwich/graph.py
  33. 9 0
      dulwich/hooks.py
  34. 11 0
      dulwich/ignore.py
  35. 62 0
      dulwich/index.py
  36. 14 0
      dulwich/lfs.py
  37. 6 0
      dulwich/lfs_server.py
  38. 20 0
      dulwich/line_ending.py
  39. 6 0
      dulwich/log_utils.py
  40. 5 0
      dulwich/lru_cache.py
  41. 6 0
      dulwich/mailmap.py
  42. 16 0
      dulwich/maintenance.py
  43. 6 0
      dulwich/mbox.py
  44. 10 0
      dulwich/merge.py
  45. 7 0
      dulwich/merge_drivers.py
  46. 18 0
      dulwich/midx.py
  47. 11 0
      dulwich/notes.py
  48. 30 0
      dulwich/object_store.py
  49. 50 0
      dulwich/objects.py
  50. 14 0
      dulwich/objectspec.py
  51. 64 0
      dulwich/pack.py
  52. 23 0
      dulwich/patch.py
  53. 181 1
      dulwich/porcelain.py
  54. 77 0
      dulwich/protocol.py
  55. 18 0
      dulwich/rebase.py
  56. 10 0
      dulwich/reflog.py
  57. 33 0
      dulwich/refs.py
  58. 35 0
      dulwich/reftable.py
  59. 29 0
      dulwich/repo.py
  60. 7 0
      dulwich/rerere.py
  61. 24 0
      dulwich/server.py
  62. 11 0
      dulwich/sparse_patterns.py
  63. 6 0
      dulwich/stash.py
  64. 4 0
      dulwich/stripspace.py
  65. 5 0
      dulwich/submodule.py
  66. 7 0
      dulwich/trailers.py
  67. 8 0
      dulwich/walk.py
  68. 8 0
      dulwich/whitespace.py
  69. 16 0
      dulwich/worktree.py

+ 2 - 0
dulwich/__main__.py

@@ -6,6 +6,8 @@ This module allows dulwich to be run as a Python module using the -m flag:
 It serves as the main entry point for the dulwich command-line interface.
 It serves as the main entry point for the dulwich command-line interface.
 """
 """
 
 
+__all__ = []
+
 from . import cli
 from . import cli
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":

+ 2 - 0
dulwich/annotate.py

@@ -26,6 +26,8 @@ but its speed could be improved - in particular because it uses
 Python's difflib.
 Python's difflib.
 """
 """
 
 
+__all__ = ["annotate_lines", "update_lines"]
+
 import difflib
 import difflib
 from collections.abc import Sequence
 from collections.abc import Sequence
 from typing import TYPE_CHECKING
 from typing import TYPE_CHECKING

+ 2 - 0
dulwich/approxidate.py

@@ -29,6 +29,8 @@ formats for specifying dates and times, including:
 - Special keywords: "now", "today", "yesterday"
 - Special keywords: "now", "today", "yesterday"
 """
 """
 
 
+__all__ = ["parse_approxidate", "parse_relative_time"]
+
 import time
 import time
 from datetime import datetime
 from datetime import datetime
 
 

+ 2 - 0
dulwich/archive.py

@@ -22,6 +22,8 @@
 
 
 """Generates tarballs for Git trees."""
 """Generates tarballs for Git trees."""
 
 
+__all__ = ["ChunkedBytesIO", "tar_stream"]
+
 import posixpath
 import posixpath
 import stat
 import stat
 import struct
 import struct

+ 10 - 0
dulwich/attrs.py

@@ -21,6 +21,16 @@
 
 
 """Parse .gitattributes file."""
 """Parse .gitattributes file."""
 
 
+__all__ = [
+    "AttributeValue",
+    "GitAttributes",
+    "Pattern",
+    "match_path",
+    "parse_git_attributes",
+    "parse_gitattributes_file",
+    "read_gitattributes",
+]
+
 import os
 import os
 import re
 import re
 from collections.abc import Generator, Iterator, Mapping, Sequence
 from collections.abc import Generator, Iterator, Mapping, Sequence

+ 2 - 0
dulwich/bisect.py

@@ -20,6 +20,8 @@
 
 
 """Git bisect implementation."""
 """Git bisect implementation."""
 
 
+__all__ = ["BisectState"]
+
 import os
 import os
 from collections.abc import Sequence, Set
 from collections.abc import Sequence, Set
 
 

+ 27 - 0
dulwich/bitmap.py

@@ -28,6 +28,33 @@ The bitmap format uses EWAH (Enhanced Word-Aligned Hybrid) compression
 for efficient storage and fast bitwise operations.
 for efficient storage and fast bitwise operations.
 """
 """
 
 
+__all__ = [
+    "BITMAP_OPT_FULL_DAG",
+    "BITMAP_OPT_HASH_CACHE",
+    "BITMAP_OPT_LOOKUP_TABLE",
+    "BITMAP_OPT_PSEUDO_MERGES",
+    "BITMAP_SIGNATURE",
+    "BITMAP_VERSION",
+    "DEFAULT_COMMIT_INTERVAL",
+    "MAX_LITERAL_WORDS",
+    "MAX_XOR_OFFSET",
+    "BitmapEntry",
+    "EWAHBitmap",
+    "PackBitmap",
+    "apply_xor_compression",
+    "bitmap_to_object_shas",
+    "build_name_hash_cache",
+    "build_reachability_bitmap",
+    "build_type_bitmaps",
+    "find_commit_bitmaps",
+    "generate_bitmap",
+    "read_bitmap",
+    "read_bitmap_file",
+    "select_bitmap_commits",
+    "write_bitmap",
+    "write_bitmap_file",
+]
+
 import os
 import os
 import struct
 import struct
 from collections import deque
 from collections import deque

+ 8 - 0
dulwich/bundle.py

@@ -21,6 +21,14 @@
 
 
 """Bundle format support."""
 """Bundle format support."""
 
 
+__all__ = [
+    "Bundle",
+    "PackDataLike",
+    "create_bundle_from_repo",
+    "read_bundle",
+    "write_bundle",
+]
+
 from collections.abc import Callable, Iterator, Sequence
 from collections.abc import Callable, Iterator, Sequence
 from typing import (
 from typing import (
     TYPE_CHECKING,
     TYPE_CHECKING,

+ 23 - 0
dulwich/cli.py

@@ -28,6 +28,29 @@ no means intended to be a full-blown Git command-line interface but just
 a way to test Dulwich.
 a way to test Dulwich.
 """
 """
 
 
+__all__ = [
+    "AutoFlushBinaryIOWrapper",
+    "AutoFlushTextIOWrapper",
+    "Command",
+    "CommitMessageError",
+    "Pager",
+    "PagerBuffer",
+    "SuperCommand",
+    "detect_terminal_width",
+    "disable_pager",
+    "enable_pager",
+    "format_bytes",
+    "format_columns",
+    "get_pager",
+    "launch_editor",
+    "main",
+    "parse_time_to_timestamp",
+    "signal_int",
+    "signal_quit",
+    "to_display_str",
+    "write_columns",
+]
+
 # TODO: Add support for GIT_NAMESPACE environment variable by wrapping
 # TODO: Add support for GIT_NAMESPACE environment variable by wrapping
 # repository refs with NamespacedRefsContainer when the environment
 # repository refs with NamespacedRefsContainer when the environment
 # variable is set. See issue #1809 and dulwich.refs.NamespacedRefsContainer.
 # variable is set. See issue #1809 and dulwich.refs.NamespacedRefsContainer.

+ 43 - 0
dulwich/client.py

@@ -39,6 +39,49 @@ Known capabilities that are not supported:
  * include-tag
  * include-tag
 """
 """
 
 
+__all__ = [
+    "COMMON_CAPABILITIES",
+    "DEFAULT_GIT_CREDENTIALS_PATHS",
+    "DEFAULT_REF_PREFIX",
+    "RECEIVE_CAPABILITIES",
+    "UPLOAD_CAPABILITIES",
+    "AbstractHttpGitClient",
+    "BundleClient",
+    "FetchPackResult",
+    "GitClient",
+    "HTTPProxyUnauthorized",
+    "HTTPUnauthorized",
+    "InvalidWants",
+    "LocalGitClient",
+    "LsRemoteResult",
+    "PLinkSSHVendor",
+    "ReportStatusParser",
+    "SSHGitClient",
+    "SSHVendor",
+    "SendPackResult",
+    "StrangeHostname",
+    "SubprocessGitClient",
+    "SubprocessSSHVendor",
+    "SubprocessWrapper",
+    "TCPGitClient",
+    "TraditionalGitClient",
+    "Urllib3HttpGitClient",
+    "check_for_proxy_bypass",
+    "check_wants",
+    "default_urllib3_manager",
+    "default_user_agent_string",
+    "find_capability",
+    "find_git_command",
+    "get_credentials_from_store",
+    "get_transport_and_path",
+    "get_transport_and_path_from_url",
+    "negotiate_protocol_version",
+    "parse_rsync_url",
+    "read_pkt_refs_v1",
+    "read_pkt_refs_v2",
+    "read_server_capabilities",
+]
+
 import copy
 import copy
 import functools
 import functools
 import logging
 import logging

+ 2 - 0
dulwich/cloud/__init__.py

@@ -8,3 +8,5 @@ traditional filesystem-based storage.
 Available backends:
 Available backends:
 - GCS (Google Cloud Storage): Store Git objects in Google Cloud Storage buckets
 - GCS (Google Cloud Storage): Store Git objects in Google Cloud Storage buckets
 """
 """
+
+__all__ = []

+ 4 - 0
dulwich/cloud/gcs.py

@@ -22,6 +22,10 @@
 
 
 """Storage of repositories on GCS."""
 """Storage of repositories on GCS."""
 
 
+__all__ = [
+    "GcsObjectStore",
+]
+
 import posixpath
 import posixpath
 import tempfile
 import tempfile
 from collections.abc import Iterator
 from collections.abc import Iterator

+ 31 - 0
dulwich/commit_graph.py

@@ -16,6 +16,37 @@ The commit graph format is documented at:
 https://git-scm.com/docs/gitformat-commit-graph
 https://git-scm.com/docs/gitformat-commit-graph
 """
 """
 
 
+__all__ = [
+    "CHUNK_BASE_GRAPHS_LIST",
+    "CHUNK_BLOOM_FILTER_DATA",
+    "CHUNK_BLOOM_FILTER_INDEX",
+    "CHUNK_COMMIT_DATA",
+    "CHUNK_EXTRA_EDGE_LIST",
+    "CHUNK_GENERATION_DATA",
+    "CHUNK_GENERATION_DATA_OVERFLOW",
+    "CHUNK_OID_FANOUT",
+    "CHUNK_OID_LOOKUP",
+    "COMMIT_GRAPH_SIGNATURE",
+    "COMMIT_GRAPH_VERSION",
+    "GENERATION_NUMBER_INFINITY",
+    "GENERATION_NUMBER_V1_MAX",
+    "GENERATION_NUMBER_ZERO",
+    "GRAPH_EXTRA_EDGES_NEEDED",
+    "GRAPH_LAST_EDGE",
+    "GRAPH_PARENT_MISSING",
+    "GRAPH_PARENT_NONE",
+    "HASH_VERSION_SHA1",
+    "HASH_VERSION_SHA256",
+    "CommitGraph",
+    "CommitGraphChunk",
+    "CommitGraphEntry",
+    "find_commit_graph_file",
+    "generate_commit_graph",
+    "get_reachable_commits",
+    "read_commit_graph",
+    "write_commit_graph",
+]
+
 import os
 import os
 import struct
 import struct
 from collections.abc import Iterator, Sequence
 from collections.abc import Iterator, Sequence

+ 23 - 0
dulwich/config.py

@@ -25,6 +25,29 @@ Todo:
  * preserve formatting when updating configuration files
  * preserve formatting when updating configuration files
 """
 """
 
 
+__all__ = [
+    "DEFAULT_MAX_INCLUDE_DEPTH",
+    "MAX_INCLUDE_FILE_SIZE",
+    "CaseInsensitiveOrderedMultiDict",
+    "ConditionMatcher",
+    "Config",
+    "ConfigDict",
+    "ConfigFile",
+    "ConfigKey",
+    "ConfigValue",
+    "FileOpener",
+    "StackedConfig",
+    "apply_instead_of",
+    "get_win_legacy_system_paths",
+    "get_win_system_paths",
+    "get_xdg_config_home_path",
+    "iter_instead_of",
+    "lower_key",
+    "match_glob_pattern",
+    "parse_submodules",
+    "read_submodules",
+]
+
 import logging
 import logging
 import os
 import os
 import re
 import re

+ 2 - 0
dulwich/contrib/__init__.py

@@ -33,3 +33,5 @@ Available modules:
 - requests_vendor: HTTP client implementation using requests
 - requests_vendor: HTTP client implementation using requests
 - swift: OpenStack Swift object storage backend
 - swift: OpenStack Swift object storage backend
 """
 """
+
+__all__ = []

+ 5 - 0
dulwich/contrib/diffstat.py

@@ -43,6 +43,11 @@ statistics about changes, including:
 - Formatted output similar to git diff --stat
 - Formatted output similar to git diff --stat
 """
 """
 
 
+__all__ = [
+    "diffstat",
+    "main",
+]
+
 import re
 import re
 import sys
 import sys
 from collections.abc import Sequence
 from collections.abc import Sequence

+ 2 - 0
dulwich/contrib/greenthreads.py

@@ -23,6 +23,8 @@
 
 
 """Utility module for querying an ObjectStore with gevent."""
 """Utility module for querying an ObjectStore with gevent."""
 
 
+__all__ = ["GreenThreadsMissingObjectFinder"]
+
 from collections.abc import Callable, Sequence
 from collections.abc import Callable, Sequence
 
 
 import gevent
 import gevent

+ 4 - 0
dulwich/contrib/paramiko_vendor.py

@@ -31,6 +31,10 @@ the dulwich.client.get_ssh_vendor attribute:
 This implementation has comprehensive tests in tests/contrib/test_paramiko_vendor.py.
 This implementation has comprehensive tests in tests/contrib/test_paramiko_vendor.py.
 """
 """
 
 
+__all__ = [
+    "ParamikoSSHVendor",
+]
+
 import os
 import os
 import warnings
 import warnings
 from typing import Any, BinaryIO, cast
 from typing import Any, BinaryIO, cast

+ 7 - 0
dulwich/contrib/release_robot.py

@@ -45,6 +45,13 @@ EG::
 
 
 """
 """
 
 
+__all__ = [
+    "PATTERN",
+    "PROJDIR",
+    "get_current_version",
+    "get_recent_tags",
+]
+
 import datetime
 import datetime
 import logging
 import logging
 import re
 import re

+ 5 - 0
dulwich/contrib/requests_vendor.py

@@ -31,6 +31,11 @@ the dulwich.client.HttpGitClient attribute:
 This implementation is experimental and does not have any tests.
 This implementation is experimental and does not have any tests.
 """
 """
 
 
+__all__ = [
+    "RequestsHttpGitClient",
+    "get_session",
+]
+
 from collections.abc import Callable, Iterator
 from collections.abc import Callable, Iterator
 from io import BytesIO
 from io import BytesIO
 from typing import TYPE_CHECKING, Any
 from typing import TYPE_CHECKING, Any

+ 20 - 0
dulwich/contrib/swift.py

@@ -23,6 +23,26 @@
 
 
 """Repo implementation atop OpenStack SWIFT."""
 """Repo implementation atop OpenStack SWIFT."""
 
 
+__all__ = [
+    "PackInfoMissingObjectFinder",
+    "SwiftConnector",
+    "SwiftException",
+    "SwiftInfoRefsContainer",
+    "SwiftObjectStore",
+    "SwiftPack",
+    "SwiftPackData",
+    "SwiftPackReader",
+    "SwiftRepo",
+    "SwiftSystemBackend",
+    "cmd_daemon",
+    "cmd_init",
+    "load_conf",
+    "load_pack_info",
+    "main",
+    "pack_info_create",
+    "swift_load_pack_index",
+]
+
 # TODO: Refactor to share more code with dulwich/repo.py.
 # TODO: Refactor to share more code with dulwich/repo.py.
 # TODO(fbo): Second attempt to _send() must be notified via real log
 # TODO(fbo): Second attempt to _send() must be notified via real log
 # TODO(fbo): More logs for operations
 # TODO(fbo): More logs for operations

+ 6 - 0
dulwich/credentials.py

@@ -26,6 +26,12 @@ https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
 
 
 """
 """
 
 
+__all__ = [
+    "match_partial_url",
+    "match_urls",
+    "urlmatch_credential_sections",
+]
+
 import sys
 import sys
 from collections.abc import Iterator
 from collections.abc import Iterator
 from urllib.parse import ParseResult, urlparse
 from urllib.parse import ParseResult, urlparse

+ 8 - 0
dulwich/diff.py

@@ -44,6 +44,14 @@ Example usage:
     diff_index_to_tree(repo, sys.stdout.buffer, paths=[b'src/', b'README.md'])
     diff_index_to_tree(repo, sys.stdout.buffer, paths=[b'src/', b'README.md'])
 """
 """
 
 
+__all__ = [
+    "ColorizedDiffStream",
+    "diff_index_to_tree",
+    "diff_working_tree_to_index",
+    "diff_working_tree_to_tree",
+    "should_include_path",
+]
+
 import io
 import io
 import logging
 import logging
 import os
 import os

+ 18 - 0
dulwich/diff_tree.py

@@ -21,6 +21,24 @@
 
 
 """Utilities for diffing files and trees."""
 """Utilities for diffing files and trees."""
 
 
+__all__ = [
+    "CHANGE_ADD",
+    "CHANGE_COPY",
+    "CHANGE_DELETE",
+    "CHANGE_MODIFY",
+    "CHANGE_RENAME",
+    "CHANGE_UNCHANGED",
+    "MAX_FILES",
+    "RENAME_CHANGE_TYPES",
+    "RENAME_THRESHOLD",
+    "REWRITE_THRESHOLD",
+    "RenameDetector",
+    "TreeChange",
+    "tree_changes",
+    "tree_changes_for_merge",
+    "walk_trees",
+]
+
 import stat
 import stat
 from collections import defaultdict
 from collections import defaultdict
 from collections.abc import Callable, Iterator, Mapping, Sequence
 from collections.abc import Callable, Iterator, Mapping, Sequence

+ 5 - 0
dulwich/dumb.py

@@ -21,6 +21,11 @@
 
 
 """Support for dumb HTTP(S) git repositories."""
 """Support for dumb HTTP(S) git repositories."""
 
 
+__all__ = [
+    "DumbHTTPObjectStore",
+    "DumbRemoteHTTPRepo",
+]
+
 import os
 import os
 import tempfile
 import tempfile
 import zlib
 import zlib

+ 24 - 0
dulwich/errors.py

@@ -22,6 +22,30 @@
 
 
 """Dulwich-related exception classes and utility functions."""
 """Dulwich-related exception classes and utility functions."""
 
 
+__all__ = [
+    "ApplyDeltaError",
+    "ChecksumMismatch",
+    "CommitError",
+    "FileFormatException",
+    "GitProtocolError",
+    "HangupException",
+    "HookError",
+    "MissingCommitError",
+    "NoIndexPresent",
+    "NotBlobError",
+    "NotCommitError",
+    "NotGitRepository",
+    "NotTagError",
+    "NotTreeError",
+    "ObjectFormatException",
+    "ObjectMissing",
+    "PackedRefsException",
+    "RefFormatError",
+    "SendPackError",
+    "UnexpectedCommandError",
+    "WorkingTreeModifiedError",
+    "WrongObjectException",
+]
 
 
 # Please do not add more errors here, but instead add them close to the code
 # Please do not add more errors here, but instead add them close to the code
 # that raises the error.
 # that raises the error.

+ 6 - 0
dulwich/fastexport.py

@@ -22,6 +22,12 @@
 
 
 """Fast export/import functionality."""
 """Fast export/import functionality."""
 
 
+__all__ = [
+    "GitFastExporter",
+    "GitImportProcessor",
+    "split_email",
+]
+
 import stat
 import stat
 from collections.abc import Generator
 from collections.abc import Generator
 from typing import TYPE_CHECKING, Any, BinaryIO
 from typing import TYPE_CHECKING, Any, BinaryIO

+ 6 - 0
dulwich/file.py

@@ -21,6 +21,12 @@
 
 
 """Safe access to git files."""
 """Safe access to git files."""
 
 
+__all__ = [
+    "FileLocked",
+    "GitFile",
+    "ensure_dir_exists",
+]
+
 import os
 import os
 import sys
 import sys
 import warnings
 import warnings

+ 6 - 0
dulwich/filter_branch.py

@@ -21,6 +21,12 @@
 
 
 """Git filter-branch implementation."""
 """Git filter-branch implementation."""
 
 
+__all__ = [
+    "CommitData",
+    "CommitFilter",
+    "filter_refs",
+]
+
 import os
 import os
 import tempfile
 import tempfile
 import warnings
 import warnings

+ 11 - 0
dulwich/filters.py

@@ -21,6 +21,17 @@
 
 
 """Implementation of Git filter drivers (clean/smudge filters)."""
 """Implementation of Git filter drivers (clean/smudge filters)."""
 
 
+__all__ = [
+    "CompositeFilterDriver",
+    "FilterBlobNormalizer",
+    "FilterContext",
+    "FilterDriver",
+    "FilterError",
+    "FilterRegistry",
+    "ProcessFilterDriver",
+    "get_filter_for_path",
+]
+
 import logging
 import logging
 import subprocess
 import subprocess
 import threading
 import threading

+ 12 - 0
dulwich/gc.py

@@ -1,5 +1,17 @@
 """Git garbage collection implementation."""
 """Git garbage collection implementation."""
 
 
+__all__ = [
+    "DEFAULT_GC_AUTO",
+    "DEFAULT_GC_AUTO_PACK_LIMIT",
+    "GCStats",
+    "find_reachable_objects",
+    "find_unreachable_objects",
+    "garbage_collect",
+    "maybe_auto_gc",
+    "prune_unreachable_objects",
+    "should_run_gc",
+]
+
 import logging
 import logging
 import os
 import os
 import time
 import time

+ 8 - 0
dulwich/graph.py

@@ -20,6 +20,14 @@
 
 
 """Implementation of merge-base following the approach of git."""
 """Implementation of merge-base following the approach of git."""
 
 
+__all__ = [
+    "WorkList",
+    "can_fast_forward",
+    "find_merge_base",
+    "find_octopus_base",
+    "independent",
+]
+
 from collections.abc import Callable, Iterator, Mapping, Sequence
 from collections.abc import Callable, Iterator, Mapping, Sequence
 from heapq import heappop, heappush
 from heapq import heappop, heappush
 from typing import TYPE_CHECKING, Generic, TypeVar
 from typing import TYPE_CHECKING, Generic, TypeVar

+ 9 - 0
dulwich/hooks.py

@@ -21,6 +21,15 @@
 
 
 """Access to hooks."""
 """Access to hooks."""
 
 
+__all__ = [
+    "CommitMsgShellHook",
+    "Hook",
+    "PostCommitShellHook",
+    "PostReceiveShellHook",
+    "PreCommitShellHook",
+    "ShellHook",
+]
+
 import os
 import os
 import subprocess
 import subprocess
 from collections.abc import Callable, Sequence
 from collections.abc import Callable, Sequence

+ 11 - 0
dulwich/ignore.py

@@ -26,6 +26,17 @@ Important: When checking if directories are ignored, include a trailing slash in
 For example, use "dir/" instead of "dir" to check if a directory is ignored.
 For example, use "dir/" instead of "dir" to check if a directory is ignored.
 """
 """
 
 
+__all__ = [
+    "IgnoreFilter",
+    "IgnoreFilterManager",
+    "IgnoreFilterStack",
+    "Pattern",
+    "default_user_ignore_filter_path",
+    "match_pattern",
+    "read_ignore_patterns",
+    "translate",
+]
+
 import os.path
 import os.path
 import re
 import re
 from collections.abc import Iterable, Sequence
 from collections.abc import Iterable, Sequence

+ 62 - 0
dulwich/index.py

@@ -21,6 +21,68 @@
 
 
 """Parser for the git index file format."""
 """Parser for the git index file format."""
 
 
+__all__ = [
+    "DEFAULT_VERSION",
+    "EOIE_EXTENSION",
+    "EXTENDED_FLAG_INTEND_TO_ADD",
+    "EXTENDED_FLAG_SKIP_WORKTREE",
+    "FLAG_EXTENDED",
+    "FLAG_NAMEMASK",
+    "FLAG_STAGEMASK",
+    "FLAG_STAGESHIFT",
+    "FLAG_VALID",
+    "HFS_IGNORABLE_CHARS",
+    "IEOT_EXTENSION",
+    "INVALID_DOTNAMES",
+    "REUC_EXTENSION",
+    "SDIR_EXTENSION",
+    "TREE_EXTENSION",
+    "UNTR_EXTENSION",
+    "Index",
+    "IndexEntry",
+    "IndexExtension",
+    "ResolveUndoExtension",
+    "SerializedIndexEntry",
+    "SparseDirExtension",
+    "Stage",
+    "TreeDict",
+    "TreeExtension",
+    "UnmergedEntries",
+    "UnsupportedIndexFormat",
+    "UntrackedExtension",
+    "blob_from_path_and_mode",
+    "blob_from_path_and_stat",
+    "build_file_from_blob",
+    "build_index_from_tree",
+    "changes_from_tree",
+    "cleanup_mode",
+    "commit_index",
+    "commit_tree",
+    "detect_case_only_renames",
+    "get_path_element_normalizer",
+    "get_unstaged_changes",
+    "index_entry_from_stat",
+    "pathjoin",
+    "pathsplit",
+    "read_cache_entry",
+    "read_cache_time",
+    "read_index",
+    "read_index_dict",
+    "read_index_dict_with_version",
+    "read_index_header",
+    "read_submodule_head",
+    "update_working_tree",
+    "validate_path",
+    "validate_path_element_default",
+    "validate_path_element_hfs",
+    "validate_path_element_ntfs",
+    "write_cache_entry",
+    "write_cache_time",
+    "write_index",
+    "write_index_dict",
+    "write_index_extension",
+]
+
 import errno
 import errno
 import os
 import os
 import shutil
 import shutil

+ 14 - 0
dulwich/lfs.py

@@ -32,6 +32,20 @@ Key components:
 - Integration with dulwich repositories
 - Integration with dulwich repositories
 """
 """
 
 
+__all__ = [
+    "FileLFSClient",
+    "HTTPLFSClient",
+    "LFSAction",
+    "LFSBatchObject",
+    "LFSBatchResponse",
+    "LFSClient",
+    "LFSError",
+    "LFSErrorInfo",
+    "LFSFilterDriver",
+    "LFSPointer",
+    "LFSStore",
+]
+
 import hashlib
 import hashlib
 import json
 import json
 import logging
 import logging

+ 6 - 0
dulwich/lfs_server.py

@@ -21,6 +21,12 @@
 
 
 """Simple Git LFS server implementation for testing."""
 """Simple Git LFS server implementation for testing."""
 
 
+__all__ = [
+    "LFSRequestHandler",
+    "LFSServer",
+    "run_lfs_server",
+]
+
 import hashlib
 import hashlib
 import json
 import json
 import tempfile
 import tempfile

+ 20 - 0
dulwich/line_ending.py

@@ -137,6 +137,26 @@ Sources:
 - https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/
 - https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/
 """
 """
 
 
+__all__ = [
+    "CRLF",
+    "LF",
+    "BlobNormalizer",
+    "LineEndingFilter",
+    "TreeBlobNormalizer",
+    "check_safecrlf",
+    "convert_crlf_to_lf",
+    "convert_lf_to_crlf",
+    "get_checkin_filter",
+    "get_checkin_filter_autocrlf",
+    "get_checkout_filter",
+    "get_checkout_filter_autocrlf",
+    "get_clean_filter",
+    "get_clean_filter_autocrlf",
+    "get_smudge_filter",
+    "get_smudge_filter_autocrlf",
+    "normalize_blob",
+]
+
 import logging
 import logging
 from collections.abc import Callable, Mapping
 from collections.abc import Callable, Mapping
 from typing import TYPE_CHECKING, Any
 from typing import TYPE_CHECKING, Any

+ 6 - 0
dulwich/log_utils.py

@@ -36,6 +36,12 @@ module needs something else, it can import the standard logging module
 directly.
 directly.
 """
 """
 
 
+__all__ = [
+    "default_logging_config",
+    "getLogger",
+    "remove_null_handler",
+]
+
 import logging
 import logging
 import os
 import os
 import sys
 import sys

+ 5 - 0
dulwich/lru_cache.py

@@ -22,6 +22,11 @@
 
 
 """A simple least-recently-used (LRU) cache."""
 """A simple least-recently-used (LRU) cache."""
 
 
+__all__ = [
+    "LRUCache",
+    "LRUSizeCache",
+]
+
 from collections.abc import Callable, Iterable, Iterator
 from collections.abc import Callable, Iterable, Iterator
 from typing import Generic, TypeVar, cast
 from typing import Generic, TypeVar, cast
 
 

+ 6 - 0
dulwich/mailmap.py

@@ -21,6 +21,12 @@
 
 
 """Mailmap file reader."""
 """Mailmap file reader."""
 
 
+__all__ = [
+    "Mailmap",
+    "parse_identity",
+    "read_mailmap",
+]
+
 from collections.abc import Iterator
 from collections.abc import Iterator
 from typing import IO
 from typing import IO
 
 

+ 16 - 0
dulwich/maintenance.py

@@ -4,6 +4,22 @@ This module provides the git maintenance functionality for optimizing
 and maintaining Git repositories.
 and maintaining Git repositories.
 """
 """
 
 
+__all__ = [
+    "CommitGraphTask",
+    "GcTask",
+    "IncrementalRepackTask",
+    "LooseObjectsTask",
+    "MaintenanceResult",
+    "MaintenanceSchedule",
+    "MaintenanceTask",
+    "PackRefsTask",
+    "PrefetchTask",
+    "get_enabled_tasks",
+    "register_repository",
+    "run_maintenance",
+    "unregister_repository",
+]
+
 import logging
 import logging
 import os
 import os
 from abc import ABC, abstractmethod
 from abc import ABC, abstractmethod

+ 6 - 0
dulwich/mbox.py

@@ -26,6 +26,12 @@ into individual message files, similar to git mailsplit, and to extract
 patch information from email messages, similar to git mailinfo.
 patch information from email messages, similar to git mailinfo.
 """
 """
 
 
+__all__ = [
+    "mailinfo",
+    "split_maildir",
+    "split_mbox",
+]
+
 import mailbox
 import mailbox
 import os
 import os
 from collections.abc import Iterable, Iterator
 from collections.abc import Iterable, Iterator

+ 10 - 0
dulwich/merge.py

@@ -1,5 +1,15 @@
 """Git merge implementation."""
 """Git merge implementation."""
 
 
+__all__ = [
+    "MergeConflict",
+    "Merger",
+    "make_merge3",
+    "merge_blobs",
+    "octopus_merge",
+    "recursive_merge",
+    "three_way_merge",
+]
+
 from collections.abc import Sequence
 from collections.abc import Sequence
 from typing import TYPE_CHECKING
 from typing import TYPE_CHECKING
 
 

+ 7 - 0
dulwich/merge_drivers.py

@@ -20,6 +20,13 @@
 
 
 """Merge driver support for dulwich."""
 """Merge driver support for dulwich."""
 
 
+__all__ = [
+    "MergeDriver",
+    "MergeDriverRegistry",
+    "ProcessMergeDriver",
+    "get_merge_driver_registry",
+]
+
 import os
 import os
 import subprocess
 import subprocess
 import tempfile
 import tempfile

+ 18 - 0
dulwich/midx.py

@@ -47,6 +47,24 @@ with a multi-pack-index-chain file. This feature is not yet supported by Dulwich
 as the specification is still evolving.
 as the specification is still evolving.
 """
 """
 
 
+__all__ = [
+    "CHUNK_BTMP",
+    "CHUNK_LOFF",
+    "CHUNK_OIDF",
+    "CHUNK_OIDL",
+    "CHUNK_OOFF",
+    "CHUNK_PNAM",
+    "CHUNK_RIDX",
+    "HASH_ALGORITHM_SHA1",
+    "HASH_ALGORITHM_SHA256",
+    "MIDX_SIGNATURE",
+    "MIDX_VERSION",
+    "MultiPackIndex",
+    "load_midx",
+    "load_midx_file",
+    "write_midx",
+]
+
 import os
 import os
 import struct
 import struct
 from collections.abc import Iterator
 from collections.abc import Iterator

+ 11 - 0
dulwich/notes.py

@@ -20,6 +20,17 @@
 
 
 """Git notes handling."""
 """Git notes handling."""
 
 
+__all__ = [
+    "DEFAULT_NOTES_REF",
+    "NOTES_REF_PREFIX",
+    "Notes",
+    "NotesTree",
+    "create_notes_tree",
+    "get_note_fanout_level",
+    "get_note_path",
+    "split_path_for_fanout",
+]
+
 import stat
 import stat
 from collections.abc import Iterator, Sequence
 from collections.abc import Iterator, Sequence
 from typing import TYPE_CHECKING
 from typing import TYPE_CHECKING

+ 30 - 0
dulwich/object_store.py

@@ -23,6 +23,36 @@
 
 
 """Git object store interfaces and implementation."""
 """Git object store interfaces and implementation."""
 
 
+__all__ = [
+    "DEFAULT_TEMPFILE_GRACE_PERIOD",
+    "INFODIR",
+    "PACKDIR",
+    "PACK_MODE",
+    "BaseObjectStore",
+    "BitmapReachability",
+    "BucketBasedObjectStore",
+    "DiskObjectStore",
+    "GraphTraversalReachability",
+    "GraphWalker",
+    "MemoryObjectStore",
+    "MissingObjectFinder",
+    "ObjectIterator",
+    "ObjectReachabilityProvider",
+    "ObjectStoreGraphWalker",
+    "OverlayObjectStore",
+    "PackBasedObjectStore",
+    "PackCapableObjectStore",
+    "PackContainer",
+    "commit_tree_changes",
+    "find_shallow",
+    "get_depth",
+    "iter_commit_contents",
+    "iter_tree_contents",
+    "peel_sha",
+    "read_packs_file",
+    "tree_lookup_path",
+]
+
 import binascii
 import binascii
 import os
 import os
 import stat
 import stat

+ 50 - 0
dulwich/objects.py

@@ -22,6 +22,56 @@
 
 
 """Access to base git objects."""
 """Access to base git objects."""
 
 
+__all__ = [
+    "BEGIN_PGP_SIGNATURE",
+    "BEGIN_SSH_SIGNATURE",
+    "MAX_TIME",
+    "OBJECT_CLASSES",
+    "SIGNATURE_PGP",
+    "SIGNATURE_SSH",
+    "S_IFGITLINK",
+    "S_ISGITLINK",
+    "ZERO_SHA",
+    "Blob",
+    "Commit",
+    "EmptyFileException",
+    "FixedSha",
+    "ObjectID",
+    "RawObjectID",
+    "ShaFile",
+    "SubmoduleEncountered",
+    "Tag",
+    "Tree",
+    "TreeEntry",
+    "check_hexsha",
+    "check_identity",
+    "check_time",
+    "filename_to_hex",
+    "format_time_entry",
+    "format_timezone",
+    "git_line",
+    "hex_to_filename",
+    "hex_to_sha",
+    "is_blob",
+    "is_commit",
+    "is_tag",
+    "is_tree",
+    "key_entry",
+    "key_entry_name_order",
+    "object_class",
+    "object_header",
+    "parse_commit",
+    "parse_time_entry",
+    "parse_timezone",
+    "parse_tree",
+    "pretty_format_tree_entry",
+    "serializable_property",
+    "serialize_tree",
+    "sha_to_hex",
+    "sorted_tree_items",
+    "valid_hexsha",
+]
+
 import binascii
 import binascii
 import os
 import os
 import posixpath
 import posixpath

+ 14 - 0
dulwich/objectspec.py

@@ -21,6 +21,20 @@
 
 
 """Object specification."""
 """Object specification."""
 
 
+__all__ = [
+    "AmbiguousShortId",
+    "parse_commit",
+    "parse_commit_range",
+    "parse_object",
+    "parse_ref",
+    "parse_refs",
+    "parse_reftuple",
+    "parse_reftuples",
+    "parse_tree",
+    "scan_for_short_id",
+    "to_bytes",
+]
+
 from collections.abc import Sequence
 from collections.abc import Sequence
 from typing import TYPE_CHECKING
 from typing import TYPE_CHECKING
 
 

+ 64 - 0
dulwich/pack.py

@@ -33,6 +33,70 @@ match for the object name. You then use the pointer got from this as
 a pointer in to the corresponding packfile.
 a pointer in to the corresponding packfile.
 """
 """
 
 
+__all__ = [
+    "DEFAULT_PACK_DELTA_WINDOW_SIZE",
+    "DEFAULT_PACK_INDEX_VERSION",
+    "DELTA_TYPES",
+    "OFS_DELTA",
+    "PACK_SPOOL_FILE_MAX_SIZE",
+    "REF_DELTA",
+    "DeltaChainIterator",
+    "FilePackIndex",
+    "MemoryPackIndex",
+    "ObjectContainer",
+    "Pack",
+    "PackChunkGenerator",
+    "PackData",
+    "PackFileDisappeared",
+    "PackHint",
+    "PackIndex",
+    "PackIndex1",
+    "PackIndex2",
+    "PackIndex3",
+    "PackIndexEntry",
+    "PackIndexer",
+    "PackInflater",
+    "PackStreamCopier",
+    "PackStreamReader",
+    "PackedObjectContainer",
+    "SHA1Reader",
+    "SHA1Writer",
+    "UnpackedObject",
+    "UnpackedObjectIterator",
+    "UnpackedObjectStream",
+    "UnresolvedDeltas",
+    "apply_delta",
+    "bisect_find_sha",
+    "chunks_length",
+    "compute_file_sha",
+    "deltas_from_sorted_objects",
+    "deltify_pack_objects",
+    "extend_pack",
+    "find_reusable_deltas",
+    "full_unpacked_object",
+    "generate_unpacked_objects",
+    "iter_sha1",
+    "load_pack_index",
+    "load_pack_index_file",
+    "obj_sha",
+    "pack_header_chunks",
+    "pack_object_chunks",
+    "pack_object_header",
+    "pack_objects_to_data",
+    "read_pack_header",
+    "read_zlib_chunks",
+    "sort_objects_for_delta",
+    "take_msb_bytes",
+    "unpack_object",
+    "write_pack",
+    "write_pack_data",
+    "write_pack_from_container",
+    "write_pack_header",
+    "write_pack_index",
+    "write_pack_object",
+    "write_pack_objects",
+]
+
 import binascii
 import binascii
 from collections import defaultdict, deque
 from collections import defaultdict, deque
 from contextlib import suppress
 from contextlib import suppress

+ 23 - 0
dulwich/patch.py

@@ -25,6 +25,29 @@ These patches are basically unified diffs with some extra metadata tacked
 on.
 on.
 """
 """
 
 
+__all__ = [
+    "DEFAULT_DIFF_ALGORITHM",
+    "FIRST_FEW_BYTES",
+    "DiffAlgorithmNotAvailable",
+    "MailinfoResult",
+    "commit_patch_id",
+    "gen_diff_header",
+    "get_summary",
+    "git_am_patch_split",
+    "is_binary",
+    "mailinfo",
+    "parse_patch_message",
+    "patch_filename",
+    "patch_id",
+    "shortid",
+    "unified_diff",
+    "unified_diff_with_algorithm",
+    "write_blob_diff",
+    "write_commit_patch",
+    "write_object_diff",
+    "write_tree_diff",
+]
+
 import email.message
 import email.message
 import email.parser
 import email.parser
 import email.utils
 import email.utils

+ 181 - 1
dulwich/porcelain.py

@@ -1,4 +1,4 @@
-# e porcelain.py -- Porcelain-like layer on top of Dulwich
+# porcelain.py -- Porcelain-like layer on top of Dulwich
 # Copyright (C) 2013 Jelmer Vernooij <jelmer@jelmer.uk>
 # Copyright (C) 2013 Jelmer Vernooij <jelmer@jelmer.uk>
 #
 #
 # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
 # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
@@ -84,6 +84,186 @@ to the repository root.
 Functions should generally accept both unicode strings and bytestrings
 Functions should generally accept both unicode strings and bytestrings
 """
 """
 
 
+__all__ = [
+    "CheckoutError",
+    "CountObjectsResult",
+    "DivergedBranches",
+    "Error",
+    "NoneStream",
+    "RemoteExists",
+    "TimezoneFormatError",
+    "TransportKwargs",
+    "active_branch",
+    "add",
+    "annotate",
+    "archive",
+    "bisect_bad",
+    "bisect_good",
+    "bisect_log",
+    "bisect_replay",
+    "bisect_reset",
+    "bisect_skip",
+    "bisect_start",
+    "branch_create",
+    "branch_delete",
+    "branch_list",
+    "branch_remotes_list",
+    "branches_containing",
+    "check_diverged",
+    "check_ignore",
+    "check_mailmap",
+    "checkout",
+    "checkout_branch",
+    "cherry",
+    "cherry_pick",
+    "clean",
+    "clone",
+    "commit",
+    "commit_decode",
+    "commit_encode",
+    "commit_tree",
+    "cone_mode_add",
+    "cone_mode_init",
+    "cone_mode_set",
+    "count_objects",
+    "daemon",
+    "describe",
+    "diff",
+    "diff_tree",
+    "fetch",
+    "filter_branch",
+    "filter_branches_by_pattern",
+    "find_unique_abbrev",
+    "for_each_ref",
+    "format_patch",
+    "fsck",
+    "gc",
+    "get_branch_merge",
+    "get_branch_remote",
+    "get_object_by_path",
+    "get_remote_repo",
+    "get_tree_changes",
+    "get_untracked_paths",
+    "get_user_timezones",
+    "grep",
+    "independent_commits",
+    "init",
+    "interpret_trailers",
+    "is_ancestor",
+    "is_interactive_rebase",
+    "lfs_clean",
+    "lfs_fetch",
+    "lfs_init",
+    "lfs_ls_files",
+    "lfs_migrate",
+    "lfs_pointer_check",
+    "lfs_pull",
+    "lfs_push",
+    "lfs_smudge",
+    "lfs_status",
+    "lfs_track",
+    "lfs_untrack",
+    "log",
+    "ls_files",
+    "ls_remote",
+    "ls_tree",
+    "mailinfo",
+    "mailsplit",
+    "maintenance_register",
+    "maintenance_run",
+    "maintenance_unregister",
+    "merge",
+    "merge_base",
+    "merge_tree",
+    "merged_branches",
+    "mv",
+    "no_merged_branches",
+    "notes_add",
+    "notes_list",
+    "notes_remove",
+    "notes_show",
+    "open_repo",
+    "open_repo_closing",
+    "pack_objects",
+    "pack_refs",
+    "parse_timezone_format",
+    "path_to_tree_path",
+    "print_commit",
+    "print_name_status",
+    "print_tag",
+    "prune",
+    "pull",
+    "push",
+    "rebase",
+    "receive_pack",
+    "reflog",
+    "reflog_delete",
+    "reflog_expire",
+    "remote_add",
+    "remote_remove",
+    "remove",
+    "repack",
+    "replace_create",
+    "replace_delete",
+    "replace_list",
+    "rerere",
+    "rerere_clear",
+    "rerere_diff",
+    "rerere_forget",
+    "rerere_gc",
+    "rerere_status",
+    "reset",
+    "reset_file",
+    "restore",
+    "rev_list",
+    "revert",
+    "set_branch_tracking",
+    "shortlog",
+    "show",
+    "show_blob",
+    "show_branch",
+    "show_commit",
+    "show_object",
+    "show_ref",
+    "show_tag",
+    "show_tree",
+    "sparse_checkout",
+    "stash_drop",
+    "stash_list",
+    "stash_pop",
+    "stash_push",
+    "status",
+    "stripspace",
+    "submodule_add",
+    "submodule_init",
+    "submodule_list",
+    "submodule_update",
+    "switch",
+    "symbolic_ref",
+    "tag_create",
+    "tag_delete",
+    "tag_list",
+    "unpack_objects",
+    "update_head",
+    "update_server_info",
+    "upload_pack",
+    "var",
+    "var_list",
+    "verify_commit",
+    "verify_tag",
+    "web_daemon",
+    "worktree_add",
+    "worktree_list",
+    "worktree_lock",
+    "worktree_move",
+    "worktree_prune",
+    "worktree_remove",
+    "worktree_repair",
+    "worktree_unlock",
+    "write_commit_graph",
+    "write_tree",
+]
+
 import datetime
 import datetime
 import fnmatch
 import fnmatch
 import logging
 import logging

+ 77 - 0
dulwich/protocol.py

@@ -22,6 +22,83 @@
 
 
 """Generic functions for talking the git smart server protocol."""
 """Generic functions for talking the git smart server protocol."""
 
 
+__all__ = [
+    "CAPABILITIES_REF",
+    "CAPABILITY_AGENT",
+    "CAPABILITY_ALLOW_REACHABLE_SHA1_IN_WANT",
+    "CAPABILITY_ALLOW_TIP_SHA1_IN_WANT",
+    "CAPABILITY_ATOMIC",
+    "CAPABILITY_DEEPEN_NOT",
+    "CAPABILITY_DEEPEN_RELATIVE",
+    "CAPABILITY_DEEPEN_SINCE",
+    "CAPABILITY_DELETE_REFS",
+    "CAPABILITY_FETCH",
+    "CAPABILITY_FILTER",
+    "CAPABILITY_INCLUDE_TAG",
+    "CAPABILITY_MULTI_ACK",
+    "CAPABILITY_MULTI_ACK_DETAILED",
+    "CAPABILITY_NO_DONE",
+    "CAPABILITY_NO_PROGRESS",
+    "CAPABILITY_OFS_DELTA",
+    "CAPABILITY_QUIET",
+    "CAPABILITY_REPORT_STATUS",
+    "CAPABILITY_SHALLOW",
+    "CAPABILITY_SIDE_BAND",
+    "CAPABILITY_SIDE_BAND_64K",
+    "CAPABILITY_SYMREF",
+    "CAPABILITY_THIN_PACK",
+    "COMMAND_DEEPEN",
+    "COMMAND_DEEPEN_NOT",
+    "COMMAND_DEEPEN_SINCE",
+    "COMMAND_DONE",
+    "COMMAND_HAVE",
+    "COMMAND_SHALLOW",
+    "COMMAND_UNSHALLOW",
+    "COMMAND_WANT",
+    "COMMON_CAPABILITIES",
+    "DEFAULT_GIT_PROTOCOL_VERSION_FETCH",
+    "DEFAULT_GIT_PROTOCOL_VERSION_SEND",
+    "DEPTH_INFINITE",
+    "GIT_PROTOCOL_VERSIONS",
+    "KNOWN_RECEIVE_CAPABILITIES",
+    "KNOWN_UPLOAD_CAPABILITIES",
+    "MULTI_ACK",
+    "MULTI_ACK_DETAILED",
+    "NAK_LINE",
+    "PEELED_TAG_SUFFIX",
+    "SIDE_BAND_CHANNEL_DATA",
+    "SIDE_BAND_CHANNEL_FATAL",
+    "SIDE_BAND_CHANNEL_PROGRESS",
+    "SINGLE_ACK",
+    "TCP_GIT_PORT",
+    "BufferedPktLineWriter",
+    "PktLineParser",
+    "Protocol",
+    "ReceivableProtocol",
+    "ack_type",
+    "agent_string",
+    "capability_agent",
+    "capability_symref",
+    "extract_capabilities",
+    "extract_capability_names",
+    "extract_want_line_capabilities",
+    "format_ack_line",
+    "format_capability_line",
+    "format_cmd_pkt",
+    "format_ref_line",
+    "format_shallow_line",
+    "format_unshallow_line",
+    "parse_capability",
+    "parse_cmd_pkt",
+    "pkt_line",
+    "pkt_seq",
+    "serialize_refs",
+    "split_peeled_refs",
+    "strip_peeled_refs",
+    "symref_capabilities",
+    "write_info_refs",
+]
+
 import types
 import types
 from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
 from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
 from io import BytesIO
 from io import BytesIO

+ 18 - 0
dulwich/rebase.py

@@ -21,6 +21,24 @@
 
 
 """Git rebase implementation."""
 """Git rebase implementation."""
 
 
+__all__ = [
+    "DiskRebaseStateManager",
+    "MemoryRebaseStateManager",
+    "RebaseAbort",
+    "RebaseConflict",
+    "RebaseError",
+    "RebaseState",
+    "RebaseStateManager",
+    "RebaseTodo",
+    "RebaseTodoCommand",
+    "RebaseTodoEntry",
+    "Rebaser",
+    "edit_todo",
+    "process_interactive_rebase",
+    "rebase",
+    "start_interactive",
+]
+
 import os
 import os
 import shutil
 import shutil
 import subprocess
 import subprocess

+ 10 - 0
dulwich/reflog.py

@@ -21,6 +21,16 @@
 
 
 """Utilities for reading and generating reflogs."""
 """Utilities for reading and generating reflogs."""
 
 
+__all__ = [
+    "drop_reflog_entry",
+    "expire_reflog",
+    "format_reflog_line",
+    "iter_reflogs",
+    "parse_reflog_line",
+    "parse_reflog_spec",
+    "read_reflog",
+]
+
 import collections
 import collections
 from collections.abc import Callable, Generator
 from collections.abc import Callable, Generator
 from typing import IO, BinaryIO
 from typing import IO, BinaryIO

+ 33 - 0
dulwich/refs.py

@@ -22,6 +22,39 @@
 
 
 """Ref handling."""
 """Ref handling."""
 
 
+__all__ = [
+    "HEADREF",
+    "LOCAL_BRANCH_PREFIX",
+    "LOCAL_NOTES_PREFIX",
+    "LOCAL_REMOTE_PREFIX",
+    "LOCAL_REPLACE_PREFIX",
+    "LOCAL_TAG_PREFIX",
+    "SYMREF",
+    "DictRefsContainer",
+    "DiskRefsContainer",
+    "NamespacedRefsContainer",
+    "Ref",
+    "RefsContainer",
+    "SymrefLoop",
+    "check_ref_format",
+    "extract_branch_name",
+    "extract_tag_name",
+    "filter_ref_prefix",
+    "is_local_branch",
+    "is_per_worktree_ref",
+    "local_branch_name",
+    "local_replace_name",
+    "local_tag_name",
+    "parse_remote_ref",
+    "parse_symref_value",
+    "read_info_refs",
+    "read_packed_refs",
+    "read_packed_refs_with_peeled",
+    "set_ref_from_raw",
+    "shorten_ref_name",
+    "write_packed_refs",
+]
+
 import os
 import os
 import types
 import types
 from collections.abc import Callable, Iterable, Iterator, Mapping
 from collections.abc import Callable, Iterable, Iterator, Mapping

+ 35 - 0
dulwich/reftable.py

@@ -7,6 +7,41 @@ loose refs format.
 See: https://git-scm.com/docs/reftable
 See: https://git-scm.com/docs/reftable
 """
 """
 
 
+__all__ = [
+    "BLOCK_TYPE_INDEX",
+    "BLOCK_TYPE_LOG",
+    "BLOCK_TYPE_OBJ",
+    "BLOCK_TYPE_REF",
+    "CRC_DATA_SIZE",
+    "DEFAULT_BLOCK_SIZE",
+    "EMBEDDED_FOOTER_MARKER",
+    "FINAL_PADDING_SIZE",
+    "HEADER_SIZE_V1",
+    "MAX_REASONABLE_BLOCK_SIZE",
+    "MAX_REASONABLE_SUFFIX_LEN",
+    "MAX_SYMREF_DEPTH",
+    "MIN_RECORD_SIZE",
+    "REFTABLE_MAGIC",
+    "REFTABLE_VERSION",
+    "REF_VALUE_DELETE",
+    "REF_VALUE_PEELED",
+    "REF_VALUE_REF",
+    "REF_VALUE_SYMREF",
+    "SHA1_BINARY_SIZE",
+    "SHA1_HEX_SIZE",
+    "SHA1_PEELED_HEX_SIZE",
+    "LogBlock",
+    "RefBlock",
+    "RefRecord",
+    "RefUpdate",
+    "RefValue",
+    "ReftableReader",
+    "ReftableRefsContainer",
+    "ReftableWriter",
+    "decode_varint_from_stream",
+    "encode_varint",
+]
+
 import os
 import os
 import random
 import random
 import shutil
 import shutil

+ 29 - 0
dulwich/repo.py

@@ -29,6 +29,35 @@ local disk (Repo).
 
 
 """
 """
 
 
+__all__ = [
+    "BASE_DIRECTORIES",
+    "COMMONDIR",
+    "CONTROLDIR",
+    "DEFAULT_BRANCH",
+    "DEFAULT_OFS_DELTA",
+    "GITDIR",
+    "INDEX_FILENAME",
+    "OBJECTDIR",
+    "REFSDIR",
+    "REFSDIR_HEADS",
+    "REFSDIR_TAGS",
+    "WORKTREES",
+    "BaseRepo",
+    "DefaultIdentityNotFound",
+    "InvalidUserIdentity",
+    "MemoryRepo",
+    "ParentsProvider",
+    "Repo",
+    "UnsupportedExtension",
+    "UnsupportedVersion",
+    "check_user_identity",
+    "get_user_identity",
+    "parse_graftpoints",
+    "parse_shared_repository",
+    "read_gitfile",
+    "serialize_graftpoints",
+]
+
 import os
 import os
 import stat
 import stat
 import sys
 import sys

+ 7 - 0
dulwich/rerere.py

@@ -6,6 +6,13 @@ conflict and the resolution. If the same conflict happens again, rerere can
 automatically apply the recorded resolution.
 automatically apply the recorded resolution.
 """
 """
 
 
+__all__ = [
+    "RerereCache",
+    "is_rerere_autoupdate",
+    "is_rerere_enabled",
+    "rerere_auto",
+]
+
 import hashlib
 import hashlib
 import os
 import os
 import time
 import time

+ 24 - 0
dulwich/server.py

@@ -43,6 +43,30 @@ Currently supported capabilities:
  * symref
  * symref
 """
 """
 
 
+__all__ = [
+    "DEFAULT_HANDLERS",
+    "AckGraphWalkerImpl",
+    "Backend",
+    "BackendRepo",
+    "DictBackend",
+    "FileSystemBackend",
+    "Handler",
+    "MultiAckDetailedGraphWalkerImpl",
+    "MultiAckGraphWalkerImpl",
+    "PackHandler",
+    "ReceivePackHandler",
+    "SingleAckGraphWalkerImpl",
+    "TCPGitRequestHandler",
+    "TCPGitServer",
+    "UploadArchiveHandler",
+    "UploadPackHandler",
+    "generate_info_refs",
+    "generate_objects_info_packs",
+    "main",
+    "serve_command",
+    "update_server_info",
+]
+
 import os
 import os
 import socket
 import socket
 import socketserver
 import socketserver

+ 11 - 0
dulwich/sparse_patterns.py

@@ -21,6 +21,17 @@
 
 
 """Sparse checkout pattern handling."""
 """Sparse checkout pattern handling."""
 
 
+__all__ = [
+    "BlobNotFoundError",
+    "SparseCheckoutConflictError",
+    "apply_included_paths",
+    "compute_included_paths_cone",
+    "compute_included_paths_full",
+    "determine_included_paths",
+    "match_gitignore_patterns",
+    "parse_sparse_patterns",
+]
+
 import os
 import os
 from collections.abc import Sequence, Set
 from collections.abc import Sequence, Set
 from fnmatch import fnmatch
 from fnmatch import fnmatch

+ 6 - 0
dulwich/stash.py

@@ -21,6 +21,12 @@
 
 
 """Stash handling."""
 """Stash handling."""
 
 
+__all__ = [
+    "DEFAULT_STASH_REF",
+    "CommitKwargs",
+    "Stash",
+]
+
 import os
 import os
 import sys
 import sys
 from typing import TYPE_CHECKING, TypedDict
 from typing import TYPE_CHECKING, TypedDict

+ 4 - 0
dulwich/stripspace.py

@@ -19,6 +19,10 @@
 
 
 """Git stripspace functionality for cleaning up text and commit messages."""
 """Git stripspace functionality for cleaning up text and commit messages."""
 
 
+__all__ = [
+    "stripspace",
+]
+
 
 
 def stripspace(
 def stripspace(
     text: bytes,
     text: bytes,

+ 5 - 0
dulwich/submodule.py

@@ -21,6 +21,11 @@
 
 
 """Working with Git submodules."""
 """Working with Git submodules."""
 
 
+__all__ = [
+    "ensure_submodule_placeholder",
+    "iter_cached_submodules",
+]
+
 import os
 import os
 from collections.abc import Iterator
 from collections.abc import Iterator
 from typing import TYPE_CHECKING
 from typing import TYPE_CHECKING

+ 7 - 0
dulwich/trailers.py

@@ -31,6 +31,13 @@ They are similar to RFC 822 email headers and appear at the end of commit
 messages after free-form content.
 messages after free-form content.
 """
 """
 
 
+__all__ = [
+    "Trailer",
+    "add_trailer_to_message",
+    "format_trailers",
+    "parse_trailers",
+]
+
 
 
 class Trailer:
 class Trailer:
     """Represents a single Git trailer.
     """Represents a single Git trailer.

+ 8 - 0
dulwich/walk.py

@@ -21,6 +21,14 @@
 
 
 """General implementation of walking commits and their contents."""
 """General implementation of walking commits and their contents."""
 
 
+__all__ = [
+    "ALL_ORDERS",
+    "ORDER_DATE",
+    "ORDER_TOPO",
+    "WalkEntry",
+    "Walker",
+]
+
 import heapq
 import heapq
 from collections import defaultdict, deque
 from collections import defaultdict, deque
 from collections.abc import Callable, Iterator, Sequence
 from collections.abc import Callable, Iterator, Sequence

+ 8 - 0
dulwich/whitespace.py

@@ -24,6 +24,14 @@ This module implements Git's core.whitespace configuration and related
 whitespace error detection capabilities.
 whitespace error detection capabilities.
 """
 """
 
 
+__all__ = [
+    "DEFAULT_WHITESPACE_ERRORS",
+    "WHITESPACE_ERROR_TYPES",
+    "WhitespaceChecker",
+    "fix_whitespace_errors",
+    "parse_whitespace_config",
+]
+
 from collections.abc import Sequence, Set
 from collections.abc import Sequence, Set
 
 
 # Default whitespace errors Git checks for
 # Default whitespace errors Git checks for

+ 16 - 0
dulwich/worktree.py

@@ -23,6 +23,22 @@
 
 
 from __future__ import annotations
 from __future__ import annotations
 
 
+__all__ = [
+    "WorkTree",
+    "WorkTreeContainer",
+    "WorkTreeInfo",
+    "add_worktree",
+    "list_worktrees",
+    "lock_worktree",
+    "move_worktree",
+    "prune_worktrees",
+    "read_worktree_lock_reason",
+    "remove_worktree",
+    "repair_worktree",
+    "temporary_worktree",
+    "unlock_worktree",
+]
+
 import builtins
 import builtins
 import os
 import os
 import shutil
 import shutil