Full Code of antgroup/hugescm for AI

master a41d2d951159 cached
1006 files
4.6 MB
1.3M tokens
8556 symbols
1 requests
Download .txt
Showing preview only (5,091K chars total). Download the full file or copy to clipboard to get everything.
Repository: antgroup/hugescm
Branch: master
Commit: a41d2d951159
Files: 1006
Total size: 4.6 MB

Directory structure:
gitextract_x8awn04j/

├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       └── ci.yml
├── .gitignore
├── .golangci.yml
├── CHANGELOG.md
├── LEGAL.md
├── LICENSE
├── Makefile
├── README.md
├── README.zh-CN.md
├── VERSION
├── bali.toml
├── cmd/
│   ├── README.md
│   ├── hot/
│   │   ├── command/
│   │   │   ├── command.go
│   │   │   ├── command_az.go
│   │   │   ├── command_cat.go
│   │   │   ├── command_co.go
│   │   │   ├── command_diff.go
│   │   │   ├── command_expire_refs.go
│   │   │   ├── command_graft.go
│   │   │   ├── command_mc.go
│   │   │   ├── command_prune_refs.go
│   │   │   ├── command_remove.go
│   │   │   ├── command_scan_refs.go
│   │   │   ├── command_show.go
│   │   │   ├── command_size.go
│   │   │   ├── command_smart.go
│   │   │   ├── command_snapshot.go
│   │   │   ├── command_stat.go
│   │   │   ├── command_unbranch.go
│   │   │   ├── misc.go
│   │   │   └── pager.go
│   │   ├── crate.toml
│   │   ├── hot.go
│   │   ├── pkg/
│   │   │   ├── README.md
│   │   │   ├── co/
│   │   │   │   ├── co.go
│   │   │   │   ├── misc.go
│   │   │   │   └── misc_test.go
│   │   │   ├── diff/
│   │   │   │   ├── diff.go
│   │   │   │   └── parser_test.go
│   │   │   ├── hud/
│   │   │   │   ├── bar.go
│   │   │   │   └── display.go
│   │   │   ├── mc/
│   │   │   │   └── migrate.go
│   │   │   ├── refs/
│   │   │   │   └── refs.go
│   │   │   ├── replay/
│   │   │   │   ├── cache.go
│   │   │   │   ├── cleanup.go
│   │   │   │   ├── drop.go
│   │   │   │   ├── graft.go
│   │   │   │   ├── misc.go
│   │   │   │   ├── replay.go
│   │   │   │   ├── unbranch.go
│   │   │   │   └── update.go
│   │   │   ├── stat/
│   │   │   │   ├── az.go
│   │   │   │   ├── color.go
│   │   │   │   ├── draw.go
│   │   │   │   ├── size.go
│   │   │   │   ├── stat.go
│   │   │   │   ├── stat_test.go
│   │   │   │   └── table.go
│   │   │   └── tr/
│   │   │       ├── README.md
│   │   │       ├── languages/
│   │   │       │   └── zh-CN.toml
│   │   │       ├── tr.go
│   │   │       └── tr_test.go
│   │   └── winres.toml
│   ├── zeta/
│   │   ├── crate.toml
│   │   ├── main.go
│   │   └── winres.toml
│   ├── zeta-mc/
│   │   ├── crate.toml
│   │   ├── main.go
│   │   ├── migrate.go
│   │   ├── msic.go
│   │   └── winres.toml
│   └── zeta-serve/
│       ├── command_encrypt.go
│       ├── command_httpd.go
│       ├── command_keygen.go
│       ├── command_sshd.go
│       ├── global.go
│       ├── main.go
│       ├── shutdown.go
│       ├── shutdown_other.go
│       └── shutdown_windows.go
├── docs/
│   ├── README.md
│   ├── cdc.md
│   ├── config.md
│   ├── design.md
│   ├── hot.md
│   ├── object-format.md
│   ├── pack-format.md
│   ├── protocol.md
│   ├── pull-strategy.md
│   ├── sparse-checkout.md
│   ├── stash.md
│   ├── switch.md
│   ├── version-negotiation.md
│   ├── zeta.toml
│   └── zeta.toml.example
├── go.mod
├── go.sum
├── modules/
│   ├── README.md
│   ├── base58/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── alphabet.go
│   │   ├── base58.go
│   │   ├── base58_test.go
│   │   ├── base58bench_test.go
│   │   ├── base58check.go
│   │   ├── base58check_test.go
│   │   ├── cov_report.sh
│   │   ├── doc.go
│   │   ├── example_test.go
│   │   └── genalphabet.go
│   ├── binary/
│   │   ├── read.go
│   │   └── write.go
│   ├── bitmap/
│   │   ├── LICENSE
│   │   ├── bitmap.go
│   │   └── bitmap_test.go
│   ├── chardet/
│   │   ├── 2022.go
│   │   ├── LICENSE
│   │   ├── VERSION
│   │   ├── detector.go
│   │   ├── encoding.go
│   │   ├── icu-license.html
│   │   ├── multi_byte.go
│   │   ├── recognizer.go
│   │   ├── single_byte.go
│   │   ├── unicode.go
│   │   └── utf8.go
│   ├── command/
│   │   ├── command.go
│   │   ├── shepherd.go
│   │   ├── shepherd_linux.go
│   │   ├── shepherd_test.go
│   │   ├── shepherd_unix.go
│   │   ├── shepherd_win.go
│   │   └── util.go
│   ├── crc/
│   │   └── reader.go
│   ├── deflect/
│   │   ├── az.go
│   │   ├── deflect.go
│   │   ├── deflect_test.go
│   │   ├── du.go
│   │   ├── pack.go
│   │   └── struct.go
│   ├── diferenco/
│   │   ├── MERGE_PARALLEL.md
│   │   ├── README.md
│   │   ├── algorithms_bench_test.go
│   │   ├── color/
│   │   │   └── color.go
│   │   ├── diferenco.go
│   │   ├── diferenco_test.go
│   │   ├── gen_unicode.go
│   │   ├── histogram.go
│   │   ├── histogram_test.go
│   │   ├── lcs/
│   │   │   ├── LICENSE
│   │   │   ├── common.go
│   │   │   ├── common_test.go
│   │   │   ├── doc.go
│   │   │   ├── git.sh
│   │   │   ├── labels.go
│   │   │   ├── old.go
│   │   │   ├── old_test.go
│   │   │   └── sequence.go
│   │   ├── merge.go
│   │   ├── merge_parallel.go
│   │   ├── merge_parallel_bench_test.go
│   │   ├── merge_parallel_test.go
│   │   ├── merge_test.go
│   │   ├── minimal.go
│   │   ├── minimal_test.go
│   │   ├── myers.go
│   │   ├── myers_bench_test.go
│   │   ├── myers_test.go
│   │   ├── onp.go
│   │   ├── onp_test.go
│   │   ├── patience.go
│   │   ├── patience_bench_test.go
│   │   ├── patience_test.go
│   │   ├── regression_test.go
│   │   ├── sink.go
│   │   ├── sink_test.go
│   │   ├── suffixarray.go
│   │   ├── suffixarray_test.go
│   │   ├── testdata/
│   │   │   ├── a.txt
│   │   │   ├── b.txt
│   │   │   ├── css_1.css
│   │   │   ├── css_2.css
│   │   │   ├── simple_1.scss
│   │   │   └── simple_2.scss
│   │   ├── text.go
│   │   ├── unicode.go
│   │   ├── unicode_data.go
│   │   ├── unicode_test.go
│   │   ├── unified.go
│   │   └── unified_encoder.go
│   ├── env/
│   │   ├── broker.go
│   │   ├── builder.go
│   │   ├── constant.go
│   │   ├── env.go
│   │   ├── env_test.go
│   │   ├── env_unix.go
│   │   ├── env_windows.go
│   │   └── env_windows_test.go
│   ├── fnmatch/
│   │   ├── LICENSE
│   │   ├── VERSION
│   │   ├── fnmatch.go
│   │   └── fnmatch_test.go
│   ├── gcfg/
│   │   ├── LICENSE
│   │   ├── Makefile
│   │   ├── VERSION
│   │   ├── doc.go
│   │   ├── errors.go
│   │   ├── errors_test.go
│   │   ├── example_test.go
│   │   ├── issues_test.go
│   │   ├── read.go
│   │   ├── read_test.go
│   │   ├── scanner/
│   │   │   ├── errors.go
│   │   │   ├── example_test.go
│   │   │   ├── scanner.go
│   │   │   └── scanner_test.go
│   │   ├── set.go
│   │   ├── token/
│   │   │   ├── position.go
│   │   │   ├── position_test.go
│   │   │   ├── serialize.go
│   │   │   ├── serialize_test.go
│   │   │   └── token.go
│   │   └── types/
│   │       ├── bool.go
│   │       ├── doc.go
│   │       ├── enum.go
│   │       ├── enum_test.go
│   │       ├── int.go
│   │       ├── int_test.go
│   │       ├── scan.go
│   │       └── scan_test.go
│   ├── git/
│   │   ├── branch.go
│   │   ├── command.go
│   │   ├── commit.go
│   │   ├── commit_test.go
│   │   ├── config/
│   │   │   ├── config.go
│   │   │   ├── decoder.go
│   │   │   ├── option.go
│   │   │   └── section.go
│   │   ├── constant.go
│   │   ├── decode.go
│   │   ├── error.go
│   │   ├── filemode.go
│   │   ├── gitobj/
│   │   │   ├── LICENSE.md
│   │   │   ├── README.md
│   │   │   ├── SECURITY.md
│   │   │   ├── VERSION
│   │   │   ├── backend.go
│   │   │   ├── backend_nix.go
│   │   │   ├── backend_test.go
│   │   │   ├── backend_windows.go
│   │   │   ├── blob.go
│   │   │   ├── blob_test.go
│   │   │   ├── commit.go
│   │   │   ├── commit_test.go
│   │   │   ├── errors/
│   │   │   │   ├── errors.go
│   │   │   │   └── errors_test.go
│   │   │   ├── errors.go
│   │   │   ├── errors_test.go
│   │   │   ├── file_storer.go
│   │   │   ├── memory_storer.go
│   │   │   ├── memory_storer_test.go
│   │   │   ├── object.go
│   │   │   ├── object_db.go
│   │   │   ├── object_db_test.go
│   │   │   ├── object_reader.go
│   │   │   ├── object_reader_test.go
│   │   │   ├── object_type.go
│   │   │   ├── object_type_test.go
│   │   │   ├── object_writer.go
│   │   │   ├── object_writer_test.go
│   │   │   ├── pack/
│   │   │   │   ├── bounds.go
│   │   │   │   ├── bounds_test.go
│   │   │   │   ├── chain.go
│   │   │   │   ├── chain_base.go
│   │   │   │   ├── chain_base_test.go
│   │   │   │   ├── chain_delta.go
│   │   │   │   ├── chain_delta_test.go
│   │   │   │   ├── chain_test.go
│   │   │   │   ├── delayed_object.go
│   │   │   │   ├── errors.go
│   │   │   │   ├── errors_test.go
│   │   │   │   ├── index.go
│   │   │   │   ├── index_decode.go
│   │   │   │   ├── index_decode_test.go
│   │   │   │   ├── index_entry.go
│   │   │   │   ├── index_test.go
│   │   │   │   ├── index_v1.go
│   │   │   │   ├── index_v1_test.go
│   │   │   │   ├── index_v2.go
│   │   │   │   ├── index_v2_test.go
│   │   │   │   ├── index_version.go
│   │   │   │   ├── io.go
│   │   │   │   ├── io_test.go
│   │   │   │   ├── object.go
│   │   │   │   ├── object_test.go
│   │   │   │   ├── packfile.go
│   │   │   │   ├── packfile_decode.go
│   │   │   │   ├── packfile_decode_test.go
│   │   │   │   ├── packfile_test.go
│   │   │   │   ├── set.go
│   │   │   │   ├── set_test.go
│   │   │   │   ├── storage.go
│   │   │   │   ├── type.go
│   │   │   │   └── type_test.go
│   │   │   ├── storage/
│   │   │   │   ├── backend.go
│   │   │   │   ├── decompressing_readcloser.go
│   │   │   │   ├── multi_storage.go
│   │   │   │   └── storage.go
│   │   │   ├── storer.go
│   │   │   ├── tag.go
│   │   │   ├── tag_test.go
│   │   │   ├── tree.go
│   │   │   └── tree_test.go
│   │   ├── hash.go
│   │   ├── hash_test.go
│   │   ├── object.go
│   │   ├── odb.go
│   │   ├── reference.go
│   │   ├── reftable/
│   │   │   └── reftable.go
│   │   ├── remote.go
│   │   ├── repo.go
│   │   ├── repo_test.go
│   │   ├── signature.go
│   │   ├── stats/
│   │   │   ├── commit-graph.go
│   │   │   └── status.go
│   │   ├── tag.go
│   │   ├── tree.go
│   │   ├── updateref.go
│   │   ├── util.go
│   │   ├── version.go
│   │   └── version_test.go
│   ├── hexview/
│   │   ├── format.go
│   │   └── format_test.go
│   ├── keyring/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── VERSION
│   │   ├── keyring.go
│   │   ├── keyring_darwin.go
│   │   ├── keyring_darwin_security.go
│   │   ├── keyring_darwin_security_test.go
│   │   ├── keyring_darwin_test.go
│   │   ├── keyring_file.go
│   │   ├── keyring_file_test.go
│   │   ├── keyring_test.go
│   │   ├── keyring_unix.go
│   │   ├── keyring_windows.go
│   │   └── secret_service/
│   │       └── secret_service.go
│   ├── lfs/
│   │   ├── LICENSE
│   │   ├── error.go
│   │   ├── pointer.go
│   │   └── pointer_test.go
│   ├── locale/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── error.go
│   │   ├── locale.go
│   │   ├── locale_darwin.go
│   │   ├── locale_js.go
│   │   ├── locale_posix.go
│   │   ├── locale_shared.go
│   │   └── locale_windows.go
│   ├── merkletrie/
│   │   ├── LICENSE
│   │   ├── change.go
│   │   ├── difftree.go
│   │   ├── doc.go
│   │   ├── doubleiter.go
│   │   ├── filesystem/
│   │   │   ├── node.go
│   │   │   └── node_test.go
│   │   ├── index/
│   │   │   └── node.go
│   │   ├── internal/
│   │   │   ├── frame/
│   │   │   │   └── frame.go
│   │   │   └── fsnoder/
│   │   │       ├── dir.go
│   │   │       ├── doc.go
│   │   │       ├── file.go
│   │   │       └── new.go
│   │   ├── iter.go
│   │   └── noder/
│   │       ├── noder.go
│   │       ├── path.go
│   │       ├── sparse.go
│   │       └── sparse_test.go
│   ├── mime/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── VERSION
│   │   ├── internal/
│   │   │   ├── charset/
│   │   │   │   ├── charset.go
│   │   │   │   └── charset_test.go
│   │   │   ├── csv/
│   │   │   │   ├── parser.go
│   │   │   │   └── parser_test.go
│   │   │   ├── json/
│   │   │   │   ├── parser.go
│   │   │   │   └── parser_test.go
│   │   │   ├── magic/
│   │   │   │   ├── archive.go
│   │   │   │   ├── archive_test.go
│   │   │   │   ├── audio.go
│   │   │   │   ├── binary.go
│   │   │   │   ├── database.go
│   │   │   │   ├── document.go
│   │   │   │   ├── font.go
│   │   │   │   ├── ftyp.go
│   │   │   │   ├── geo.go
│   │   │   │   ├── image.go
│   │   │   │   ├── magic.go
│   │   │   │   ├── magic_test.go
│   │   │   │   ├── meteo.go
│   │   │   │   ├── ms_office.go
│   │   │   │   ├── netpbm.go
│   │   │   │   ├── ogg.go
│   │   │   │   ├── text.go
│   │   │   │   ├── text_csv.go
│   │   │   │   ├── text_test.go
│   │   │   │   ├── video.go
│   │   │   │   ├── zip.go
│   │   │   │   └── zip_test.go
│   │   │   ├── markup/
│   │   │   │   ├── markup.go
│   │   │   │   └── markup_test.go
│   │   │   └── scan/
│   │   │       ├── bytes.go
│   │   │       └── bytes_test.go
│   │   ├── mime.go
│   │   ├── mime_test.go
│   │   ├── mimetsx
│   │   ├── mimetype.go
│   │   ├── sanitize.go
│   │   └── tree.go
│   ├── oss/
│   │   ├── bucket.go
│   │   ├── delete.go
│   │   ├── error.go
│   │   ├── gcs.example
│   │   ├── list.go
│   │   ├── misc.go
│   │   ├── misc_test.go
│   │   ├── multipart.go
│   │   ├── oss.go
│   │   ├── s3.example
│   │   ├── signature.go
│   │   └── upload.go
│   ├── patchview/
│   │   ├── highlight.go
│   │   ├── highlight_test.go
│   │   ├── renderer.go
│   │   ├── status_bar.go
│   │   ├── styles.go
│   │   └── view.go
│   ├── plumbing/
│   │   ├── LICENSE
│   │   ├── error.go
│   │   ├── filemode/
│   │   │   ├── filemode.go
│   │   │   └── filemode_test.go
│   │   ├── format/
│   │   │   ├── ignore/
│   │   │   │   ├── dir.go
│   │   │   │   ├── doc.go
│   │   │   │   ├── ignore_test.go
│   │   │   │   ├── matcher.go
│   │   │   │   └── pattern.go
│   │   │   ├── index/
│   │   │   │   ├── decoder.go
│   │   │   │   ├── decoder_test.go
│   │   │   │   ├── doc.go
│   │   │   │   ├── encoder.go
│   │   │   │   ├── encoder_test.go
│   │   │   │   ├── index.go
│   │   │   │   └── match.go
│   │   │   ├── pktline/
│   │   │   │   ├── encoder.go
│   │   │   │   ├── encoder_test.go
│   │   │   │   ├── scanner.go
│   │   │   │   └── scanner_test.go
│   │   │   └── readme.md
│   │   ├── hash.go
│   │   ├── reference.go
│   │   └── validate.go
│   ├── progressbar/
│   │   ├── LICENSE
│   │   ├── VERSION
│   │   ├── colorstring/
│   │   │   ├── LICENSE
│   │   │   └── colorstring.go
│   │   ├── progressbar.go
│   │   └── spinners.go
│   ├── securejoin/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── join.go
│   │   └── vfs.go
│   ├── shlex/
│   │   ├── LICENSE
│   │   └── shlex.go
│   ├── streamio/
│   │   ├── bytes.go
│   │   ├── io.go
│   │   ├── io_test.go
│   │   ├── sync.go
│   │   ├── zlib.go
│   │   ├── zlib_test.go
│   │   ├── zstd.go
│   │   └── zstd_test.go
│   ├── strengthen/
│   │   ├── du.go
│   │   ├── du_test.go
│   │   ├── du_windows.go
│   │   ├── duration.go
│   │   ├── duration_test.go
│   │   ├── formatsize.go
│   │   ├── fs_unix.go
│   │   ├── fs_windows.go
│   │   ├── limitwriter.go
│   │   ├── measure.go
│   │   ├── net.go
│   │   ├── os_unix.go
│   │   ├── os_windows.go
│   │   ├── path.go
│   │   ├── path_test.go
│   │   ├── rid.go
│   │   ├── rid_test.go
│   │   ├── statfs.go
│   │   ├── statfs_linux.go
│   │   ├── statfs_openbsd.go
│   │   ├── statfs_test.go
│   │   ├── statfs_unix.go
│   │   ├── statfs_windows.go
│   │   └── strings.go
│   ├── symlink/
│   │   ├── LICENSE
│   │   ├── LICENSE.APACHE
│   │   ├── LICENSE.BSD
│   │   ├── doc.go
│   │   ├── fs.go
│   │   ├── fs_unix.go
│   │   └── fs_windows.go
│   ├── systemproxy/
│   │   ├── dialer.go
│   │   ├── env.go
│   │   ├── http.go
│   │   ├── http_test.go
│   │   ├── internal/
│   │   │   ├── readme.md
│   │   │   └── socks/
│   │   │       ├── client.go
│   │   │       └── socks.go
│   │   ├── pre_host.go
│   │   ├── pre_host_test.go
│   │   ├── proxy.go
│   │   ├── proxy_darwin.go
│   │   ├── proxy_darwin_test.go
│   │   ├── proxy_others.go
│   │   ├── proxy_test.go
│   │   ├── proxy_windows.go
│   │   ├── socks5.go
│   │   ├── url.go
│   │   └── url_test.go
│   ├── term/
│   │   ├── color.go
│   │   ├── fmt.go
│   │   ├── fmt_test.go
│   │   ├── sanitized.go
│   │   ├── terminal.go
│   │   ├── terminal_others.go
│   │   └── terminal_windows.go
│   ├── trace/
│   │   ├── error.go
│   │   ├── trace.go
│   │   └── trace_test.go
│   ├── tui/
│   │   ├── color.go
│   │   ├── confirm.go
│   │   ├── input.go
│   │   └── pager.go
│   ├── vfs/
│   │   ├── LICENSE
│   │   ├── bound.go
│   │   ├── bound_test.go
│   │   ├── glob.go
│   │   └── vfs.go
│   ├── viewport/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── configuration.go
│   │   ├── content_manager.go
│   │   ├── display_manager.go
│   │   ├── filterableviewport/
│   │   │   ├── filterableviewport.go
│   │   │   ├── filterableviewport_filterlineposition_test.go
│   │   │   ├── filterableviewport_filterlineprefix_test.go
│   │   │   ├── filterableviewport_saving_test.go
│   │   │   ├── filterableviewport_searchhistory_test.go
│   │   │   ├── filterableviewport_test.go
│   │   │   ├── filtermode.go
│   │   │   ├── keymap.go
│   │   │   └── styles.go
│   │   ├── highlight.go
│   │   ├── internal/
│   │   │   ├── fuzzy/
│   │   │   │   ├── fuzzy.go
│   │   │   │   └── fuzzy_test.go
│   │   │   └── test_util.go
│   │   ├── item/
│   │   │   ├── ansi.go
│   │   │   ├── ansi_test.go
│   │   │   ├── concat.go
│   │   │   ├── concat_test.go
│   │   │   ├── item.go
│   │   │   ├── item_bench_test.go
│   │   │   ├── model.go
│   │   │   ├── multiline.go
│   │   │   ├── multiline_test.go
│   │   │   ├── safecast.go
│   │   │   ├── safecast_test.go
│   │   │   ├── single.go
│   │   │   ├── single_test.go
│   │   │   ├── string.go
│   │   │   └── string_test.go
│   │   ├── keymap.go
│   │   ├── navigation_manager.go
│   │   ├── object.go
│   │   ├── styles.go
│   │   ├── viewport.go
│   │   ├── viewport_multiline_test.go
│   │   ├── viewport_no_selection_no_wrap_test.go
│   │   ├── viewport_no_selection_wrap_test.go
│   │   ├── viewport_postheader_test.go
│   │   ├── viewport_prefooter_test.go
│   │   ├── viewport_progressbar_test.go
│   │   ├── viewport_saving_test.go
│   │   ├── viewport_selection_no_wrap_test.go
│   │   ├── viewport_selection_wrap_test.go
│   │   └── viewport_test_util_test.go
│   ├── wildmatch/
│   │   ├── LICENSE.md
│   │   ├── package.go
│   │   ├── wildmatch.go
│   │   ├── wildmatch_casefold.go
│   │   ├── wildmatch_nocasefold.go
│   │   └── wildmatch_test.go
│   └── zeta/
│       ├── backend/
│       │   ├── decode.go
│       │   ├── encode.go
│       │   ├── errors.go
│       │   ├── file_storer.go
│       │   ├── odb.go
│       │   ├── odb_test.go
│       │   ├── pack/
│       │   │   ├── bounds.go
│       │   │   ├── encode.go
│       │   │   ├── errors.go
│       │   │   ├── index.go
│       │   │   ├── index_version.go
│       │   │   ├── pack_test.go
│       │   │   ├── packfile.go
│       │   │   ├── reader.go
│       │   │   ├── set.go
│       │   │   └── storage.go
│       │   ├── pack-objects.go
│       │   ├── pack-objects_test.go
│       │   ├── prune.go
│       │   ├── storage/
│       │   │   └── storage.go
│       │   └── unpack.go
│       ├── config/
│       │   ├── boolean_test.go
│       │   ├── codec_toml.go
│       │   ├── codec_toml_test.go
│       │   ├── compat_test.go
│       │   ├── config.go
│       │   ├── config_test.toml
│       │   ├── config_test_bad.toml
│       │   ├── decode.go
│       │   ├── decode_test.go
│       │   ├── display.go
│       │   ├── document.go
│       │   ├── document_test.go
│       │   ├── encode.go
│       │   ├── encode_test.go
│       │   ├── type.go
│       │   ├── type_test.go
│       │   ├── validate.go
│       │   ├── value.go
│       │   └── value_test.go
│       ├── error.go
│       ├── object/
│       │   ├── blob.go
│       │   ├── change.go
│       │   ├── change_adaptor.go
│       │   ├── commit.go
│       │   ├── commit_test.go
│       │   ├── commit_walker.go
│       │   ├── commit_walker_atime.go
│       │   ├── commit_walker_bfs.go
│       │   ├── commit_walker_bfs_filtered.go
│       │   ├── commit_walker_ctime.go
│       │   ├── commit_walker_limit.go
│       │   ├── commit_walker_path.go
│       │   ├── commit_walker_test.go
│       │   ├── commit_walker_topo_order.go
│       │   ├── difftree.go
│       │   ├── file.go
│       │   ├── fragments.go
│       │   ├── merge_base.go
│       │   ├── object.go
│       │   ├── patch.go
│       │   ├── patch_test.go
│       │   ├── rename.go
│       │   ├── storage.go
│       │   ├── tag.go
│       │   ├── tree.go
│       │   ├── tree_test.go
│       │   └── treenode.go
│       ├── reflog/
│       │   ├── reflog.go
│       │   └── reflog_test.go
│       └── refs/
│           ├── backend.go
│           ├── error.go
│           ├── filesystem.go
│           ├── filesystem_test.go
│           ├── references.go
│           ├── rules.go
│           └── rules_test.go
├── pkg/
│   ├── command/
│   │   ├── README.md
│   │   ├── command.go
│   │   ├── command_add.go
│   │   ├── command_branch.go
│   │   ├── command_cat.go
│   │   ├── command_check_ignore.go
│   │   ├── command_checkout.go
│   │   ├── command_cherry_pick.go
│   │   ├── command_clean.go
│   │   ├── command_commit.go
│   │   ├── command_config.go
│   │   ├── command_diff.go
│   │   ├── command_fetch.go
│   │   ├── command_for_each_ref.go
│   │   ├── command_gc.go
│   │   ├── command_hash_object.go
│   │   ├── command_init.go
│   │   ├── command_log.go
│   │   ├── command_ls_files.go
│   │   ├── command_ls_tree.go
│   │   ├── command_merge.go
│   │   ├── command_merge_base.go
│   │   ├── command_merge_file.go
│   │   ├── command_merge_tree.go
│   │   ├── command_pull.go
│   │   ├── command_push.go
│   │   ├── command_rebase.go
│   │   ├── command_remote.go
│   │   ├── command_rename.go
│   │   ├── command_reset.go
│   │   ├── command_restore.go
│   │   ├── command_rev_parse.go
│   │   ├── command_revert.go
│   │   ├── command_rm.go
│   │   ├── command_show.go
│   │   ├── command_stash.go
│   │   ├── command_status.go
│   │   ├── command_switch.go
│   │   ├── command_tag.go
│   │   ├── command_version.go
│   │   └── msic.go
│   ├── kong/
│   │   ├── COPYING
│   │   ├── FORK.md
│   │   ├── README.md
│   │   ├── build.go
│   │   ├── callbacks.go
│   │   ├── camelcase.go
│   │   ├── context.go
│   │   ├── defaults.go
│   │   ├── doc.go
│   │   ├── error.go
│   │   ├── exit.go
│   │   ├── global.go
│   │   ├── guesswidth.go
│   │   ├── help.go
│   │   ├── hooks.go
│   │   ├── interpolate.go
│   │   ├── kong.go
│   │   ├── levenshtein.go
│   │   ├── mapper.go
│   │   ├── model.go
│   │   ├── negatable.go
│   │   ├── options.go
│   │   ├── resolver.go
│   │   ├── scanner.go
│   │   ├── tag.go
│   │   ├── util.go
│   │   └── visit.go
│   ├── migrate/
│   │   ├── migrate.go
│   │   └── progressbar.go
│   ├── progress/
│   │   ├── indicators.go
│   │   ├── multibar.go
│   │   ├── progressbar.go
│   │   └── progressbar_test.go
│   ├── serve/
│   │   ├── argon2id/
│   │   │   ├── LICENSE
│   │   │   ├── VERSION
│   │   │   ├── argon2id.go
│   │   │   └── argon2id_test.go
│   │   ├── config.go
│   │   ├── database/
│   │   │   ├── access_level.go
│   │   │   ├── branches.go
│   │   │   ├── database.go
│   │   │   ├── error.go
│   │   │   ├── keys.go
│   │   │   ├── member.go
│   │   │   ├── namespaces.go
│   │   │   ├── reference.go
│   │   │   ├── repositories.go
│   │   │   ├── tags.go
│   │   │   ├── types.go
│   │   │   ├── update.go
│   │   │   ├── user.go
│   │   │   ├── user_test.go
│   │   │   └── zeta.sql
│   │   ├── encrypt.go
│   │   ├── encrypt_test.go
│   │   ├── httpserver/
│   │   │   ├── auth.go
│   │   │   ├── bearer.go
│   │   │   ├── config.go
│   │   │   ├── management.go
│   │   │   ├── metadata.go
│   │   │   ├── request.go
│   │   │   ├── response.go
│   │   │   ├── server.go
│   │   │   └── transfer.go
│   │   ├── languages/
│   │   │   └── zh-CN.toml
│   │   ├── languages.go
│   │   ├── languages_test.go
│   │   ├── odb/
│   │   │   ├── cache.go
│   │   │   ├── database.go
│   │   │   ├── decode.go
│   │   │   ├── encode.go
│   │   │   ├── odb.go
│   │   │   ├── oss.go
│   │   │   ├── quarantine.go
│   │   │   └── unpack.go
│   │   ├── protocol/
│   │   │   ├── input.go
│   │   │   ├── pack.go
│   │   │   ├── protocol.go
│   │   │   └── range.go
│   │   ├── repo/
│   │   │   ├── push.go
│   │   │   ├── repositories.go
│   │   │   ├── resources/
│   │   │   │   ├── README.md
│   │   │   │   └── zetaignore
│   │   │   └── revision.go
│   │   └── sshserver/
│   │       ├── auth.go
│   │       ├── command.go
│   │       ├── command_ls-remote.go
│   │       ├── command_metadata.go
│   │       ├── command_objects.go
│   │       ├── command_push.go
│   │       ├── command_test.go
│   │       ├── config.go
│   │       ├── parseargv.go
│   │       ├── rainbow/
│   │       │   ├── art.go
│   │       │   ├── art_test.go
│   │       │   └── rainbow.go
│   │       ├── server.go
│   │       └── session.go
│   ├── tr/
│   │   ├── README.md
│   │   ├── languages/
│   │   │   └── zh-CN.toml
│   │   ├── translate.go
│   │   └── translate_test.go
│   ├── transport/
│   │   ├── client/
│   │   │   └── client.go
│   │   ├── endpoint.go
│   │   ├── http/
│   │   │   ├── auth.go
│   │   │   ├── base.go
│   │   │   ├── base_test.go
│   │   │   ├── blob.go
│   │   │   ├── external.go
│   │   │   ├── external_test.go
│   │   │   ├── metadata.go
│   │   │   ├── netrc.go
│   │   │   ├── netrc_test.go
│   │   │   ├── push.go
│   │   │   ├── reference.go
│   │   │   └── trace.go
│   │   ├── ssh/
│   │   │   ├── auth.go
│   │   │   ├── base.go
│   │   │   ├── command.go
│   │   │   ├── command_test.go
│   │   │   ├── config/
│   │   │   │   ├── AUTHORS.txt
│   │   │   │   ├── CHANGELOG.md
│   │   │   │   ├── LICENSE
│   │   │   │   ├── Makefile
│   │   │   │   ├── README.md
│   │   │   │   ├── config.go
│   │   │   │   ├── config_test.go
│   │   │   │   ├── config_unix.go
│   │   │   │   ├── config_windows.go
│   │   │   │   ├── lexer.go
│   │   │   │   ├── parser.go
│   │   │   │   ├── parser_test.go
│   │   │   │   ├── position.go
│   │   │   │   ├── testdata/
│   │   │   │   │   ├── anotherfile
│   │   │   │   │   ├── config-no-ending-newline
│   │   │   │   │   ├── config1
│   │   │   │   │   ├── config1-with-match-directive
│   │   │   │   │   ├── config2
│   │   │   │   │   ├── config3
│   │   │   │   │   ├── config4
│   │   │   │   │   ├── dos-lines
│   │   │   │   │   ├── eol-comments
│   │   │   │   │   ├── eqsign
│   │   │   │   │   ├── extraspace
│   │   │   │   │   ├── fuzz/
│   │   │   │   │   │   └── FuzzDecode/
│   │   │   │   │   │       ├── 3cfc035ae4867ca13fa7bfaf2793731f05fd4d59c3af8761ea365c7485c752fd
│   │   │   │   │   │       └── 4f8b378d89916e9b4fd796f74f5b12efb5cd85faaba9fea8fbe419d6af63add8
│   │   │   │   │   ├── identities
│   │   │   │   │   ├── include
│   │   │   │   │   ├── include-recursive
│   │   │   │   │   ├── invalid-port
│   │   │   │   │   ├── match-directive
│   │   │   │   │   ├── negated
│   │   │   │   │   └── system-include
│   │   │   │   ├── token.go
│   │   │   │   ├── validators.go
│   │   │   │   └── validators_test.go
│   │   │   ├── knownhosts/
│   │   │   │   ├── LICENSE
│   │   │   │   ├── knownhosts.go
│   │   │   │   └── knownhosts_test.go
│   │   │   ├── metadata.go
│   │   │   ├── objects.go
│   │   │   └── push.go
│   │   ├── struct.go
│   │   ├── struct_test.go
│   │   ├── transport.go
│   │   └── util.go
│   ├── version/
│   │   ├── uname.go
│   │   ├── uname_linux.go
│   │   ├── uname_test.go
│   │   ├── uname_unix.go
│   │   ├── uname_windows.go
│   │   ├── verison.go
│   │   └── version_test.go
│   └── zeta/
│       ├── aria2.go
│       ├── blame.go
│       ├── blame_test.go
│       ├── branch.go
│       ├── cat.go
│       ├── cdc.go
│       ├── config.go
│       ├── display.go
│       ├── dragonfly.go
│       ├── editor.go
│       ├── fetch.go
│       ├── gc.go
│       ├── log.go
│       ├── log_test.go
│       ├── lstree.go
│       ├── merge_file.go
│       ├── merge_tree.go
│       ├── misc.go
│       ├── misc_test.go
│       ├── objects.go
│       ├── odb/
│       │   ├── commit.go
│       │   ├── counting-objects.go
│       │   ├── decode.go
│       │   ├── index.go
│       │   ├── merge.go
│       │   ├── merge_driver.go
│       │   ├── merge_test.go
│       │   ├── merge_text.go
│       │   ├── odb.go
│       │   ├── pack.go
│       │   ├── references.go
│       │   ├── transfer.go
│       │   ├── tree.go
│       │   ├── unpack.go
│       │   ├── unpack_test.go
│       │   └── util.go
│       ├── options.go
│       ├── pager.go
│       ├── promisor.go
│       ├── push.go
│       ├── references.go
│       ├── references_test.go
│       ├── repository.go
│       ├── revision.go
│       ├── revision_test.go
│       ├── safetensors.go
│       ├── safetensors_test.go
│       ├── show.go
│       ├── showdiff.go
│       ├── status.go
│       ├── switch.go
│       ├── switch_test.go
│       ├── tag.go
│       ├── transfer.go
│       ├── tree.go
│       ├── update.go
│       ├── worktree.go
│       ├── worktree_bsd.go
│       ├── worktree_checkout.go
│       ├── worktree_co-extra.go
│       ├── worktree_commit.go
│       ├── worktree_diff.go
│       ├── worktree_drawin.go
│       ├── worktree_linux.go
│       ├── worktree_ls_files.go
│       ├── worktree_merge.go
│       ├── worktree_pull.go
│       ├── worktree_rebase.go
│       ├── worktree_rename.go
│       ├── worktree_replay.go
│       ├── worktree_restore.go
│       ├── worktree_stash.go
│       ├── worktree_status.go
│       ├── worktree_test.go
│       ├── worktree_tree.go
│       ├── worktree_unix_other.go
│       └── worktree_windows.go
├── script/
│   ├── inno.sh
│   ├── release.bat
│   ├── release.ps1
│   ├── release.sh
│   └── zeta.iss
├── share/
│   ├── zeta-serve-httpd.toml
│   └── zeta-serve-sshd.toml
└── utils/
    ├── auth/
    │   └── auth.go
    ├── bar2/
    │   └── main.go
    ├── cli/
    │   └── command_test.go
    ├── darwinproxy/
    │   └── darwinproxy_test.go
    ├── diffbug/
    │   ├── a.txt
    │   ├── b.txt
    │   ├── c.txt
    │   └── difffix_test.go
    ├── fs_warning/
    │   └── main.go
    ├── keyring/
    │   └── main.go
    ├── lcs/
    │   └── lcs.go
    ├── match/
    │   └── match_test.go
    ├── mimex/
    │   ├── a.txt
    │   ├── a16.txt
    │   ├── a8.txt
    │   ├── b.txt
    │   ├── b16.txt
    │   ├── conflict-16-8-16.txt
    │   ├── conflict-16.txt
    │   ├── conflict.txt
    │   ├── mime_test.go
    │   ├── o16.txt
    │   └── origin.txt
    ├── rename/
    │   ├── rename_test.go
    │   └── rename_windows.go
    ├── setv/
    │   └── main.go
    └── term/
        └── detect.go

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
    commit-message:
      prefix: "build"

  - package-ecosystem: "gomod"
    directory: "/"
    schedule:
      interval: "daily"
    commit-message:
      prefix: "build"
    groups:
      golang.org:
        patterns:
          - "golang.org/*"

================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on:
  push:
    paths-ignore:
      # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
      - "docs/**"
      - "**.md"
      - "**.txt"
      - "LICENSE"
  pull_request:
    paths-ignore:
      - "docs/**"
      - "**.md"
      - "**.txt"
      - "LICENSE"
jobs:
  build:
    strategy:
      matrix:
        platform: [ubuntu-latest, windows-latest]
        include:
          - platform: ubuntu-latest
            release_command: ./script/release.sh
          - platform: windows-latest
            release_command: pwsh -NoProfile -NoLogo -ExecutionPolicy unrestricted -File "./script/release.ps1"
    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 1
      - name: Setup go
        uses: actions/setup-go@v6
        with:
          go-version: "stable"
      - name: Build
        run: ${{ matrix.release_command }}
      - name: Upload release
        uses: svenstaro/upload-release-action@v2
        if: startsWith(github.ref, 'refs/tags/')
        with:
          file_glob: true
          file: out/*
          tag: ${{ github.ref }}
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          overwrite: true


================================================
FILE: .gitignore
================================================
bin/*
/build/
/dest/
/etc/zeta.toml
/cmd/zeta/zeta
*.exe
*.dll
*.so
*.a
*.tar.gz
*.zip
/*.sh
local/*
.DS_Store
*.gop1
*.tomlp1
*.modp1
*.sump1
*.rej
*.mdp1
/out/
/.vscode/
.idea/*
vendor/*
Makefilep1
VERSIONp1

================================================
FILE: .golangci.yml
================================================
version: 2

run:
  timeout: 5m
  issues-exit-code: 1
  tests: true

output:
  format: colored-line-number
  print-issued-lines: true
  print-linter-name: true

linters:
  enable:
    # 复杂度检查(核心)
    # - nestif          # 检查嵌套的 if 语句

    # 静态分析
    - staticcheck     # 静态分析工具

    # 代码简化
    - predeclared     # 检查是否使用了 Go 预定义的标识符
    - unconvert       # 检查不必要的类型转换
    - wastedassign    # 检查浪费的赋值语句

    # 错误处理
    - errcheck        # 检查未处理的错误
    - errorlint       # 检查错误处理中的常见问题

    # 其他有用的 linter
    - ineffassign     # 检查无效赋值

linters-settings:
  nestif:
    min-complexity: 5

issues:
  exclude-rules:
    # 测试文件可以放宽一些限制
    - path: _test\.go
      linters:
        - errcheck

    # 生成的代码可以跳过检查
    - path: '.*\.pb\.go'
      linters:
        - all

  max-issues-per-linter: 0
  max-same-issues: 0
  new: false

================================================
FILE: CHANGELOG.md
================================================
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.23.0] - 2026-04-22

### Added

- **Hot Diff/Show Commands**: Add `hot diff` and `hot show` commands for viewing differences in git repositories
- **Interactive Diff Navigation**: Add `--nav` flag to `zeta diff` and `zeta show` commands for built-in interactive diff viewer with syntax highlighting
- **Advanced Viewport Module**: Import feature-rich viewport component with text wrapping, selection, and filtering capabilities
- **MultiBar Progress**: Rewrite progress bar component using `bubbles/progress` with concurrent multi-bar rendering and EWMA speed tracking
- **LOONG64 Support**: Enable builds for LoongArch64 architecture

### Changed

- **Patch View Improvements**:
  - Refactor patchview module with improved navigation mode
  - Add LRU cache for syntax highlighting (up to 1000 entries)
  - Remove standalone word-diff in favor of integrated nav mode
  - Enhance diff theme and rendering
- **TUI Enhancements**:
  - Switch to custom viewport implementation for better control
  - Optimize pager rendering performance
  - Improve word diff performance
- **Code Cleanup**:
  - Remove legacy `diffformat.go` module (287 lines removed)
  - Code tidy and refactoring across multiple modules

### Fixed

- Fix double close issue in `writeCredentials` for keyring file storage
- Harden keyring file storage with atomic writes and lock handling
- Fix `truncatePath` in hot commands
- Fix pager status bar space display
- Fix multi `-m` flag handling in commit command
- Fix small bug in diferenco module

### Dependencies

- **Updated**:
  - `charm.land/bubbletea/v2` from v2.0.2 to v2.0.6
  - `charm.land/lipgloss/v2` from v2.0.2 to v2.0.3
  - `golang.org/x/crypto` from v0.49.0 to v0.50.0
  - `golang.org/x/net` from v0.52.0 to v0.53.0
  - `golang.org/x/sys` from v0.42.0 to v0.43.0
  - `golang.org/x/term` from v0.41.0 to v0.42.0
  - `golang.org/x/text` from v0.35.0 to v0.36.0
- **Added**: `github.com/zeebo/xxh3` v1.1.0 for fast hashing
- **Removed**: `github.com/vbauerster/mpb/v8` (replaced by custom MultiBar implementation)

## [0.22.0] - 2026-03-27

### Added

- **FastCDC Chunking**: Implement FastCDC (Content-Defined Chunking) algorithm for AI model storage optimization, supporting Safetensors format (`#7`)
- **Word Diff**: Support simple word-level diff in `zeta diff` and `zeta show` commands
- **Secure Keyring Storage**: Add keyring support for secure credential storage
  - macOS: Keychain integration
  - Windows: Windows Credential Manager integration
  - Linux: File-based storage backend
- **Network Filesystem Warning**: Automatically detect and warn about network filesystems (NFS, Ceph, SMB) with highlighted filesystem names

### Changed

- **TUI Framework Migration**: Switch from custom survey module to `charmbracelet/huh` for better terminal UI experience (removed 10,000+ lines of legacy code)
- **Improved Table Rendering**: Replace `go-pretty` with `bubbletea table` for better TUI rendering in `zeta hot` commands
- **Enhanced Pager**: Add space key support for page navigation in TUI pager
- **Diferenco Improvements**:
  - Add `name` field to `FileStat`
  - Add `Format()` method to `Patch`
  - Optimize `MergeParallel` implementation
  - Improve `SplitWords` algorithm
  - Enhance Myers diff algorithm
- **Performance Optimizations**:
  - Optimize worktree operations
  - Improve commit decoding efficiency
  - Enhance system proxy detection accuracy

### Fixed

- Fix multiple keyring issues on Windows and Unix platforms
- Fix panic in `wildmatch` pattern matching
- Fix tree cache corruption issues
- Fix missing context in commit walker
- Fix zlib handling edge cases
- Fix split words boundary issues
- Fix trace color display

### Dependencies

- **Go 1.26**: Upgrade to Go 1.26.0
- **Removed**: `testify` testing dependency
- **Updated**:
  - `charm.land` ecosystem modules (bubbles, bubbletea, glamour, huh, lipgloss)
  - `github.com/ProtonMail/go-crypto` v1.4.1
  - `github.com/klauspost/compress` v1.18.5
  - `github.com/dgraph-io/ristretto/v2` v2.4.0
  - Multiple `golang.org/x` modules

### Documentation

- Add CDC (Content-Defined Chunking) documentation (`docs/cdc.md`)
- Update README with latest features
- Improve documentation organization

### Internationalization

- Complete Chinese (zh-CN) translations
- Add missing i18n entries

## [0.21.0] - 2025-12-16

### Added

- Initial stable release with core version control features
- Metadata and file data separation architecture
- Distributed database for metadata storage
- Object storage for file content
- Efficient transfer protocol
- Fragment object support for large files
- Support for AI model development, game development, and monorepo scenarios

[Unreleased]: https://github.com/antgroup/hugescm/compare/v0.22.0...HEAD
[0.22.0]: https://github.com/antgroup/hugescm/compare/v0.21.0...v0.22.0
[0.21.0]: https://github.com/antgroup/hugescm/releases/tag/v0.21.0

================================================
FILE: LEGAL.md
================================================
Legal Disclaimer

Within this source code, the comments in Chinese shall be the original, governing version. Any comment in other languages are for reference only. In the event of any conflict between the Chinese language version comments and other language version comments, the Chinese language version shall prevail.

法律免责声明

关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。

================================================
FILE: LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

================================================
FILE: Makefile
================================================
SHELL = /usr/bin/env bash -eo pipefail

PKG           := github.com/antgroup/hugescm
SOURCE_DIR    := $(abspath $(dir $(lastword ${MAKEFILE_LIST})))
BUILD_DIR     := ${SOURCE_DIR}/_build
BUILD_TIME    := $(shell date +'%Y-%m-%dT%H:%M:%S%z')
BUILD_COMMIT  := $(shell git rev-parse --short HEAD 2>/dev/null || echo 'none')
BUILD_VERSION := $(shell cat VERSION || echo '0.23.0')
GO_PACKAGES   := $(shell go list ./... | grep -v '^${PKG}/mock/' | grep -v '^${PKG}/proto/')
GO_LDFLAGS    := -ldflags '-X ${PKG}/pkg/version.version=${BUILD_VERSION} -X ${PKG}/pkg/version.buildTime=${BUILD_TIME} -X ${PKG}/pkg/version.buildCommit=${BUILD_COMMIT}'


.PHONY: all
all: zeta zeta-mc hot

.PHONY: build
build: zeta zeta-mc hot

.PHONY: zeta
zeta:
	GOOS=${BUILD_TARGET} GOARCH=${BUILD_ARCH} go build -C cmd/zeta ${GO_LDFLAGS} -o ${CURDIR}/bin/zeta

.PHONY: zeta-mc
zeta-mc:
	GOOS=${BUILD_TARGET} GOARCH=${BUILD_ARCH} go build -C cmd/zeta-mc ${GO_LDFLAGS} -o ${CURDIR}/bin/zeta-mc

.PHONY: hot
hot:
	GOOS=${BUILD_TARGET} GOARCH=${BUILD_ARCH} go build -C cmd/hot ${GO_LDFLAGS} -o ${CURDIR}/bin/hot

.PHONY: zeta-serve
zeta-serve:
	GOOS=${BUILD_TARGET} GOARCH=${BUILD_ARCH} go build -C cmd/zeta-serve ${GO_LDFLAGS} -o ${CURDIR}/bin/zeta-serve

================================================
FILE: README.md
================================================
# HugeSCM - A next generation cloud-based version control system

[![license badge](https://img.shields.io/github/license/antgroup/hugescm.svg)](LICENSE)
[![Master Branch Status](https://github.com/antgroup/hugescm/workflows/CI/badge.svg)](https://github.com/antgroup/hugescm/actions)
[![Latest Release Downloads](https://img.shields.io/github/downloads/antgroup/hugescm/latest/total.svg)](https://github.com/antgroup/hugescm/releases/latest)
[![Total Downloads](https://img.shields.io/github/downloads/antgroup/hugescm/total.svg)](https://github.com/antgroup/hugescm/releases)
[![Version](https://img.shields.io/github/v/release/antgroup/hugescm)](https://github.com/antgroup/hugescm/releases/latest)

[简体中文](./README.zh-CN.md)

## Overview

HugeSCM (codename zeta) is a cloud-native version control system designed for large-scale repositories. By separating metadata from file data, it overcomes storage and transmission limitations of traditional VCS like Git and SVN. Ideal for AI model development, game development, and monorepo scenarios.

Key features:
+ **Data separation**: Stores metadata in distributed database, file content in object storage
+ **Efficient protocol**: Optimized transmission reduces bandwidth and time costs
+ **Fragment objects**: Handles large binary files (AI models, dependencies) efficiently

Built on Git's principles without its historical constraints.

## Use Cases

### AI Model Development

- Store checkpoint files (tens to hundreds of GB)
- Model version management and incremental updates
- Multi-team collaboration

### Game Development

- Large binary resource management
- Art asset version control

### Dataset Storage

- Large-scale dataset version management
- Data annotation collaboration

## Documentation

### Design & Architecture

| Document | Description |
|----------|-------------|
| [design.md](./docs/design.md) | Design Philosophy - Core design concepts, architecture overview, differences from Git |
| [object-format.md](./docs/object-format.md) | Object Format - Binary formats for Blob, Tree, Commit, Fragments objects |
| [pack-format.md](./docs/pack-format.md) | Pack File Format - Object packaging mechanism and index format |
| [protocol.md](./docs/protocol.md) | Transport Protocol - HTTP/SSH protocols, authorization, metadata and file transfer |
| [version-negotiation.md](./docs/version-negotiation.md) | Version Negotiation - Baseline management, checkout, pull, push workflows |

### Configuration Reference

| Document | Description |
|----------|-------------|
| [config.md](./docs/config.md) | Configuration File - Supported configuration options and environment variables |

### Feature Guides

| Document | Description |
|----------|-------------|
| [switch.md](./docs/switch.md) | Branch Switching - switch command details for switching branches and commits |
| [stash.md](./docs/stash.md) | Stash Feature - stash command for temporarily saving work progress |
| [sparse-checkout.md](./docs/sparse-checkout.md) | Sparse Checkout - On-demand checkout of specified directories |
| [pull-strategy.md](./docs/pull-strategy.md) | Pull Strategy - merge, rebase, fast-forward strategy details |

### Advanced Features

| Document | Description |
|----------|-------------|
| [cdc.md](./docs/cdc.md) | CDC Chunking - Content-Defined Chunking implementation and configuration |
| [hot.md](./docs/hot.md) | hot command - Git repository maintenance tool for cleanup, migration, and optimization |

## Build

After installing the latest version of Golang, developers can build HugeSCM client using [bali](https://github.com/balibuild/bali) (build packaging tool).

```sh
bali -T windows
# create rpm,deb,tar,sh pack
bali -T linux -A amd64 --pack='rpm,deb,tar,sh'
```

The bali build tool can create `zip`, `deb`, `tar`, `rpm`, `sh (STGZ)` compression/installation packages.

### Windows Installation Package

We provide an Inno Setup script. You can use Docker + wine to generate an installation package without Windows:

```shell
docker run --rm -i -v "$TOPLEVEL:/work" amake/innosetup xxxxx.iss
```

Before running this, build the Windows binary first: `bali --target=windows --arch=amd64`.

> Note: On macOS with Apple Silicon, you can use OrbStack with Rosetta to run this image.

## Usage

Users can run `zeta -h` to view all zeta commands, and run `zeta ${command} -h` to view detailed command help. We try to make it easy for git users to get started with zeta, and we will also enhance some commands. For example, many zeta commands support `--json` to format the output as json, which is convenient for integration with various tools.

### Config

```shell
zeta config --global user.email 'zeta@example.io'
zeta config --global user.name 'Example User'
```

### Checkout

The process to obtain a remote repository in git is called `clone` (or `fetch`). In zeta, we use `checkout`, abbreviated as `co`. Below is how to `checkout` a repository:

```shell
zeta co http://zeta.example.io/group/repo xh1
zeta co http://zeta.example.io/group/repo xh1 -s dir1
```

### Track and Commit

We have implemented git-like `status`, `add`, and `commit` commands, usable except in interactive mode. Use `-h` for help. On properly configured systems, zeta displays the corresponding language version.

```shell
echo "hello world" > helloworld.txt
zeta add helloworld.txt
zeta commit -m "Hello world"
```

### Push and Pull

```shell
zeta push
zeta pull
```

## Features

### Download Acceleration

Supports `direct`, `dragonfly`, and `aria2` accelerators via `core.accelerator` or `ZETA_CORE_ACCELERATOR` env var.

| Accelerator | Description |
| :---: | --- |
| `direct` | Download directly from OSS via signed URLs (recommended for AI scenarios) |
| `dragonfly` | Use dragonfly cluster for P2P acceleration |
| `aria2` | Use aria2c for multi-threaded downloads |

```shell
zeta config --global core.accelerator direct
zeta config --global core.concurrenttransfers 8  # parallel downloads (1-50)
```

### One-by-One Checkout

Checkout files one at a time and immediately release blob objects, saving **60%+** disk space for large repositories.

```shell
zeta co http://zeta.example.io/zeta-poc-test/zeta-poc-test --one
```

![](./docs/images/one-by-one.png)

### On-demand Access

Automatically downloads missing objects when needed (e.g., `zeta cat`, merge). Disable with `ZETA_CORE_PROMISOR=0`.

### Sparse Checkout

Sparse checkout allows users to check out only specific directories instead of the entire repository. This is especially useful for large repositories:

```shell
# Check out specific directories
zeta co http://zeta.example.io/group/repo myrepo -s src/core -s src/utils
```

### Checkout Single File

In zeta, you can checkout a single file by adding `--limit=0` during the checkout process, which excludes all files except empty ones. Then, use `zeta checkout -- path` to check out the specific file.

```shell
zeta co http://zeta.example.io/zeta-poc-test/zeta-poc-test --limit=0 z2
zeta checkout -- dev6.bin
```

### Update Partial Files

Some users may only want to modify specific files, which can be done by using `checkout single file` to checkout the desired file and then making the modifications.

```shell
zeta add test1/2.txt
zeta commit -m "XXX"
zeta push
```

### Pull Strategies

HugeSCM supports three pull strategies:

- **merge** - Create a merge commit (default)
- **rebase** - Rebase local commits on top of remote
- **fast-forward only** - Only allow fast-forward merges

```shell
zeta pull                    # merge strategy (default)
zeta pull --rebase           # rebase strategy
zeta pull --ff-only          # fast-forward only
```

### Stash

Stash allows temporarily saving work progress:

```shell
zeta stash                   # stash all changes
zeta stash save "WIP: feature"  # stash with message
zeta stash list              # list all stashes
zeta stash pop               # apply and remove latest stash
```

### Switch Branches

Switch between branches or commits:

```shell
zeta switch feature          # switch to branch
zeta switch -c new-feature   # create and switch to new branch
zeta switch abc123           # switch to specific commit
```

### Migrate Repository from Git to HugeSCM

```shell
zeta-mc https://github.com/antgroup/hugescm.git hugescm-dev
```

## CDC (Content-Defined Chunking)

HugeSCM introduces CDC for efficient handling of large files. Unlike traditional fixed-size chunking, CDC determines chunk boundaries based on content, achieving better deduplication:

| Scenario | Fixed Chunking | CDC Chunking |
|----------|---------------|--------------|
| Local modification | All subsequent chunks change | Only 1-2 chunks change |
| Incremental sync | Transfer complete file | Transfer only changed chunks |
| Deduplication | Low | High |

Enable CDC in configuration:

```toml
[fragment]
threshold = "1GB"      # File size threshold
size = "1GB"           # Target chunk size (fixed chunking)
enable_cdc = true      # Enable CDC chunking
```

## Comparison with Git

| Feature | Git | HugeSCM |
|---------|-----|---------|
| Architecture | Distributed | Centralized |
| Clone method | Full clone | On-demand checkout |
| Hash algorithm | SHA-1/SHA-256 | BLAKE3 |
| Large file support | Git LFS | Built-in Fragments |
| Data storage | Local filesystem | DB + OSS |

### Command Comparison

| Git Command | HugeSCM Command | Description |
|-------------|-----------------|-------------|
| `git clone` | `zeta checkout` (co) | Checkout repository, not full clone |
| `git fetch` | `zeta pull --fetch` | Fetch data only |
| `git pull` | `zeta pull` | Pull and merge |
| `git switch` | `zeta switch` | Switch branches |

## Additional Tools - hot command

`hot` is a Git repository maintenance tool for cleaning up, migrating, and optimizing Git repositories.

### Common Use Cases

| Task | Command |
|------|---------|
| Find large files | `hot size` / `hot smart -L20m` |
| Remove sensitive data | `hot remove path/to/secret.txt --prune` |
| Migrate SHA1 → SHA256 | `hot mc https://github.com/user/repo.git` |
| Clean stale refs | `hot prune-refs "feature/deprecated-"` |
| Linearize history | `hot unbranch --confirm` |
| Inspect objects | `hot cat HEAD --json` |

See [docs/hot.md](./docs/hot.md) for full documentation.

## License

Apache License Version 2.0, see [LICENSE](LICENSE)

================================================
FILE: README.zh-CN.md
================================================
# HugeSCM - 基于云的下一代版本控制系统

[![license badge](https://img.shields.io/github/license/antgroup/hugescm.svg)](LICENSE)
[![Master Branch Status](https://github.com/antgroup/hugescm/workflows/CI/badge.svg)](https://github.com/antgroup/hugescm/actions)
[![Latest Release Downloads](https://img.shields.io/github/downloads/antgroup/hugescm/latest/total.svg)](https://github.com/antgroup/hugescm/releases/latest)
[![Total Downloads](https://img.shields.io/github/downloads/antgroup/hugescm/total.svg)](https://github.com/antgroup/hugescm/releases)
[![Version](https://img.shields.io/github/v/release/antgroup/hugescm)](https://github.com/antgroup/hugescm/releases/latest)

[English](./README.md)

## 概述

HugeSCM(代号 zeta)是云原生版本控制系统,专为大规模存储库设计。通过元数据与文件数据分离,突破了 Git/SVN 等传统版本控制系统在存储和传输上的限制。适用于 AI 大模型研发、游戏研发、单一大库等场景。

核心特性:
+ **数据分离**:元数据存储于分布式数据库,文件内容存储于对象存储
+ **高效传输**:优化传输协议,降低带宽和时间成本
+ **分片对象**:高效处理大文件(AI 模型、二进制依赖等)

吸取 Git 经验,摆脱历史包袱。

## 适用场景

### AI 大模型研发

- 存储 checkpoint 文件(数十 GB 到数百 GB)
- 模型版本管理和增量更新
- 多团队协作

### 游戏研发

- 大型二进制资源管理
- 美术资产版本控制

### 数据集存储

- 大规模数据集版本管理
- 数据标注协作

## 文档

### 设计与架构

| 文档 | 描述 |
|------|------|
| [design.md](./docs/design.md) | 设计哲学 - 核心设计理念、架构概述、与 Git 的差异 |
| [object-format.md](./docs/object-format.md) | 对象格式详解 - Blob、Tree、Commit、Fragments 等对象的二进制格式 |
| [pack-format.md](./docs/pack-format.md) | Pack 文件格式 - 对象打包机制和索引格式 |
| [protocol.md](./docs/protocol.md) | 传输协议规范 - HTTP/SSH 协议、授权、元数据和文件传输 |
| [version-negotiation.md](./docs/version-negotiation.md) | 版本协商机制 - 基线管理、检出、拉取、推送流程 |

### 配置参考

| 文档 | 描述 |
|------|------|
| [config.md](./docs/config.md) | 配置文件说明 - 支持的配置项和环境变量 |

### 功能使用

| 文档 | 描述 |
|------|------|
| [switch.md](./docs/switch.md) | 分支切换 - switch 命令详解,切换分支和提交 |
| [stash.md](./docs/stash.md) | 暂存功能 - stash 命令详解,临时保存工作进度 |
| [sparse-checkout.md](./docs/sparse-checkout.md) | 稀疏检出 - 按需检出指定目录 |
| [pull-strategy.md](./docs/pull-strategy.md) | 拉取策略 - merge、rebase、fast-forward 策略详解 |

### 高级特性

| 文档 | 描述 |
|------|------|
| [cdc.md](./docs/cdc.md) | CDC 分片 - Content-Defined Chunking 实现原理和配置 |
| [hot.md](./docs/hot.md) | hot 命令 - Git 存储库维护工具,清理大文件、删除敏感数据、迁移对象格式 |

## 构建

开发者安装好最新版本的 Golang 后,可以使用 [bali](https://github.com/balibuild/bali)(构建打包工具)构建 HugeSCM 客户端。

```sh
bali -T windows
# create rpm,deb,tar,sh pack
bali -T linux -A amd64 --pack='rpm,deb,tar,sh'
```

bali 构建工具可以制作 `zip`, `deb`, `tar`, `rpm`, `sh (STGZ)` 压缩/安装包。

### Windows 安装包

我们提供了 Inno Setup 脚本,可以使用 Docker + wine 在非 Windows 环境下生成安装包:

```shell
docker run --rm -i -v "$TOPLEVEL:/work" amake/innosetup xxxxx.iss
```

运行前请先构建 Windows 二进制:`bali --target=windows --arch=amd64`。

> 注意:在搭载 Apple Silicon 芯片的 macOS 上,可以使用 OrbStack 开启 Rosetta 运行该镜像。

## 使用

用户可以运行 `zeta -h` 查看 zeta 所有命令,并运行 `zeta ${command} -h` 查看命令详细帮助,我们尽量让使用 git 的用户容易上手 zeta,同时也会对一些命令进行增强,比如很多 zeta 命令支持 `--json` 将输出格式化为 json,方便各种工具集成。

### 配置

```shell
zeta config --global user.email 'zeta@example.io'
zeta config --global user.name 'Example User'
```

### 检出存储库

使用 git 获取远程存储库的操作叫 `clone`(当然也可以用 `fetch`),在 zeta 中,我们限制其操作为 `checkout`,你也可以缩写为 `co`,以下是检出一个存储库:

```shell
zeta co http://zeta.example.io/group/repo xh1
zeta co http://zeta.example.io/group/repo xh1 -s dir1
```

### 修改、跟踪、提交

我们实现了类似 git 一样的 `status`、`add`、`commit` 命令,除了交互模式外,大体上是可用的,可以使用 `-h` 查看详细帮助,在正确设置了语言环境的系统中,zeta 会显示对应的语言版本。

```shell
echo "hello world" > helloworld.txt
zeta add helloworld.txt
zeta commit -m "Hello world"
```

### 推送和拉取

```shell
zeta push
zeta pull
```

## 特点

### 下载加速

支持 `direct`、`dragonfly`、`aria2` 三种加速器,通过 `core.accelerator` 或环境变量 `ZETA_CORE_ACCELERATOR` 配置。

| 加速器 | 说明 |
| :---: | --- |
| `direct` | 直接从 OSS 签名 URL 下载(AI 场景推荐) |
| `dragonfly` | 使用 dragonfly 集群 P2P 加速 |
| `aria2` | 使用 aria2c 多线程下载 |

```shell
zeta config --global core.accelerator direct
zeta config --global core.concurrenttransfers 8  # 并发下载数 (1-50)
```

### 逐一检出

逐个检出文件并立即释放 blob 对象,大仓库可节省 **60%+** 磁盘空间。

```shell
zeta co http://zeta.example.io/zeta-poc-test/zeta-poc-test --one
```

![](./docs/images/one-by-one.png)

### 按需获取

按需自动下载缺失对象(如 `zeta cat`、merge 场景)。禁用请设置 `ZETA_CORE_PROMISOR=0`。

### 稀疏检出

稀疏检出允许用户只检出存储库中的部分目录,而非完整的工作区。这对于巨型存储库特别有用:

```shell
# 检出指定目录
zeta co http://zeta.example.io/group/repo myrepo -s src/core -s src/utils
```

### 检出单个文件

我们在 zeta 中可以检出单个文件,只需要在 co 的过程中添加 `--limit=0` 意味着除了空文件其他文件均不检出,然后使用 zeta checkout -- path 检出相应的文件即可:

```shell
zeta co http://zeta.example.io/zeta-poc-test/zeta-poc-test --limit=0 z2
zeta checkout -- dev6.bin
```

### 更新部分文件

有些用户仅想修改部分文件,同样可以做到,使用**检出单个文件**检出特定的文件后,修改后执行:

```shell
zeta add test1/2.txt
zeta commit -m "XXX"
zeta push
```

### 拉取策略

HugeSCM 支持三种拉取策略:

- **merge** - 创建合并提交(默认)
- **rebase** - 将本地提交变基到远程分支之上
- **fast-forward only** - 仅允许快进合并

```shell
zeta pull                    # merge 策略(默认)
zeta pull --rebase           # rebase 策略
zeta pull --ff-only          # 仅快进合并
```

### 暂存功能

暂存功能允许临时保存工作进度:

```shell
zeta stash                   # 暂存所有修改
zeta stash save "WIP: 功能开发中"  # 带描述信息暂存
zeta stash list              # 列出所有暂存
zeta stash pop               # 应用并删除最近的暂存
```

### 分支切换

在不同分支或提交之间切换:

```shell
zeta switch feature          # 切换到分支
zeta switch -c new-feature   # 创建并切换到新分支
zeta switch abc123           # 切换到特定提交
```

### 将存储库从 Git 迁移到 HugeSCM

```shell
zeta-mc https://github.com/antgroup/hugescm.git hugescm-dev
```

## CDC(内容定义分片)

HugeSCM 引入了 CDC 用于高效处理大文件。与传统的固定大小分片不同,CDC 根据内容确定分片边界,实现更好的去重效果:

| 场景 | 固定分片 | CDC 分片 |
|------|---------|---------|
| 局部修改 | 所有后续分片改变 | 仅 1-2 个分片改变 |
| 增量同步 | 传输完整文件 | 仅传输变化分片 |
| 去重效果 | 低 | 高 |

启用 CDC 配置:

```toml
[fragment]
threshold = "1GB"      # 文件大小阈值
size = "1GB"           # 目标分片大小(固定分片)
enable_cdc = true      # 启用 CDC 分片
```

## 与 Git 的主要差异

| 特性 | Git | HugeSCM |
|-----|-----|---------|
| 架构模式 | 分布式 | 集中式 |
| 克隆方式 | 全量克隆 | 按需检出 |
| 哈希算法 | SHA-1/SHA-256 | BLAKE3 |
| 大文件支持 | Git LFS | 内置 Fragments |
| 数据存储 | 本地文件系统 | DB + OSS |

### 命令对照

| Git 命令 | HugeSCM 命令 | 说明 |
|---------|-------------|------|
| `git clone` | `zeta checkout` (co) | 检出存储库,非全量克隆 |
| `git fetch` | `zeta pull --fetch` | 仅获取数据 |
| `git pull` | `zeta pull` | 拉取并合并 |
| `git switch` | `zeta switch` | 切换分支 |

## 额外的工具 - hot 命令

`hot` 是 Git 存储库维护工具,用于清理、迁移和优化 Git 存储库。

### 常见使用场景

| 任务 | 命令 |
|------|------|
| 查找大文件 | `hot size` / `hot smart -L20m` |
| 删除敏感数据 | `hot remove path/to/secret.txt --prune` |
| 迁移 SHA1 → SHA256 | `hot mc https://github.com/user/repo.git` |
| 清理过期引用 | `hot prune-refs "feature/deprecated-"` |
| 线性化历史 | `hot unbranch --confirm` |
| 查看对象 | `hot cat HEAD --json` |

完整文档见 [docs/hot.md](./docs/hot.md)。

## 许可证

Apache License Version 2.0, 请查看 [LICENSE](LICENSE)

================================================
FILE: VERSION
================================================
0.23.0

================================================
FILE: bali.toml
================================================
# https://toml.io/en/
name = "zeta"
summary = "HugeSCM - A next generation cloud-based version control system"
description = "HugeSCM - A next generation cloud-based version control system"
package-name = "alipay-linkc-zeta"
version = "0.23.0"
license = "MIT"
prefix = "/usr/local"
packager = "江二"
vendor = "蚂蚁集团代码平台团队"
group = "alipay/application"
authors = [""]
crates = [
    "cmd/zeta",    # zeta client
    "cmd/zeta-mc", # zeta migrate tool
    "cmd/hot",
]

[[include]]
path = "LEGAL.md"
destination = "share/zeta"


================================================
FILE: cmd/README.md
================================================
# command

================================================
FILE: cmd/hot/command/command.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"context"
	"errors"
	"fmt"
	"net/url"
	"os"
	"time"

	"github.com/antgroup/hugescm/modules/command"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
	"github.com/antgroup/hugescm/pkg/kong"
	"github.com/antgroup/hugescm/pkg/version"
)

var (
	ErrLocalEndpoint    = errors.New("local endpoint")
	ErrWorktreeNotEmpty = errors.New("worktree not empty")
)

type Globals struct {
	Verbose bool        `short:"V" help:"Make the operation more talkative"`
	Version VersionFlag `short:"v" name:"version" help:"Show version number and quit"`
}

type VersionFlag bool

func (v VersionFlag) Decode(ctx *kong.DecodeContext) error { return nil }
func (v VersionFlag) IsBool() bool                         { return true }
func (v VersionFlag) BeforeApply(app *kong.Kong, vars kong.Vars) error {
	fmt.Println(version.GetVersionString())
	app.Exit(0)
	return nil
}

func pickURI(rawURL string) (string, error) {
	if git.MatchesScpLike(rawURL) {
		_, _, _, p := git.FindScpLikeComponents(rawURL)
		return p, nil
	}
	if git.MatchesScheme(rawURL) {
		u, err := url.Parse(rawURL)
		if err != nil {
			return "", err
		}
		return u.Path, nil
	}
	return "", ErrLocalEndpoint
}

func (g *Globals) RunEx(ctx context.Context, repoPath string, cmdArg0 string, args ...string) error {
	now := time.Now()
	cmd := command.NewFromOptions(ctx, &command.RunOpts{
		RepoPath:  repoPath,
		Environ:   os.Environ(),
		Stderr:    os.Stderr,
		Stdout:    os.Stdout,
		Stdin:     os.Stdin,
		NoSetpgid: true,
	}, cmdArg0, args...)
	if err := cmd.Run(); err != nil {
		return err
	}
	trace.DbgPrint("exec: %s spent: %v", cmd.String(), time.Since(now))
	return nil
}


================================================
FILE: cmd/hot/command/command_az.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"context"

	"github.com/antgroup/hugescm/cmd/hot/pkg/stat"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/strengthen"
	"github.com/antgroup/hugescm/modules/trace"
)

type Az struct {
	Paths    []string `arg:"" name:"path" help:"Path to repositories" default:"." type:"path"`
	Limit    int64    `short:"L" name:"limit" optional:"" help:"Large file limit size, supported units: KB, MB, GB, K, M, G" default:"10m" type:"size"`
	FullPath bool     `short:"F" name:"full-path" help:"Show full path"`
}

func (c *Az) Run(g *Globals) error {
	for _, p := range c.Paths {
		if err := c.azOnce(p); err != nil {
			return err
		}
	}
	return nil
}

// git cat-file --batch-check --batch-all-objects
func (c *Az) azOnce(p string) error {
	repoPath := git.RevParseRepoPath(context.Background(), p)
	trace.DbgPrint("begin analysis repository: %v large file: %v", repoPath, strengthen.FormatSize(c.Limit))
	return stat.Az(context.Background(), repoPath, c.Limit, c.FullPath)
}


================================================
FILE: cmd/hot/command/command_cat.go
================================================
package command

import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"os"
	"path/filepath"
	"strings"

	"charm.land/glamour/v2"
	"charm.land/lipgloss/v2"
	"github.com/alecthomas/chroma/v2"
	"github.com/alecthomas/chroma/v2/formatters"
	"github.com/alecthomas/chroma/v2/lexers"
	"github.com/alecthomas/chroma/v2/styles"
	"github.com/antgroup/hugescm/cmd/hot/pkg/hud"
	"github.com/antgroup/hugescm/modules/diferenco"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/hexview"
	"github.com/antgroup/hugescm/modules/term"
	"github.com/antgroup/hugescm/modules/trace"
	"github.com/antgroup/hugescm/modules/tui"
)

const (
	MAX_SHOW_BINARY_BLOB = 10<<20 - 8
)

type Cat struct {
	Object      string `arg:"" name:"object" help:"The name of the object to show"`
	CWD         string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
	Type        bool   `name:"type" short:"t" help:"Show object type"`
	Size        bool   `name:"size" short:"s" help:"Show object size"`
	Textconv    bool   `name:"textconv" help:"Converting text to Unicode"`
	JSON        bool   `name:"json" short:"j" help:"Returns data as JSON; limited to commits, trees, and tags"`
	Limit       int64  `name:"limit" short:"L" help:"Omits blobs larger than n bytes or units. n may be zero. Supported units: KB, MB, GB, K, M, G" default:"-1" type:"size"`
	Output      string `name:"output" help:"Output to a specific file instead of stdout" placeholder:"<file>"`
	NoAltScreen bool   `name:"no-alt-screen" help:"Disable alternate screen buffer for pager"`
}

func (c *Cat) Run(g *Globals) error {
	repoPath := git.RevParseRepoPath(context.Background(), c.CWD)
	trace.DbgPrint("repository location: %v", repoPath)
	d, err := git.NewDecoder(context.Background(), repoPath)
	if err != nil {
		die("new git decoder error: %v", err)
		return err
	}
	defer d.Close() // nolint
	o, err := d.Object(c.Object)
	if err != nil {
		die("open '%s' error: %v\n", c.Object, err)
		return err
	}
	if oo, ok := o.(*git.Object); ok {
		return c.formatObject(oo)
	}
	return c.showObject(o)
}

func (c *Cat) Println(a ...any) error {
	fd, _, err := c.NewFD()
	if err != nil {
		return err
	}
	defer fd.Close() // nolint
	_, err = fmt.Fprintln(fd, a...)
	return err
}

func (c *Cat) NewFD() (io.WriteCloser, term.Level, error) {
	if len(c.Output) == 0 {
		return &NopWriteCloser{Writer: os.Stdout}, term.StdoutLevel, nil
	}
	fd, err := os.Create(c.Output)
	return fd, term.LevelNone, err
}

const (
	binaryTruncated = "*** Binary truncated ***"
)

type sizer interface {
	Size() int64
}

func (c *Cat) showObject(a any) error {
	if c.Size {
		if s, ok := a.(sizer); ok {
			return c.Println(s.Size())
		}
		return nil
	}
	if c.Type {
		switch a.(type) {
		case *git.Commit:
			return c.Println("commit")
		case *git.Tag:
			return c.Println("tag")
		case *git.Tree:
			return c.Println("tree")
		}
		return nil
	}
	if c.JSON {
		fd, _, err := c.NewFD()
		if err != nil {
			return err
		}
		defer fd.Close() // nolint
		return json.NewEncoder(fd).Encode(a)
	}
	fd, termLevel, err := c.NewFD()
	if err != nil {
		return err
	}
	defer fd.Close() // nolint
	return hud.Display(fd, a, termLevel)
}

var markdownFiles = map[string]bool{
	"README":       true,
	"CHANGELOG":    true,
	"CONTRIBUTING": true,
	"CHANGES":      true,
	"AUTHORS":      true,
	"HISTORY":      true,
}

func (c *Cat) isMarkdown() bool {
	if _, filename, ok := strings.Cut(c.Object, ":"); ok {
		// Get base filename without extension
		base := strings.TrimSuffix(filename, filepath.Ext(filename))
		ext := strings.ToLower(filepath.Ext(filename))

		// Check for common markdown files by name (case-insensitive)
		if markdownFiles[strings.ToUpper(base)] {
			return true
		}

		// Check for markdown extensions
		return ext == ".md" || ext == ".markdown" || ext == ".mdown" || ext == ".mkd"
	}
	return false
}

func (c *Cat) getLexer() chroma.Lexer {
	_, filename, ok := strings.Cut(c.Object, ":")
	if !ok {
		return nil
	}
	lexer := lexers.Match(filename)
	return lexer
}

var termWidth = func() (width int, err error) {
	width, _, err = term.GetSize(int(os.Stdout.Fd()))
	if err == nil {
		return width, nil
	}

	return 0, err
}

func (c *Cat) markdownOut(w io.Writer, input io.Reader) error {
	width, _ := termWidth()
	if width == 0 || width > 120 {
		width = 80
	}
	// Detect background color to pick appropriate style
	style := "light"
	if lipgloss.HasDarkBackground(os.Stdin, os.Stdout) {
		style = "dark"
	}
	r, err := glamour.NewTermRenderer(
		glamour.WithStylePath(style),
		glamour.WithWordWrap(width),
	)
	if err != nil {
		return err
	}
	defer func() { _ = r.Close() }()
	// Write input to renderer
	if _, err = io.Copy(r, input); err != nil {
		return err
	}
	// Close to trigger rendering
	if err = r.Close(); err != nil {
		return err
	}
	// Write the rendered output to the destination
	if _, err = io.Copy(w, r); err != nil {
		return err
	}

	return nil
}

func (c *Cat) syntaxHighlightOut(w io.Writer, input io.Reader, termLevel term.Level, lexer chroma.Lexer) error {
	// Read the input into a buffer
	var buf bytes.Buffer
	if _, err := io.Copy(&buf, input); err != nil {
		return err
	}
	content := buf.String()

	// Coalesce the lexer
	lexer = chroma.Coalesce(lexer)

	// Detect background color to pick appropriate style
	styleName := "github"
	if lipgloss.HasDarkBackground(os.Stdin, os.Stdout) {
		styleName = "dracula"
	}

	// Get the style
	style := styles.Get(styleName)
	if style == nil {
		style = styles.Fallback
	}

	// Tokenize the content
	iterator, err := lexer.Tokenise(nil, content)
	if err != nil {
		return err
	}

	// Choose formatter based on terminal color support level
	var formatter chroma.Formatter
	switch termLevel {
	case term.Level16M:
		formatter = formatters.TTY16m
	case term.Level256:
		formatter = formatters.TTY256
	case term.LevelNone:
		formatter = formatters.NoOp
	default:
		formatter = formatters.TTY
	}

	if err := formatter.Format(w, style, iterator); err != nil {
		return err
	}

	return nil
}

func (c *Cat) formatObject(o *git.Object) error {
	if c.Size {
		return c.Println(o.Size)
	}
	if c.Type {
		return c.Println("blob")
	}
	reader, charset, err := diferenco.NewUnifiedReaderEx(o, c.Textconv)
	if err != nil {
		return err
	}
	if c.Limit < 0 {
		c.Limit = o.Size
	}

	// Check if we should use pager (small files, no output file, color support)
	usePager := len(c.Output) == 0 && term.StdoutLevel != term.LevelNone && o.Size <= MAX_SHOW_BINARY_BLOB
	useAltScreen := !c.NoAltScreen

	// Binary content: always use hexview, with or without pager
	if charset == diferenco.BINARY {
		if c.Limit > MAX_SHOW_BINARY_BLOB {
			reader = io.MultiReader(io.LimitReader(reader, MAX_SHOW_BINARY_BLOB), strings.NewReader(binaryTruncated))
			c.Limit = int64(MAX_SHOW_BINARY_BLOB + len(binaryTruncated))
		}

		if usePager {
			p := tui.NewPager(term.StdoutLevel, useAltScreen)
			defer p.Close() // nolint
			return hexview.Format(reader, p, c.Limit, p.ColorMode())
		}

		fd, _, err := c.NewFD()
		if err != nil {
			return err
		}
		defer fd.Close() // nolint
		return hexview.Format(reader, fd, c.Limit, term.StdoutLevel)
	}

	// Markdown and source code: only with pager
	if usePager {
		// Markdown handling
		if c.isMarkdown() {
			p := tui.NewPager(term.StdoutLevel, useAltScreen)
			defer p.Close() // nolint
			return c.markdownOut(p, io.LimitReader(reader, c.Limit))
		}

		// Source code handling (only if not markdown)
		if lexer := c.getLexer(); lexer != nil {
			p := tui.NewPager(term.StdoutLevel, useAltScreen)
			defer p.Close() // nolint
			return c.syntaxHighlightOut(p, io.LimitReader(reader, c.Limit), p.ColorMode(), lexer)
		}
	}

	// Default: output directly (large files or output to file)
	fd, _, err := c.NewFD()
	if err != nil {
		return err
	}
	defer fd.Close() // nolint

	if _, err = io.Copy(fd, io.LimitReader(reader, c.Limit)); err != nil {
		return err
	}
	return nil
}


================================================
FILE: cmd/hot/command/command_co.go
================================================
package command

import (
	"context"
	"fmt"
	"net/url"
	"os"
	"path"
	"path/filepath"
	"strings"

	"github.com/antgroup/hugescm/cmd/hot/pkg/co"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
)

type Co struct {
	From        string   `arg:"" name:"from" help:"Original repository remote URL" type:"string"`
	Destination string   `arg:"" optional:"" name:"destination" help:"Destination for the new repository" type:"path"`
	Branch      string   `name:"branch" short:"b" help:"Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name> branch instead"`
	Commit      string   `name:"commit" short:"c" help:"Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name> commit instead"`
	Sparse      []string `name:"sparse" short:"s" help:"A subset of repository files, all files are checked out by default" type:"string"`
	Depth       int      `name:"depth" short:"d" help:"Create a shallow clone with a history truncated to the specified number of commits" default:"5"`
	Limit       int64    `name:"limit" short:"L" help:"Omits blobs larger than n bytes or units. n may be zero. Supported units: KB, MB, GB, K, M, G" default:"-1" type:"size"`
	Recursive   bool     `name:"recursive" short:"r" help:"After the clone is created, initialize and clone submodules within based on the provided pathspec"`
	Values      []string `short:"X" shortonly:"" help:"Override default clone/fetch configuration, format: <key>=<value>"`
}

func (c *Co) concatDestination(baseName string) (string, error) {
	destination := c.Destination
	if len(destination) == 0 {
		destination = strings.TrimSuffix(baseName, ".git")
	}
	if !filepath.IsAbs(destination) {
		cwd, err := os.Getwd()
		if err != nil {
			fmt.Fprintf(os.Stderr, "Get current workdir error: %v\n", err)
			return "", err
		}
		destination = filepath.Join(cwd, destination)
	}
	dirs, err := os.ReadDir(destination)
	if err != nil {
		if os.IsNotExist(err) {
			return destination, nil
		}
		fmt.Fprintf(os.Stderr, "readdir %s error: %v\n", destination, err)
		return "", err
	}
	if len(dirs) != 0 {
		fmt.Fprintf(os.Stderr, "fatal: destination path '%s' already exists and is not an empty directory.\n", filepath.Base(destination))
		return "", ErrWorktreeNotEmpty
	}
	return destination, nil
}

func (c *Co) decodeRemote() (remote string, uri string, err error) {
	remote = c.From
	if git.MatchesScpLike(remote) {
		_, _, _, uri = git.FindScpLikeComponents(remote)
		return
	}
	if git.MatchesScheme(remote) {
		u, err := url.Parse(remote)
		if err != nil {
			return "", "", err
		}
		return remote, u.Path, nil
	}
	return remote, remote, nil
}

func (c *Co) Run(g *Globals) error {
	remote, uri, err := c.decodeRemote()
	if err != nil {
		fmt.Fprintf(os.Stderr, "bad remote '%s' error: '%v'\n", c.From, err)
		return err
	}
	destination, err := c.concatDestination(path.Base(uri))
	if err != nil {
		return err
	}
	trace.DbgPrint("%s --> %s", remote, destination)
	return co.Co(context.Background(), &co.CoOptions{
		Remote:      remote,
		Destination: destination,
		Branch:      c.Branch,
		Commit:      c.Commit,
		Sparse:      c.Sparse,
		Depth:       c.Depth,
		Limit:       c.Limit,
		Recursive:   c.Recursive,
		Values:      c.Values,
	})
}


================================================
FILE: cmd/hot/command/command_diff.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/antgroup/hugescm/cmd/hot/pkg/diff"
	"github.com/antgroup/hugescm/modules/command"
	"github.com/antgroup/hugescm/modules/diferenco"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/patchview"
	"github.com/antgroup/hugescm/modules/term"
	"github.com/antgroup/hugescm/modules/trace"
)

type Diff struct {
	CWD    string   `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
	Cached bool     `name:"cached" help:"Show staged changes"`
	Staged bool     `name:"staged" help:"Same as --cached"`
	JSON   bool     `name:"json" short:"j" help:"Output patches in JSON format"`
	Args   []string `arg:"" optional:"" name:"args" help:"Commit range or paths"`
}

func (c *Diff) Run(g *Globals) error {
	ctx := context.Background()
	repoPath := git.RevParseRepoPath(ctx, c.CWD)
	trace.DbgPrint("repository location: %v", repoPath)

	// Get hash format from repository
	formatName, err := git.RevParseHashFormat(ctx, repoPath)
	if err != nil {
		die("detect hash format: %v", err)
		return err
	}
	hashFormat := git.HashFormatFromName(formatName)
	trace.DbgPrint("hash format: %s, abbrev: %d", formatName, hashFormat.HexSize())

	// Build git diff arguments
	args := []string{
		"diff",
		"--patch",
		"--raw",
		fmt.Sprintf("--abbrev=%d", hashFormat.HexSize()),
		"--full-index",
		"--find-renames=50%",
	}

	if c.Cached || c.Staged {
		args = append(args, "--cached")
	}

	// Append user-provided arguments (commit range, paths, etc.)
	if len(c.Args) > 0 {
		args = append(args, c.Args...)
	}

	// Create and start command
	cmd := command.NewFromOptions(ctx, &command.RunOpts{
		Environ: os.Environ(),
	}, "git", args...)

	stdout, err := cmd.StdoutPipe()
	if err != nil {
		die("create stdout pipe: %v", err)
		return err
	}
	defer stdout.Close() // nolint: errcheck

	if err := cmd.Start(); err != nil {
		die("start git diff: %v", err)
		return err
	}

	// Parse diff output
	parser := diff.NewParser(hashFormat, stdout, diff.Limits{})
	var patches []*diferenco.Patch

	for parser.Parse() {
		p := parser.Patch()
		if p.Patch != nil {
			patches = append(patches, p.Patch)
		}
	}

	if err := cmd.Wait(); err != nil {
		die("git diff: %v", command.FromError(err))
		return err
	}

	if perr := parser.Err(); perr != nil {
		die("parse diff: %v", perr)
		return perr
	}

	trace.DbgPrint("parsed %d patches", len(patches))

	// Display using patchview
	if len(patches) == 0 {
		fmt.Println("No changes")
		return nil
	}

	// JSON output
	if c.JSON {
		encoder := json.NewEncoder(os.Stdout)
		encoder.SetIndent("", "  ")
		return encoder.Encode(patches)
	}

	// Terminal not supported: fallback to plain text output
	if !term.IsTerminal(os.Stdout.Fd()) {
		encoder := diferenco.NewUnifiedEncoder(os.Stdout, diferenco.WithVCS("git"))
		return encoder.Encode(patches)
	}

	return patchview.Run(patches)
}


================================================
FILE: cmd/hot/command/command_expire_refs.go
================================================
package command

import (
	"context"
	"fmt"
	"os"
	"path/filepath"
	"strings"
	"time"

	"github.com/antgroup/hugescm/cmd/hot/pkg/refs"
	"github.com/antgroup/hugescm/modules/fnmatch"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
)

type ExpireRefs struct {
	Pattern []string      `arg:"" optional:"" name:"pattern" help:"Matching pattern, all references are displayed by default"`
	CWD     string        `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
	Merged  bool          `short:"M" name:"merged" help:"Only clean up merged branches, ignoring expiration times"`
	Tag     bool          `short:"T" name:"tag" help:"Clean up expired Tags, off by default"`
	Expires time.Duration `short:"E" name:"expires" help:"Reference expiration time, support: m, h, d, w" type:"expire" default:"90d"`
}

func (c *ExpireRefs) fixup() {
	for i, pattern := range c.Pattern {
		if strings.HasSuffix(pattern, "/") {
			c.Pattern[i] = pattern + "*"
		}
	}
}

func (c *ExpireRefs) Match(name string) bool {
	if len(c.Pattern) == 0 {
		return true
	}
	for _, pattern := range c.Pattern {
		if fnmatch.Match(pattern, name, 0) {
			return true
		}
	}
	return false
}

func (c *ExpireRefs) Expire(ref *refs.Reference) bool {
	if strings.HasPrefix(ref.Name, "refs/tmp/") {
		return true
	}
	if c.Merged {
		return ref.Merged()
	}
	// check ref is tag and cleanup tag
	if ref.IsTag() && !c.Tag {
		return false
	}
	return time.Since(ref.Committer.When) > c.Expires
}

func (c *ExpireRefs) Run(g *Globals) error {
	c.fixup()
	repoPath := git.RevParseRepoPath(context.Background(), c.CWD)
	trace.DbgPrint("repository location: %v expires: %v", repoPath, c.Expires)
	references, err := refs.ScanReferences(context.Background(), repoPath, c, git.OrderNone)
	if err != nil {
		fmt.Fprintf(os.Stderr, "find repo references error: %v\n", err)
		return err
	}
	if len(references.Items) == 0 {
		return nil
	}
	target := filepath.Join(repoPath, "logs/expire-refs.log")
	_ = os.MkdirAll(filepath.Dir(target), 0755)
	fd, err := os.OpenFile(target, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
	if err != nil {
		fmt.Fprintf(os.Stderr, "open logs error: %v\n", err)
		return err
	}
	defer fd.Close() // nolint
	_, _ = fmt.Fprintf(fd, "CLEANUP START TIME: %v\n", time.Now().Format(time.RFC3339))

	u, err := git.NewRefUpdater(context.Background(), repoPath, os.Environ(), false)
	if err != nil {
		fmt.Fprintf(os.Stderr, "RefUpdater: new ref updater error: %v\n", err)
		return err
	}
	defer u.Close() // nolint
	if err := u.Start(); err != nil {
		fmt.Fprintf(os.Stderr, "RefUpdater: Start ref updater error: %v\n", err)
		return err
	}
	var total int
	for _, ref := range references.Items {
		if ref.Name == references.Current {
			continue
		}
		if ref.Broken {
			_ = refs.RemoveBrokenRef(repoPath, ref.Name)
			continue
		}
		if !c.Expire(ref) {
			continue
		}
		if err := u.Delete(git.ReferenceName(ref.Name)); err != nil {
			fmt.Fprintf(os.Stderr, "\x1b[2K\rRefUpdater: Delete %s error: %v\n", ref.Name, err)
			return err
		}
		total++
		date := ref.Committer.When.Format(time.RFC3339)
		_, _ = fmt.Fprintf(fd, "%s %s %s removed\n", ref.Hash, date, ref.Name)
		fmt.Fprintf(os.Stderr, "\x1b[2K\rDELETE '%s' (OID: %s)", ref.ShortName, ref.Hash)
	}
	if err := u.Prepare(); err != nil {
		fmt.Fprintf(os.Stderr, "\x1b[2K\rRefUpdater: Prepare error: %v\n", err)
		return err
	}
	if err := u.Commit(); err != nil {
		fmt.Fprintf(os.Stderr, "\x1b[2K\rRefUpdater: Commit error: %v\n", err)
		return err
	}
	if total != 0 {
		fmt.Fprintf(os.Stderr, "\nExpire refs success, total: %d\n", total)
	}
	return nil
}


================================================
FILE: cmd/hot/command/command_graft.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"context"
	"fmt"
	"os"

	"github.com/antgroup/hugescm/cmd/hot/pkg/replay"
	"github.com/antgroup/hugescm/cmd/hot/pkg/stat"
	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
)

type Graft struct {
	Paths    []string `arg:"" name:"path" help:"Path to repositories" default:"." type:"path"`
	Limit    int64    `short:"L" name:"limit" optional:"" help:"Large file limit size, supported units: KB, MB, GB, K, M, G" default:"20m" type:"size"`
	Confirm  bool     `short:"Y" name:"confirm" help:"Confirm rewriting local branches and tags"`
	Prune    bool     `short:"P" name:"prune" help:"Prune repository when commits are rewritten"`
	HeadOnly bool     `short:"H" name:"head-only" help:"Graft only the default branch"`
	FullPath bool     `short:"F" name:"full-path" help:"Show full path"`
	ALL      bool     `short:"A" name:"all" help:"Remove all large blobs"`
}

func (c *Graft) Run(g *Globals) error {
	for _, p := range c.Paths {
		if err := c.doOnce(g, p); err != nil {
			return err
		}
	}
	return nil
}

func (c *Graft) doOnce(g *Globals, p string) error {
	repoPath := git.RevParseRepoPath(context.Background(), p)
	trace.DbgPrint("check %s size ...", repoPath)
	e := stat.NewSizeExecutor(c.Limit, c.FullPath)
	if err := e.Run(context.Background(), repoPath, false); err != nil {
		fmt.Fprintf(os.Stderr, "check repo size error: %v\n", err)
		return err
	}
	if len(e.Paths()) == 0 {
		return nil
	}
	if len(e.Paths()) > 300 {
		fmt.Fprintf(os.Stderr, "%s %d\n", tr.W("You can increase the file size limit, the number of large files: "), len(e.Paths()))
		return nil
	}
	matcher := newMatcher(e, c.ALL)
	if matcher == nil {
		return nil
	}
	r, err := replay.NewReplayer(context.Background(), repoPath, 4, g.Verbose)
	if err != nil {
		fmt.Fprintf(os.Stderr, "new replayer error: %v\n", err)
		return err
	}
	defer r.Close() // nolint
	if err := r.Graft(matcher, c.Confirm, c.Prune, c.HeadOnly); err != nil {
		fmt.Fprintf(os.Stderr, "replay repo error: %v\n", err)
		return err
	}
	return nil
}


================================================
FILE: cmd/hot/command/command_mc.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"context"
	"errors"
	"fmt"
	"os"
	"path"
	"path/filepath"
	"strings"
	"time"

	"github.com/antgroup/hugescm/cmd/hot/pkg/mc"
	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/command"
)

type Mc struct {
	From        string `arg:"" name:"from" help:"Original repository remote URL (or filesystem path)" type:"string"`
	Destination string `arg:"" optional:"" name:"destination" help:"Destination where the repository is migrated" type:"path"`
	Format      string `name:"format" default:"sha256" help:"Specifying the object format, support only: sha1 or sha256"`
	Bare        bool   `short:"b" name:"bare" optional:"" help:"Save as a bare git repository"`
}

// Migrator
func (c *Mc) concatDestination(baseName string) (string, error) {
	destination := c.Destination
	if len(destination) == 0 {
		destination = strings.TrimSuffix(baseName, ".git")
	}
	if !filepath.IsAbs(destination) {
		cwd, err := os.Getwd()
		if err != nil {
			fmt.Fprintf(os.Stderr, "Get current workdir error: %v\n", err)
			return "", err
		}
		destination = filepath.Join(cwd, destination)
	}
	if c.Bare {
		destination += ".git"
	}
	dirs, err := os.ReadDir(destination)
	if err != nil {
		if os.IsNotExist(err) {
			return destination, nil
		}
		fmt.Fprintf(os.Stderr, "readdir %s error: %v\n", destination, err)
		return "", err
	}
	if len(dirs) != 0 {
		fmt.Fprintf(os.Stderr, "fatal: destination path '%s' already exists and is not an empty directory.\n", filepath.Base(destination))
		return "", ErrWorktreeNotEmpty
	}
	return destination, nil
}

func (c *Mc) cloneAndMigrate(g *Globals, uri string) error {
	destination, err := c.concatDestination(path.Base(uri))
	if err != nil {
		return err
	}
	tempDir, err := os.MkdirTemp(os.TempDir(), "clone")
	if err != nil {
		fmt.Fprintf(os.Stderr, "%s\n", err)
		return err
	}
	defer os.RemoveAll(tempDir) // nolint
	if err := g.RunEx(context.Background(), command.NoDir, "git", "clone", "--bare", c.From, tempDir); err != nil {
		fmt.Fprintf(os.Stderr, "clone error: %v", err)
		return err
	}
	return c.migrateFrom(g, tempDir, destination)
}

func (c *Mc) Run(g *Globals) error {
	uri, err := pickURI(c.From)
	if err == nil {
		return c.cloneAndMigrate(g, uri)
	}
	if !errors.Is(err, ErrLocalEndpoint) {
		fmt.Fprintf(os.Stderr, "bad remote '%s' %v\n", c.From, err)
		return err
	}
	absFrom, err := filepath.Abs(c.From)
	if err != nil {
		fmt.Fprintf(os.Stderr, "bad remote '%s' %v\n", c.From, err)
		return err
	}
	if _, err = os.Stat(c.From); err != nil {
		fmt.Fprintf(os.Stderr, "bad remote '%s' %v\n", c.From, err)
		return err
	}
	destination, err := c.concatDestination(filepath.Base(c.From) + "-sha256")
	if err != nil {
		return err
	}
	return c.migrateFrom(g, absFrom, destination)
}

func (c *Mc) migrateFrom(g *Globals, from, to string) error {
	now := time.Now()
	r, err := mc.NewMigrator(context.Background(), &mc.MigrateOptions{
		From:    from,
		To:      to, //  os.Environ(), from, to, c.Bare, 4, g.Verbose
		Format:  c.Format,
		Bare:    c.Bare,
		Verbose: g.Verbose,
		StepEnd: 4,
	})
	if err != nil {
		fmt.Fprintf(os.Stderr, "mc %s to %s error: %v\n", from, to, err)
		return err
	}
	defer r.Close() // nolint
	if err := r.Execute(context.Background()); err != nil {
		fmt.Fprintf(os.Stderr, "Execute error: %v\n", err)
		return err
	}
	_, _ = tr.Fprintf(os.Stderr, "migrate repository to %s success, spent: %v\n", c.Format, time.Since(now))
	return nil
}


================================================
FILE: cmd/hot/command/command_prune_refs.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"bufio"
	"context"
	"fmt"
	"os"
	"path/filepath"
	"slices"
	"strings"
	"time"

	"github.com/antgroup/hugescm/modules/command"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/strengthen"
)

const (
	// pruneTargetPrefix
	//  refs/pull/${ID}/merge
	//  refs/pull/cloudide/turbodev
	pruneTargetPrefix = "refs/pull/"
)

var (
	// remove expired
	prefixToPrune = []string{
		"refs/heads/FASTQ",
		"refs/heads/conflict_fix_",
		"refs/heads/cooperate/cloudideantservice-",
		"refs/heads/cooperate/reading-FASTQ1",
		"refs/tags/cstone_stc_scan_",
	}
	extremePrefixToPrune = []string{
		"refs/heads/FASTQ",
		"refs/heads/conflict_fix_",
		"refs/heads/cooperate/cloudideantservice-",
		"refs/heads/cooperate/linkc-",
		"refs/heads/cooperate/reading-FASTQ1",
		"refs/heads/cooperate/sop_",
		"refs/heads/eval_ai_ide_",
		"refs/heads/eval_codefuse_augment_",
		"refs/heads/eval_idea_plugin_",
		"refs/heads/next_",
		"refs/heads/next_master_dev_",
		"refs/heads/unit_test_temp",
		"refs/heads/unit_test_temp_xdev",
		"refs/heads/xdev/",
		"refs/tags/cstone_stc_scan_",
	}

	// always remove
	dirtyRefPrefixes = []string{
		"refs/merge-requests/",
		"refs/tmp/",
	}
)

var statReferencesFormatFields = []string{
	"%(refname)", "%(refname:short)", "%(objectname)", "%(committername)", "%(creatordate:iso-strict)",
}

type Reference struct {
	Name       string    `json:"name"`
	ShortName  string    `json:"short_name"`
	Hash       string    `json:"hash"`
	Committer  string    `json:"committer"`
	LastUpdate time.Time `json:"last_update"`
}

func parseReferenceLine(referenceLine string) (*Reference, error) {
	elements := strings.SplitN(referenceLine, "\x00", len(statReferencesFormatFields))
	if len(elements) != len(statReferencesFormatFields) {
		return nil, fmt.Errorf("invalid output from git for-each-ref command: %v", referenceLine)
	}
	return &Reference{
		Name:       elements[0],
		ShortName:  elements[1],
		Hash:       elements[2],
		Committer:  elements[3],
		LastUpdate: git.PareTimeFallback(elements[4]),
	}, nil
}

func GetReferences(ctx context.Context, repoPath string, m func(*Reference) bool) ([]*Reference, error) {
	stderr := command.NewStderr()
	reader, err := git.NewReader(ctx, &command.RunOpts{RepoPath: repoPath, Stderr: stderr}, "for-each-ref", "--format", strings.Join(statReferencesFormatFields, "%00"))
	if err != nil {
		return nil, fmt.Errorf("run git for-each-ref error: %w", err)
	}
	defer reader.Close() // nolint
	references := make([]*Reference, 0, 100)
	scanner := bufio.NewScanner(reader)
	for scanner.Scan() {
		r, err := parseReferenceLine(scanner.Text())
		if err != nil {
			continue
		}
		if m(r) {
			references = append(references, r)
		}
	}
	return references, nil
}

func isDirtyReference(name string) bool {
	return slices.ContainsFunc(dirtyRefPrefixes, func(prefix string) bool {
		return strings.HasPrefix(name, prefix)
	})
}

func prefixesMatch(name string, prefixes []string) bool {
	return slices.ContainsFunc(prefixes, func(prefix string) bool {
		return strings.HasPrefix(name, prefix)
	})
}

type PruneRefs struct {
	Prefixes []string      `arg:"" optional:"" name:"prefixes" help:"Reference prefixes that need to be cleaned up"` // to targets
	CWD      string        `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
	Expires  time.Duration `short:"e" name:"expires" help:"Reference expiration time, support: m, h, d, w" type:"expire" default:"90d"`
	DryRun   bool          `name:"dry-run" short:"n" help:"Dry run"`
	Default  bool          `short:"D" name:"default" help:"Cleanup references using default prefix"`
	Extreme  bool          `short:"E" name:"extreme" help:"Remove more dirty references"`
}

func (c *PruneRefs) preparePrefixes() (prefixes []string) {
	switch {
	case len(c.Prefixes) != 0:
		prefixes = append(prefixes, c.Prefixes...)
		prefixes = append(prefixes, pruneTargetPrefix)
		// List all references
	case c.Extreme:
		prefixes = append(prefixes, extremePrefixToPrune...)
		prefixes = append(prefixes, pruneTargetPrefix)
	case c.Default:
		prefixes = append(prefixes, prefixToPrune...)
		prefixes = append(prefixes, pruneTargetPrefix)
	default:
		prefixes = append(prefixes, pruneTargetPrefix)
	}
	return
}

func (c *PruneRefs) record(repoPath string, refs []*Reference) error {
	tempDir := filepath.Join(repoPath, "temp")
	if err := os.Mkdir(tempDir, 0755); err != nil && !os.IsExist(err) {
		fmt.Fprintf(os.Stderr, "new extraCross error: %v", err)
		return err
	}
	saveTo := filepath.Join(tempDir, strengthen.NewSessionID()+".refs")
	fd, err := os.Create(saveTo)
	if err != nil {
		fmt.Fprintf(os.Stderr, "create record json error: %v", err)
		return err
	}
	defer fd.Close() // nolint
	for _, ref := range refs {
		_, _ = fmt.Fprintf(fd, "%s %s\n", ref.Hash, ref.Name)
	}
	return nil
}

func (c *PruneRefs) pruneRefs(ctx context.Context, repoPath string, references []*Reference) error {
	u, err := git.NewRefUpdater(ctx, repoPath, os.Environ(), false)
	if err != nil {
		fmt.Fprintf(os.Stderr, "RefUpdater: new ref updater error: %v\n", err)
		return err
	}
	defer u.Close() // nolint
	if err := u.Start(); err != nil {
		fmt.Fprintf(os.Stderr, "RefUpdater: Start ref updater error: %v\n", err)
		return err
	}
	for _, ref := range references {
		if !c.DryRun {
			if err := u.Delete(git.ReferenceName(ref.Name)); err != nil {
				fmt.Fprintf(os.Stderr, "\x1b[2K\rRefUpdater: Delete %s error: %v\n", ref.Name, err)
				return err
			}
		}
		fmt.Fprintf(os.Stderr, "\x1b[2K\rDELETE '%s' (OID: %s Date: %s Committer: %s)", ref.ShortName, ref.Hash, ref.LastUpdate.Format(time.RFC3339), ref.Committer)
	}
	if c.DryRun {
		return nil
	}
	if err := u.Prepare(); err != nil {
		fmt.Fprintf(os.Stderr, "\x1b[2K\rRefUpdater: Prepare error: %v\n", err)
		return err
	}
	if err := u.Commit(); err != nil {
		fmt.Fprintf(os.Stderr, "\x1b[2K\rRefUpdater: Commit error: %v\n", err)
		return err
	}
	return nil
}

func (c *PruneRefs) Run(g *Globals) error {
	repoPath := git.RevParseRepoPath(context.Background(), c.CWD)
	prefixes := c.preparePrefixes()
	fmt.Fprintf(os.Stderr, "\x1b[38;2;254;225;64m%s\x1b[0m\n", W("* The following ref prefixes will be deleted:\n"))
	for _, p := range prefixes {
		fmt.Fprintf(os.Stderr, "\x1b[38;2;254;225;64m*  %s\x1b[0m\n", p)
	}
	expiredAt := time.Now().Add(-c.Expires)
	references, err := GetReferences(context.Background(), repoPath, func(r *Reference) bool {
		return isDirtyReference(r.Name) || (prefixesMatch(r.Name, prefixes) && expiredAt.After(r.LastUpdate))
	})
	if err != nil {
		fmt.Fprintf(os.Stderr, "parse references error: %v\n", err)
		return err
	}
	if len(references) == 0 {
		fmt.Fprintf(os.Stderr, "%s", W("No references to be deleted\n"))
		return nil
	}
	if err := c.record(repoPath, references); err != nil {
		return err
	}
	if err := c.pruneRefs(context.Background(), repoPath, references); err != nil {
		return err
	}
	fmt.Fprintf(os.Stderr, "\nPrune refs success, total: %d\n", len(references))
	return nil
}


================================================
FILE: cmd/hot/command/command_remove.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"context"
	"fmt"
	"os"

	"github.com/antgroup/hugescm/cmd/hot/pkg/replay"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
)

type Remove struct {
	CWD      string   `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
	Paths    []string `arg:"" name:"Paths" help:"Path to remove in repository, support wildcards" type:"string"`
	Confirm  bool     `short:"Y" name:"confirm" help:"Confirm rewriting local branches and tags"`
	Prune    bool     `short:"P" name:"prune" help:"Prune repository when commits are rewritten"`
	Graft    bool     `short:"G" name:"graft" help:"Grafting mode"`
	HeadOnly bool     `short:"H" name:"head-only" help:"Graft only the default branch"`
}

func (c *Remove) Run(g *Globals) error {
	repoPath := git.RevParseRepoPath(context.Background(), c.CWD)
	trace.DbgPrint("repository location: %v", repoPath)
	matcher := replay.NewMatcher(c.Paths)
	if c.Graft {
		r, err := replay.NewReplayer(context.Background(), repoPath, 4, g.Verbose)
		if err != nil {
			fmt.Fprintf(os.Stderr, "new replayer error: %v\n", err)
			return err
		}
		defer r.Close() // nolint
		if err := r.Graft(matcher, c.Confirm, c.Prune, c.HeadOnly); err != nil {
			fmt.Fprintf(os.Stderr, "graft repo error: %v\n", err)
			return err
		}
		return nil
	}
	r, err := replay.NewReplayer(context.Background(), repoPath, 3, g.Verbose)
	if err != nil {
		fmt.Fprintf(os.Stderr, "new replayer error: %v\n", err)
		return err
	}
	defer r.Close() // nolint
	if err := r.Drop(matcher, c.Confirm, c.Prune); err != nil {
		fmt.Fprintf(os.Stderr, "replay repo error: %v\n", err)
		return err
	}
	return nil
}


================================================
FILE: cmd/hot/command/command_scan_refs.go
================================================
package command

import (
	"context"
	"fmt"
	"os"
	"strconv"
	"strings"
	"time"

	"charm.land/bubbles/v2/paginator"
	"charm.land/bubbles/v2/table"
	tea "charm.land/bubbletea/v2"
	"charm.land/lipgloss/v2"
	"charm.land/lipgloss/v2/compat"
	"github.com/antgroup/hugescm/cmd/hot/pkg/refs"
	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/fnmatch"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/term"
	"github.com/antgroup/hugescm/modules/trace"
)

func newModel(references *refs.References) model {
	p := paginator.New()
	p.Type = paginator.Dots
	p.PerPage = 20
	p.ActiveDot = lipgloss.NewStyle().Foreground(compat.AdaptiveColor{Light: lipgloss.Color("235"), Dark: lipgloss.Color("252")}).Render("•")
	p.InactiveDot = lipgloss.NewStyle().Foreground(compat.AdaptiveColor{Light: lipgloss.Color("250"), Dark: lipgloss.Color("238")}).Render("•")
	p.SetTotalPages(len(references.Items))

	return model{
		paginator:  p,
		references: references,
	}
}

type model struct {
	references *refs.References
	paginator  paginator.Model
	table      table.Model
	ready      bool
}

func (m model) Init() tea.Cmd {
	return nil
}

func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
	var cmd tea.Cmd

	switch msg := msg.(type) {
	case tea.KeyPressMsg:
		switch msg.String() {
		case "q", "esc", "ctrl+c":
			return m, tea.Quit
		case "h", "left":
			// Previous page
			if m.paginator.Page > 0 {
				m.paginator.PrevPage()
				m.ready = false
			}
		case "l", "right":
			// Next page
			if m.paginator.Page < m.paginator.TotalPages-1 {
				m.paginator.NextPage()
				m.ready = false
			}
		}
	}

	// Update table
	if m.ready {
		m.table, cmd = m.table.Update(msg)
	}

	// Build table on first render or page change
	if !m.ready {
		m.table = m.buildTable()
		m.ready = true
	}

	return m, cmd
}

func (m model) buildTable() table.Model {
	start, end := m.paginator.GetSliceBounds(len(m.references.Items))

	// Build table columns with proper widths
	termWidth := getTerminalWidth()
	colWidths := struct {
		hash    int
		date    int
		name    int
		leading int
		lagging int
	}{
		hash:    40, // Full commit hash
		date:    25,
		leading: 8,
		lagging: 8,
	}
	// Width calculation:
	// terminal = table + lipgloss borders(2)
	// table = sum(colWidths) + padding + separators
	// For 5 columns with padding=1: sum(col) + 2*5 + 4 = sum(col) + 14
	fixedWidth := colWidths.hash + colWidths.date + colWidths.leading + colWidths.lagging + 16 // 16 = padding + separators + lipgloss borders
	colWidths.name = max(30, min(80, termWidth-fixedWidth))

	columns := []table.Column{
		{Title: tr.W("Hash"), Width: colWidths.hash},
		{Title: tr.W("Date"), Width: colWidths.date},
		{Title: tr.W("Reference Name"), Width: colWidths.name},
		{Title: tr.W("Leading"), Width: colWidths.leading},
		{Title: tr.W("Lagging"), Width: colWidths.lagging},
	}

	// Build table rows
	rows := make([]table.Row, 0, end-start)
	for _, item := range m.references.Items[start:end] {
		if item.Broken {
			rows = append(rows, table.Row{item.Hash, "", item.Name, tr.W("reference is broken"), ""})
			continue
		}
		date := item.Committer.When.Local().Format(time.RFC3339)
		if item.Name == m.references.Current || !item.IsBranch() {
			rows = append(rows, table.Row{item.Hash, date, item.ShortName, "", ""})
			continue
		}
		if item.Leading == 0 {
			rows = append(rows, table.Row{item.Hash, date, item.ShortName, "*merged", strconv.Itoa(item.Lagging)})
			continue
		}
		rows = append(rows, table.Row{item.Hash, date, item.ShortName, strconv.Itoa(item.Leading), strconv.Itoa(item.Lagging)})
	}

	// Create table
	// Total width must not exceed terminal width - lipgloss borders (2)
	totalWidth := termWidth - 2
	t := table.New(
		table.WithColumns(columns),
		table.WithRows(rows),
		table.WithFocused(true),
		table.WithHeight(min(20, len(rows)+2)),
		table.WithWidth(totalWidth),
	)

	// Apply styles
	s := table.DefaultStyles()
	s.Header = s.Header.
		BorderStyle(lipgloss.NormalBorder()).
		BorderForeground(lipgloss.Color("243")).
		BorderBottom(true).
		Bold(true).
		Foreground(lipgloss.Color("173")).
		Padding(0, 1)
	s.Cell = s.Cell.Padding(0, 1)
	s.Selected = s.Selected.
		Foreground(lipgloss.Color("230")).
		Background(lipgloss.Color("57")).
		Bold(false)
	t.SetStyles(s)

	return t
}

func (m model) View() tea.View {
	var b strings.Builder
	fmt.Fprintf(&b, "\n  %s\x1b[38;2;32;225;215m%d\x1b[0m\n\n", tr.W("Matched references: "), len(m.references.Items))

	if m.ready {
		// Wrap table with lipgloss to add complete borders
		tableStyle := lipgloss.NewStyle().
			BorderStyle(lipgloss.NormalBorder()).
			BorderForeground(lipgloss.Color("243"))
		b.WriteString(tableStyle.Render(m.table.View()))
		b.WriteString("\n\n")
		b.WriteString("  " + m.paginator.View())
		b.WriteString("\n\n  ↑/k ↓/j: navigate • h/l ←/→: page • q: quit\n")
	}

	return tea.NewView(b.String())
}

// getTerminalWidth returns the terminal width with a default fallback
func getTerminalWidth() int {
	if width, _, err := term.GetSize(int(os.Stdout.Fd())); err == nil && width > 0 {
		return width
	}
	return 80
}

type ScanRefs struct {
	Pattern []string `arg:"" optional:"" name:"pattern" help:"Matching pattern, all references are displayed by default"`
	CWD     string   `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
	Oldest  bool     `short:"O" name:"oldest" help:"Sort by time from oldest to newest"`
}

func (c *ScanRefs) fixup() {
	for i, pattern := range c.Pattern {
		if strings.HasSuffix(pattern, "/") {
			c.Pattern[i] = pattern + "*"
		}
	}
}

func (c *ScanRefs) Match(name string) bool {
	if len(c.Pattern) == 0 {
		return true
	}
	for _, pattern := range c.Pattern {
		if fnmatch.Match(pattern, name, 0) {
			return true
		}
	}
	return false
}

func (c *ScanRefs) Run(g *Globals) error {
	c.fixup()
	repoPath := git.RevParseRepoPath(context.Background(), c.CWD)
	trace.DbgPrint("repository location: %v", repoPath)
	order := git.OrderNewest
	if c.Oldest {
		order = git.OrderOldest
	}
	references, err := refs.ScanReferences(context.Background(), repoPath, c, order)
	if err != nil {
		fmt.Fprintf(os.Stderr, "scan references error: %v\n", err)
		return err
	}
	if len(references.Items) == 0 {
		return nil
	}
	p := tea.NewProgram(newModel(references))
	if _, err := p.Run(); err != nil {
		fmt.Fprintf(os.Stderr, "show references error: %v\n", err)
		return err
	}
	return nil
}


================================================
FILE: cmd/hot/command/command_show.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/antgroup/hugescm/cmd/hot/pkg/diff"
	"github.com/antgroup/hugescm/modules/command"
	"github.com/antgroup/hugescm/modules/diferenco"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/patchview"
	"github.com/antgroup/hugescm/modules/term"
	"github.com/antgroup/hugescm/modules/trace"
)

type Show struct {
	CWD    string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
	Commit string `arg:"" name:"commit" help:"Commit to show" optional:"" default:"HEAD"`
	JSON   bool   `name:"json" short:"j" help:"Output patches in JSON format"`
}

func (c *Show) Run(g *Globals) error {
	ctx := context.Background()
	repoPath := git.RevParseRepoPath(ctx, c.CWD)
	trace.DbgPrint("repository location: %v", repoPath)

	// Get hash format from repository
	formatName, err := git.RevParseHashFormat(ctx, repoPath)
	if err != nil {
		die("detect hash format: %v", err)
		return err
	}
	hashFormat := git.HashFormatFromName(formatName)
	trace.DbgPrint("hash format: %s, abbrev: %d", formatName, hashFormat.HexSize())

	// Build git show arguments
	args := []string{
		"show",
		"--patch",
		"--raw",
		fmt.Sprintf("--abbrev=%d", hashFormat.HexSize()),
		"--full-index",
		"--find-renames=50%",
		"--format=",
		c.Commit,
	}

	// Create and start command
	cmd := command.NewFromOptions(ctx, &command.RunOpts{
		Environ: os.Environ(),
	}, "git", args...)

	stdout, err := cmd.StdoutPipe()
	if err != nil {
		die("create stdout pipe: %v", err)
		return err
	}
	defer stdout.Close() // nolint: errcheck

	if err := cmd.Start(); err != nil {
		die("start git show: %v", err)
		return err
	}

	// Parse diff output
	parser := diff.NewParser(hashFormat, stdout, diff.Limits{})
	var patches []*diferenco.Patch

	for parser.Parse() {
		p := parser.Patch()
		if p.Patch != nil {
			patches = append(patches, p.Patch)
		}
	}

	if err := cmd.Wait(); err != nil {
		die("git show: %v", command.FromError(err))
		return err
	}

	if perr := parser.Err(); perr != nil {
		die("parse diff: %v", perr)
		return perr
	}

	trace.DbgPrint("parsed %d patches", len(patches))

	// Display using patchview
	if len(patches) == 0 {
		fmt.Println("No changes")
		return nil
	}

	// JSON output
	if c.JSON {
		encoder := json.NewEncoder(os.Stdout)
		encoder.SetIndent("", "  ")
		return encoder.Encode(patches)
	}

	// Terminal not supported: fallback to plain text output
	if !term.IsTerminal(os.Stdout.Fd()) {
		encoder := diferenco.NewUnifiedEncoder(os.Stdout, diferenco.WithVCS("git"))
		return encoder.Encode(patches)
	}

	return patchview.Run(patches)
}


================================================
FILE: cmd/hot/command/command_size.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"context"
	"fmt"
	"os"

	"github.com/antgroup/hugescm/cmd/hot/pkg/stat"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
)

type Size struct {
	Paths    []string `arg:"" name:"path" help:"Path to repositories" default:"." type:"path"`
	Limit    int64    `short:"L" name:"limit" optional:"" help:"Large file limit size, supported units: KB, MB, GB, K, M, G" default:"20m" type:"size"`
	Extract  bool     `short:"E" name:"extract" optional:"" help:"Whether large files exist in the default branch"`
	FullPath bool     `short:"F" name:"full-path" help:"Show full path"`
}

func (c *Size) Run(g *Globals) error {
	for _, p := range c.Paths {
		if err := c.sizeOnce(p); err != nil {
			fmt.Fprintf(os.Stderr, "show repo '%s' size error: %v\n", p, err)
			return err
		}
	}
	return nil
}

func (c *Size) sizeOnce(p string) error {
	repoPath := git.RevParseRepoPath(context.Background(), p)
	trace.DbgPrint("check %s size ...", repoPath)
	e := stat.NewSizeExecutor(c.Limit, c.FullPath)
	if err := e.Run(context.Background(), repoPath, c.Extract); err != nil {
		return err
	}
	return nil
}


================================================
FILE: cmd/hot/command/command_smart.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"context"
	"fmt"
	"os"

	"charm.land/huh/v2"
	"github.com/antgroup/hugescm/cmd/hot/pkg/replay"
	"github.com/antgroup/hugescm/cmd/hot/pkg/stat"
	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
)

type Smart struct {
	Paths    []string `arg:"" name:"path" help:"Path to repositories" default:"." type:"path"`
	Limit    int64    `short:"L" name:"limit" optional:"" help:"Large file limit size, supported units: KB, MB, GB, K, M, G" default:"20m" type:"size"`
	Confirm  bool     `short:"Y" name:"confirm" help:"Confirm rewriting local branches and tags"`
	Prune    bool     `short:"P" name:"prune" help:"Prune repository when commits are rewritten"`
	FullPath bool     `short:"F" name:"full-path" help:"Show full path"`
	ALL      bool     `short:"A" name:"all" help:"Remove all large blobs"`
}

func (c *Smart) Run(g *Globals) error {
	for _, p := range c.Paths {
		if err := c.doOnce(g, p); err != nil {
			return err
		}
	}
	return nil
}

func multiSelect(i int, totalBatches int, input []string) ([]string, error) {
	var paths []string
	form := huh.NewForm(
		huh.NewGroup(
			huh.NewMultiSelect[string]().
				Title(fmt.Sprintf("%s [%s - %d/%d]:", tr.W("Which files need to be deleted"), tr.W("Batch"), i+1, totalBatches)).
				Options(huh.NewOptions(input...)...).
				Value(&paths)))
	if err := form.Run(); err != nil {
		return nil, err
	}
	return paths, nil
}

func newMatcher(sz *stat.SizeExecutor, matchAll bool) replay.Matcher {
	if matchAll {
		return sz
	}
	larges := sz.Paths()
	selected := make([]string, 0, len(larges))
	totalBatches := (len(larges) + 19) / 20
	for i := range totalBatches {
		pathsLen := len(larges)
		if pathsLen == 0 {
			break
		}
		minGroup := min(20, pathsLen)
		var paths []string
		var err error
		paths, err = multiSelect(i, totalBatches, larges[0:minGroup])
		if err != nil {
			fmt.Fprintf(os.Stderr, "multi select error: %v\n", err)
			return nil
		}
		larges = larges[minGroup:]
		selected = append(selected, paths...)
	}
	if len(selected) == 0 {
		return nil
	}
	fmt.Fprintf(os.Stderr, "%s %d\n", tr.W("The total number of files that will be deleted is:"), len(selected))
	return replay.NewEqualer(selected)
}

func (c *Smart) doOnce(g *Globals, p string) error {
	repoPath := git.RevParseRepoPath(context.Background(), p)
	trace.DbgPrint("check %s size ...", p)
	e := stat.NewSizeExecutor(c.Limit, c.FullPath)
	if err := e.Run(context.Background(), repoPath, false); err != nil {
		fmt.Fprintf(os.Stderr, "analyze repo size error: %v\n", err)
		return err
	}
	if len(e.Paths()) == 0 {
		return nil
	}
	if len(e.Paths()) > 300 {
		fmt.Fprintf(os.Stderr, "%s %d\n", tr.W("You can increase the file size limit, the number of large files: "), len(e.Paths()))
		return nil
	}
	matcher := newMatcher(e, c.ALL)
	if matcher == nil {
		return nil
	}
	r, err := replay.NewReplayer(context.Background(), repoPath, 3, g.Verbose)
	if err != nil {
		fmt.Fprintf(os.Stderr, "new rewriter error: %v\n", err)
		return err
	}
	defer r.Close() // nolint
	if err := r.Drop(matcher, c.Confirm, c.Prune); err != nil {
		fmt.Fprintf(os.Stderr, "rewrite repo error: %v\n", err)
		return err
	}
	return nil
}


================================================
FILE: cmd/hot/command/command_snapshot.go
================================================
package command

import (
	"bufio"
	"context"
	"errors"
	"fmt"
	"io"
	"os"
	"path/filepath"
	"strings"
	"unicode"

	"github.com/antgroup/hugescm/modules/command"
	"github.com/antgroup/hugescm/modules/env"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
)

const (
	snapshotSummaryFormat = `%shot snapshot [<options>]
%shot snapshot [<options>] --push [reference]
%shot snapshot [<options>] --push [<remote>] [<reference>]
`
)

type Snapshot struct {
	Message        []string `name:"message" short:"m" help:"Use the given message as the commit message. Concatenate multiple -m options as separate paragraphs"`
	File           string   `name:"file" short:"F" help:"Take the commit message from the given file. Use - to read the message from the standard input"`
	Parents        []string `name:"parents" short:"p" help:"ID of a parent commit object"`
	CWD            string   `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
	Orphan         bool     `name:"orphan" help:"Create an orphan commit"`
	Push           bool     `name:"push" short:"P" help:"Push the worktree snapshot commit to the remote"`
	Force          bool     `name:"force" short:"f" help:"Force updates"`
	UnresolvedArgs []string `arg:"" optional:"" hidden:""`
	repoPath       string   `kong:"-"`
	worktree       string   `kong:"-"`
}

func (c *Snapshot) Summary() string {
	or := W("   or: ")
	return fmt.Sprintf(snapshotSummaryFormat, W("Usage: "), or, or)
}

func (c *Snapshot) Passthrough(paths []string) {
	c.UnresolvedArgs = append(c.UnresolvedArgs, paths...)
}

func messageReadFrom(r io.Reader) (string, error) {
	br := bufio.NewScanner(r)
	lines := make([]string, 0, 10)
	for br.Scan() {
		line := strings.TrimRightFunc(br.Text(), unicode.IsSpace)
		if strings.HasPrefix(line, "#") {
			break
		}
		lines = append(lines, line)
	}
	if br.Err() != nil {
		return "", br.Err()
	}
	var pos int
	for i, n := range lines {
		if len(n) != 0 {
			pos = i
			break
		}
	}
	lines = lines[pos:]
	if len(lines) == 0 {
		return "", nil
	}
	lines[0] = strings.TrimSpace(lines[0])
	if lines[len(lines)-1] != "" {
		lines = append(lines, "")
	}
	return strings.Join(lines, "\n"), nil
}

func messageReadFromPath(p string) (string, error) {
	fd, err := os.Open(p)
	if err != nil {
		return "", err
	}
	defer fd.Close() // nolint
	return messageReadFrom(fd)
}

func genMessage(message []string) string {
	if len(message) == 0 {
		return ""
	}
	lines := make([]string, 0, 10)
	lines = append(lines, strings.Split(message[0], "\n")...)
	if len(message) > 1 {
		lines = append(lines, message[1:]...)
	}
	var pos int
	for i, n := range lines {
		if len(n) != 0 {
			pos = i
			break
		}
	}
	lines = lines[pos:]
	if len(lines) == 0 {
		return ""
	}
	lines[0] = strings.TrimSpace(lines[0])
	if lines[len(lines)-1] != "" {
		lines = append(lines, "")
	}
	return strings.Join(lines, "\n")
}

func (c *Snapshot) genMessage() (message string, err error) {
	switch {
	case c.File == "-":
		if message, err = messageReadFrom(os.Stdin); err != nil {
			die("read messsage from stdin: %v", err)
			return
		}
	case len(c.File) != 0:
		if message, err = messageReadFromPath(c.File); err != nil {
			die("read messsage from %s: %v", c.File, err)
			return
		}
	default:
		message = genMessage(c.Message)
	}
	if len(message) == 0 {
		fmt.Fprintln(os.Stderr, W("Aborting commit due to empty commit message."))
		return "", errors.New("not allow empty message")
	}
	return
}

func (c *Snapshot) snapshotWriteIndex(ctx context.Context, snapshotEnv []string, treeish string) error {
	psArgs := []string{"read-tree"}
	if len(treeish) != 0 && !git.IsHashZero(treeish) {
		if !git.ValidateReferenceName([]byte(treeish)) {
			return fmt.Errorf("bad revision name '%s'", treeish)
		}
		psArgs = append(psArgs, "--", treeish)
	} else {
		psArgs = append(psArgs, "--empty")
	}

	cmd := command.NewFromOptions(ctx, &command.RunOpts{
		RepoPath:  c.repoPath,
		Environ:   snapshotEnv,
		Stderr:    os.Stderr,
		NoSetpgid: true,
	}, "git", psArgs...)
	return cmd.RunEx()
}

func (c *Snapshot) addALL(ctx context.Context, snapshotEnv []string) error {
	cmd := command.NewFromOptions(ctx, &command.RunOpts{
		RepoPath:  c.worktree,
		Environ:   snapshotEnv,
		Stderr:    os.Stderr,
		NoSetpgid: true,
	}, "git", "add", "-A")
	return cmd.RunEx()
}

func (c *Snapshot) writeTree(ctx context.Context, snapshotEnv []string) (string, error) {
	cmd := command.NewFromOptions(ctx, &command.RunOpts{
		RepoPath:  c.repoPath,
		Stderr:    os.Stderr,
		Environ:   snapshotEnv,
		NoSetpgid: true,
	}, "git", "write-tree")
	treeID, err := cmd.OneLine()
	if err != nil {
		return "", err
	}
	return treeID, nil
}

func (c *Snapshot) doSnapshot(ctx context.Context, basePoint string) (string, error) {
	snapshotIndex := filepath.Join(c.repoPath, "snapshot.index") // INDEX file
	snapshotEnv := env.SanitizeEnv("GIT_INDEX_VERSION", "GIT_INDEX_FILE")
	snapshotEnv = append(snapshotEnv,
		"GIT_INDEX_VERSION=4",
		"GIT_INDEX_FILE="+snapshotIndex,
	)
	if err := c.snapshotWriteIndex(ctx, snapshotEnv, basePoint); err != nil {
		die("git read-tree error: %v", err)
		return "", err
	}
	if err := c.addALL(ctx, snapshotEnv); err != nil {
		die("git add error: %v", err)
		return "", err
	}
	treeOID, err := c.writeTree(ctx, snapshotEnv)
	if err != nil {
		die("git write-tree: %v", err)
		return "", err
	}
	trace.DbgPrint("new tree: %s", treeOID)
	message, err := c.genMessage()
	if err != nil {
		return "", err
	}
	psArgs := []string{
		"commit-tree",
		"-F",
		"-",
	}
	parents := c.Parents
	if len(parents) == 0 && !c.Orphan {
		parents = append(parents, basePoint)
	}
	for _, parent := range parents {
		if parent == "" || git.IsHashZero(parent) {
			continue
		}

		psArgs = append(psArgs, "-p", parent)
	}
	psArgs = append(psArgs, treeOID)
	stdin := strings.NewReader(message)
	cmd := command.NewFromOptions(ctx, &command.RunOpts{
		RepoPath:  c.repoPath,
		Stdin:     stdin,
		Stderr:    os.Stderr,
		Environ:   snapshotEnv,
		NoSetpgid: true,
	}, "git", psArgs...)
	commitID, err := cmd.OneLine()
	if err != nil {
		die("git commit-tree error: %v", err)
		return "", err
	}
	return commitID, nil
}

func (c *Snapshot) Run(g *Globals) error {
	var remote, refname string
	if c.Push {
		switch len(c.UnresolvedArgs) {
		case 0:
			die("hot snapshot --push require remote refname")
			return errors.New("missing args")
		case 1:
			remote = "origin"
			refname = c.UnresolvedArgs[0]
		default:
			remote = c.UnresolvedArgs[0]
			refname = c.UnresolvedArgs[1]
		}
	}
	var err error
	if c.worktree, err = git.RevParseWorktree(context.Background(), c.CWD); err != nil {
		die("can only be run on non-bare repositories, error: %v", err)
		return err
	}
	c.repoPath = git.RevParseRepoPath(context.Background(), c.CWD)
	trace.DbgPrint("repository location: %v", c.repoPath)
	current, basePoint, err := git.RevParseCurrent(context.Background(), os.Environ(), c.repoPath)
	if err != nil {
		die("rev-parse HEAD: %v", err)
		return err
	}
	trace.DbgPrint("current '%s' commit: %s", current, basePoint)
	commit, err := c.doSnapshot(context.Background(), basePoint)
	if err != nil {
		return err
	}
	fmt.Fprintln(os.Stderr, W("new snapshot commit:"))
	_, _ = fmt.Fprintln(os.Stdout, commit)
	if !c.Push {
		return nil
	}
	trace.DbgPrint("remote %s reference: %s", remote, refname)
	psArgs := []string{"push"}
	if c.Force {
		psArgs = append(psArgs, "-f")
	}
	psArgs = append(psArgs, remote, fmt.Sprintf("%s:%s", commit, refname))
	cmd := command.NewFromOptions(context.Background(),
		&command.RunOpts{
			RepoPath:  c.repoPath,
			Environ:   os.Environ(),
			Stdin:     os.Stdin,
			Stdout:    os.Stdout,
			Stderr:    os.Stderr,
			NoSetpgid: true,
		}, "git", psArgs...)
	if err := cmd.RunEx(); err != nil {
		return err
	}
	return nil
}


================================================
FILE: cmd/hot/command/command_stat.go
================================================
package command

import (
	"context"

	"github.com/antgroup/hugescm/cmd/hot/pkg/stat"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
)

type Stat struct {
	CWD   string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
	Limit int64  `short:"L" name:"limit" optional:"" help:"Large file limit size, supported units: KB, MB, GB, K, M, G" default:"20m" type:"size"`
}

func (c *Stat) Run(g *Globals) error {
	repoPath := git.RevParseRepoPath(context.Background(), c.CWD)
	trace.DbgPrint("repository location: %v", repoPath)
	return stat.Stat(context.Background(), &stat.StatOptions{
		RepoPath: repoPath,
		Limit:    c.Limit,
	})
}


================================================
FILE: cmd/hot/command/command_unbranch.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"context"
	"errors"
	"fmt"
	"os"

	"github.com/antgroup/hugescm/cmd/hot/pkg/replay"
	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
)

type Unbranch struct {
	Revision string `arg:"" optional:"" name:"revision" help:"Linearize the specified revision history"`
	CWD      string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
	Confirm  bool   `short:"Y" name:"confirm" help:"Confirm rewriting local branches and tags"`
	Prune    bool   `short:"P" name:"prune" help:"Prune repository when commits are rewritten"`
	Target   string `short:"T" name:"target" help:"Save linearized branches to new target"`
	Keep     int    `short:"K" name:"keep" help:"Keep the number of commits, 0 keeps all commits"`
}

func (c *Unbranch) Run(g *Globals) error {
	if len(c.Revision) == 0 && c.Keep != 0 {
		fmt.Fprintf(os.Stderr, "%s\n", tr.W("unbranch unspecified branch mode is incompatible with --keep"))
		return errors.New("unbranch unspecified branch mode is incompatible with --keep")
	}
	if len(c.Target) != 0 {
		if !git.ValidateBranchName([]byte(c.Target)) {
			fmt.Fprintf(os.Stderr, "invalid branch name '%s'\n", c.Target)
			return errors.New("bad branch name")
		}
	}
	repoPath := git.RevParseRepoPath(context.Background(), c.CWD)
	trace.DbgPrint("repository location: %v", repoPath)
	r, err := replay.NewReplayer(context.Background(), repoPath, 2, g.Verbose)
	if err != nil {
		fmt.Fprintf(os.Stderr, "new replayer error: %v\n", err)
		return err
	}
	defer r.Close() // nolint
	if err := r.Unbranch(&replay.UnbranchOptions{
		Branch:  c.Revision,
		Target:  c.Target,
		Confirm: c.Confirm,
		Prune:   c.Prune,
		Keep:    c.Keep,
	}); err != nil {
		fmt.Fprintf(os.Stderr, "Linearize repo history error: %v\n", err)
		return err
	}
	return nil
}


================================================
FILE: cmd/hot/command/misc.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package command

import (
	"bytes"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"reflect"
	"strconv"
	"strings"
	"time"

	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/strengthen"
	"github.com/antgroup/hugescm/pkg/kong"
)

var (
	ErrSyntaxSize = errors.New("size synatx error")
)

const (
	Byte int64 = 1 << (iota * 10)
	KiByte
	MiByte
	GiByte
	TiByte
	PiByte
	EiByte
)

var (
	sizeRatio = map[string]int64{
		"b": 1,
		"k": KiByte,
		"m": MiByte,
		"g": GiByte,
		"t": TiByte,
		"p": PiByte,
		"e": EiByte,
	}
)

func decodeSize(text string) (int64, error) {
	text = strings.TrimSuffix(strings.ToLower(text), "b")
	for s, ratio := range sizeRatio {
		if strings.HasSuffix(text, s) {
			i, err := strconv.ParseInt(strings.TrimSpace(text[0:len(text)-len(s)]), 10, 64)
			if err != nil {
				return 0, err
			}
			return i * ratio, nil
		}
	}
	return strconv.ParseInt(text, 10, 64)
}

func SizeDecoder() kong.MapperFunc {
	return func(ctx *kong.DecodeContext, target reflect.Value) error {
		t, err := ctx.Scan.PopValue("string")
		if err != nil {
			return err
		}
		var sv string
		switch v := t.Value.(type) {
		case string:
			sv = v
		default:
			return fmt.Errorf("expected a string value but got %q (%T)", t, t.Value)
		}
		i, err := decodeSize(sv)
		if err != nil {
			return err
		}
		if target.Kind() != reflect.Int64 {
			return fmt.Errorf("internal error: type 'size' only works with fields of type int64; got %s", target.Type())
		}
		target.SetInt(i)
		return nil
	}
}

var (
	typeLen = map[string]int64{
		"seconds": 1,
		"minutes": 60,
		"hours":   60 * 60,
		"days":    24 * 60 * 60,
		"weeks":   7 * 24 * 60 * 60,
	}
)

func parseTime(str string) (int64, error) {
	if tt, err := time.Parse(time.RFC3339, str); err == nil {
		d := time.Until(tt)
		return int64(d.Seconds()), nil
	}
	if d, err := strengthen.ParseDuration(str); err == nil {
		return int64(d.Seconds()), nil
	}
	vv := strings.FieldsFunc(str, func(r rune) bool {
		return r == '.' || r == ' '
	})
	if len(vv) != 3 {
		return 0, fmt.Errorf("bad expire %s", str)
	}
	x, err := strconv.ParseInt(vv[0], 10, 64)
	if err != nil {
		return 0, err
	}
	l := typeLen[vv[1]]
	if l == 0 {
		return 0, fmt.Errorf("bad expire %s", vv[1])
	}
	return x * l, nil
}

// expire
func ExpireDecoder() kong.MapperFunc {
	return func(ctx *kong.DecodeContext, target reflect.Value) error {
		t, err := ctx.Scan.PopValue("string")
		if err != nil {
			return err
		}
		var sv string
		switch v := t.Value.(type) {
		case string:
			sv = v
		default:
			return fmt.Errorf("expected a string value but got %q (%T)", t, t.Value)
		}
		switch sv {
		case "never", "false":
			target.SetInt(math.MaxInt64)
		case "all", "now":
			target.SetInt(0)
		default:
			t, err := parseTime(sv)
			if err != nil {
				return err
			}
			target.SetInt(t * int64(time.Second))
		}
		return nil
	}
}

type NopWriteCloser struct {
	io.Writer
}

func (NopWriteCloser) Close() error {
	return nil
}

func W(a string) string {
	return tr.W(a)
}

func die(format string, a ...any) {
	var b bytes.Buffer
	_, _ = b.WriteString(W("fatal: "))
	fmt.Fprintf(&b, W(format), a...)
	_ = b.WriteByte('\n')
	_, _ = os.Stderr.Write(b.Bytes())
}


================================================
FILE: cmd/hot/command/pager.go
================================================
package command

import (
	"context"
	"io"
	"os"
	"os/exec"

	"github.com/antgroup/hugescm/modules/env"
	"github.com/antgroup/hugescm/modules/shlex"
	"github.com/antgroup/hugescm/modules/term"
)

type Printer interface {
	io.WriteCloser
	ColorMode() term.Level
	EnableColor() bool
}

type WrapPrinter struct {
	io.WriteCloser
}

func (WrapPrinter) ColorMode() term.Level {
	return term.LevelNone
}

func (WrapPrinter) EnableColor() bool {
	return false
}

// https://github.com/sharkdp/bat/blob/master/src/less.rs
func lookupPager() (string, bool) {
	pager, ok := os.LookupEnv("GIT_PAGER")
	if ok {
		return pager, ok
	}
	return os.LookupEnv("PAGER")
}

type printer struct {
	w         io.Writer
	colorMode term.Level
	closeFn   func() error
}

func (p *printer) EnableColor() bool {
	return p.colorMode != term.LevelNone
}

func (p *printer) ColorMode() term.Level {
	return p.colorMode
}

func (p *printer) Write(b []byte) (n int, err error) {
	return p.w.Write(b)
}

func (p *printer) Close() error {
	if p.closeFn == nil {
		return nil
	}
	return p.closeFn()
}

func NewPrinter(ctx context.Context) *printer {
	if term.StdoutLevel == term.LevelNone {
		return &printer{w: os.Stdout, colorMode: term.StdoutLevel}
	}
	pager, ok := lookupPager()
	if ok && len(pager) == 0 {
		// PAGER disabled
		return &printer{w: os.Stdout, colorMode: term.StdoutLevel}
	}
	if len(pager) == 0 {
		pager = "less" // search pager
	}
	pagerArgs := make([]string, 0, 4)
	if cmdArgs, _ := shlex.Split(pager, true); len(cmdArgs) > 0 {
		pager = cmdArgs[0]
		pagerArgs = append(pagerArgs, cmdArgs[1:]...)
	}
	pagerExe, err := env.LookupPager(pager)
	if err != nil {
		return &printer{w: os.Stdout, colorMode: term.StdoutLevel}
	}
	cmd := exec.CommandContext(ctx, pagerExe, pagerArgs...)
	cmd.Env = env.SanitizeEnv("PAGER", "LESS", "LV") // AVOID PAGER ENV
	// PAGER_ENV: LESS=FRX LV=-c
	cmd.Env = append(cmd.Env, "LESS=FRX", "LV=-c")
	stdin, err := cmd.StdinPipe()
	if err != nil {
		return &printer{w: os.Stdout, colorMode: term.StdoutLevel}
	}
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	if err := cmd.Start(); err != nil {
		_ = stdin.Close()
		return &printer{w: os.Stdout, colorMode: term.StdoutLevel}
	}
	return &printer{w: stdin, colorMode: term.StdoutLevel, closeFn: func() error {
		_ = stdin.Close()
		if err := cmd.Wait(); err != nil {
			return err
		}
		return nil
	}}
}


================================================
FILE: cmd/hot/crate.toml
================================================
name = "hot"
description = "HugeSCM - A next generation cloud-based version control system"
destination = "bin"
version = "0.23.0"
goflags = [
    "-ldflags",
    "-X github.com/antgroup/hugescm/pkg/version.version=$BUILD_VERSION -X github.com/antgroup/hugescm/pkg/version.buildTime=$BUILD_TIME -X github.com/antgroup/hugescm/pkg/version.buildCommit=$BUILD_COMMIT -X github.com/antgroup/hugescm/pkg/version.telemetry=true",
]


================================================
FILE: cmd/hot/hot.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package main

import (
	"os"

	"github.com/antgroup/hugescm/cmd/hot/command"
	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/env"
	"github.com/antgroup/hugescm/modules/strengthen"
	"github.com/antgroup/hugescm/modules/trace"
	"github.com/antgroup/hugescm/pkg/kong"
	"github.com/antgroup/hugescm/pkg/version"
)

type App struct {
	command.Globals
	Cat        command.Cat        `cmd:"cat" help:"Provide contents or details of repository objects"`
	Stat       command.Stat       `cmd:"stat" help:"View repository status"`
	Size       command.Size       `cmd:"size" help:"Show repositories size and large files"`
	Remove     command.Remove     `cmd:"remove" help:"Remove files in repository and rewrite history"`
	Smart      command.Smart      `cmd:"smart" help:"Interactive mode to clean repository large files"`
	Graft      command.Graft      `cmd:"graft" help:"Interactive mode to clean repository large files (Grafting mode)"`
	Mc         command.Mc         `cmd:"mc" help:"Migrate a repository to the specified object format"`
	Unbranch   command.Unbranch   `cmd:"unbranch " help:"Linearize repository history"`
	PruneRefs  command.PruneRefs  `cmd:"prune-refs" help:"Prune refs by prefix"`
	ScanRefs   command.ScanRefs   `cmd:"scan-refs" help:"Scan references in a local repository"`
	ExpireRefs command.ExpireRefs `cmd:"expire-refs" help:"Clean up expired references"`
	Snapshot   command.Snapshot   `cmd:"snapshot" help:"Create a snapshot commit for the worktree"`
	Az         command.Az         `cmd:"az" help:"Analyze repository large files"`
	Co         command.Co         `cmd:"co" help:"EXPERIMENTAL: Clones a repository into a newly created directory"`
	Diff       command.Diff       `cmd:"diff" help:"Show changes between commits, commit and working tree, etc"`
	Show       command.Show       `cmd:"show" help:"Show the changes introduced by a commit"`
	Debug      bool               `name:"debug" help:"Enable debug mode; analyze timing"`
}

func main() {
	// delay initilaize git env
	_ = env.DelayInitializeEnv()
	// initialize locale
	_ = tr.DelayInitializeLocale()
	kong.BindW(tr.W) // replace W
	var app App
	ctx := kong.Parse(&app,
		kong.NamedMapper("size", command.SizeDecoder()),
		kong.NamedMapper("expire", command.ExpireDecoder()),
		kong.Name("hot"),
		kong.Description(tr.W("hot - Git repositories maintenance tool")),
		kong.UsageOnError(),
		kong.ConfigureHelp(kong.HelpOptions{
			Compact:             true,
			NoExpandSubcommands: true,
		}),
		kong.Vars{
			"version": version.GetVersionString(),
		},
	)
	if app.Verbose {
		trace.EnableDebugMode()
	}
	m := strengthen.NewMeasurer("hot", app.Debug)
	defer m.Close()
	err := ctx.Run(&app.Globals)
	if err != nil {
		os.Exit(1)
	}
}


================================================
FILE: cmd/hot/pkg/README.md
================================================
# hot pkg

================================================
FILE: cmd/hot/pkg/co/co.go
================================================
package co

import (
	"context"
	"fmt"
	"os"
	"slices"
	"strconv"
	"sync"
	"time"

	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/command"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/trace"
)

type CoOptions struct {
	Remote, Destination string
	Branch, Commit      string
	Sparse              []string
	Depth               int
	Limit               int64
	Recursive           bool
	Values              []string
}

var (
	newEnviron = sync.OnceValue(func() []string {
		env := slices.Clone(os.Environ())
		if ua, ok := NewUserAgent(); ok {
			env = append(env, "GIT_USER_AGENT="+ua)
		}
		return env
	})
)

func run(ctx context.Context, repoPath string, cmdArg0 string, args ...string) error {
	now := time.Now()
	cmd := command.NewFromOptions(ctx,
		&command.RunOpts{
			RepoPath:  repoPath,
			Environ:   newEnviron(),
			Stderr:    os.Stderr,
			Stdout:    os.Stdout,
			Stdin:     os.Stdin,
			NoSetpgid: true,
		}, cmdArg0, args...)
	if err := cmd.Run(); err != nil {
		return err
	}
	trace.DbgPrint("exec: %s spent: %v", cmd.String(), time.Since(now))
	return nil
}

func fetch(ctx context.Context, o *CoOptions) error {
	now := time.Now()
	if err := git.NewRepo(ctx, o.Destination, git.ReferenceNameDefault, false, git.HashFormatFromSize(len(o.Commit))); err != nil {
		fmt.Fprintf(os.Stderr, "initialize repository '%s' error: %v\n", o.Destination, err)
		return err
	}
	if err := run(ctx, o.Destination, "git", "config", "index.version", "4"); err != nil {
		fmt.Fprintf(os.Stderr, "config index v4 error: %v\n", err)
		return err
	}
	if err := run(ctx, o.Destination, "git", "remote", "add", "origin", o.Remote); err != nil {
		fmt.Fprintf(os.Stderr, "add remote error: %v\n", err)
		return err
	}
	if len(o.Sparse) != 0 {
		if err := sparseCheckout(ctx, o); err != nil {
			return err
		}
	}
	fetchArgs := make([]string, 0, 10+len(o.Values)*2)
	for _, v := range o.Values {
		fetchArgs = append(fetchArgs, "-c", v)
	}
	fetchArgs = append(fetchArgs, "fetch")
	if o.Depth > 0 && o.Depth < 20 {
		fetchArgs = append(fetchArgs, "--depth="+strconv.Itoa(o.Depth))
	}
	fetchArgs = append(fetchArgs, "origin", o.Commit)
	if err := run(ctx, o.Destination, "git", fetchArgs...); err != nil {
		fmt.Fprintf(os.Stderr, "fetch error: %v", err)
		return err
	}
	// git switch [<options>] [--no-guess] <branch>
	// git switch [<options>] --detach [<start-point>]
	// git switch [<options>] (-c|-C) <new-branch> [<start-point>]
	// git switch [<options>] --orphan <new-branch>
	switchArgs := make([]string, 0, 10)
	switchArgs = append(switchArgs, "switch")
	if len(o.Branch) == 0 {
		switchArgs = append(switchArgs, "--detach", o.Commit)
	} else {
		switchArgs = append(switchArgs, "-c", o.Branch, o.Commit)
	}
	if err := run(ctx, o.Destination, "git", switchArgs...); err != nil {
		fmt.Fprintf(os.Stderr, "switch error: %v", err)
		return err
	}
	if o.Recursive {
		submoduleArgs := make([]string, 0, 5+len(o.Values)*2)
		for _, v := range o.Values {
			submoduleArgs = append(submoduleArgs, "-c", v)
		}
		submoduleArgs = append(submoduleArgs, "submodule", "update", "--init", "--recursive", "--recommend-shallow")
		if err := run(ctx, o.Destination, "git", submoduleArgs...); err != nil {
			fmt.Fprintf(os.Stderr, "switch error: %v", err)
			return err
		}
	}
	_, _ = tr.Fprintf(os.Stderr, "Cloning to '%s' completed, spent: %v.\n", o.Destination, time.Since(now))
	return nil
}

func Co(ctx context.Context, o *CoOptions) error {
	if len(o.Commit) != 0 && !git.IsGitVersionAtLeast(git.NewVersion(2, 50, 0)) {
		return fetch(ctx, o)
	}
	return clone(ctx, o)
}

func sparseCheckout(ctx context.Context, o *CoOptions) error {
	now := time.Now()
	// https://git-scm.com/docs/git-sparse-checkout#Documentation/git-sparse-checkout.txt-emsetem
	cmd := command.NewFromOptions(ctx, &command.RunOpts{
		RepoPath:  o.Destination,
		Environ:   newEnviron(),
		Stderr:    os.Stderr,
		Stdout:    os.Stdout,
		NoSetpgid: true,
	}, "git", "sparse-checkout", "set", "--cone", "--sparse-index", "--stdin")
	stdin, err := cmd.StdinPipe()
	if err != nil {
		fmt.Fprintf(os.Stderr, "initialize sparse checkout error: %v\n", err)
		return err
	}
	if err := cmd.Start(); err != nil {
		fmt.Fprintf(os.Stderr, "initialize sparse checkout error: %v\n", err)
		_ = stdin.Close()
		return err
	}
	// https://git-scm.com/docs/git-sparse-checkout#Documentation/git-sparse-checkout.txt-codegitsparse-checkoutsetMYDIR1SUBDIR2code
	for _, s := range o.Sparse {
		if _, err := stdin.Write([]byte(s + "\n")); err != nil {
			fmt.Fprintf(os.Stderr, "initialize sparse checkout error: %v\n", err)
			_ = stdin.Close()
			_ = cmd.Wait()
			return err
		}
	}
	_ = stdin.Close()
	if err := cmd.Wait(); err != nil {
		fmt.Fprintf(os.Stderr, "initialize sparse checkout error: %v\n", err)
		return err
	}
	trace.DbgPrint("git space-checkout spent: %v", time.Since(now))
	return nil
}

func clone(ctx context.Context, o *CoOptions) error {
	now := time.Now()
	cloneArgs := make([]string, 0, 20+len(o.Values)*2)
	for _, v := range o.Values {
		cloneArgs = append(cloneArgs, "-c", v)
	}
	cloneArgs = append(cloneArgs, "-c", "index.version=4", "-c", "advice.detachedHead=false", "clone")
	switch {
	case len(o.Sparse) != 0 && o.Limit >= 0:
		cloneArgs = append(cloneArgs, "--sparse", fmt.Sprintf("--filter=blob:limit=%d", o.Limit), "--no-checkout")
	case len(o.Sparse) != 0:
		cloneArgs = append(cloneArgs, "--sparse", "--filter=blob:none", "--no-checkout")
	case o.Limit >= 0:
		cloneArgs = append(cloneArgs, fmt.Sprintf("--filter=blob:limit=%d", o.Limit))
	}
	switch {
	case len(o.Commit) != 0:
		cloneArgs = append(cloneArgs, "--revision", o.Commit)
	case len(o.Branch) != 0:
		cloneArgs = append(cloneArgs, "--single-branch", "--branch", o.Branch)
	}
	if o.Depth > 0 && o.Depth < 20 {
		cloneArgs = append(cloneArgs, "--depth="+strconv.Itoa(o.Depth))
	}
	if o.Recursive {
		cloneArgs = append(cloneArgs, "recursive", "--shallow-submodules") // submodule shallow
	}
	cloneArgs = append(cloneArgs, o.Remote, o.Destination)
	cmd := command.NewFromOptions(ctx, &command.RunOpts{
		Environ:   newEnviron(),
		Stderr:    os.Stderr,
		Stdout:    os.Stdout,
		Stdin:     os.Stdin,
		NoSetpgid: true,
	}, "git", cloneArgs...)
	if err := cmd.Run(); err != nil {
		fmt.Fprintf(os.Stderr, "clone error: %v", err)
		return err
	}
	if len(o.Branch) != 0 && len(o.Commit) != 0 {
		if err := run(ctx, o.Destination, "git", "switch", "-c", o.Branch, o.Commit); err != nil {
			fmt.Fprintf(os.Stderr, "switch error: %v", err)
			return err
		}
	}
	trace.DbgPrint("git clone spent: %v", time.Since(now))
	if len(o.Sparse) != 0 {
		if err := sparseCheckout(ctx, o); err != nil {
			return err
		}
		if err := run(ctx, o.Destination, "git", "checkout", "HEAD"); err != nil {
			fmt.Fprintf(os.Stderr, "checkout error: %v\n", err)
			return err
		}
	}
	_, _ = tr.Fprintf(os.Stderr, "Cloning to '%s' completed, spent: %v.\n", o.Destination, time.Since(now))
	return nil
}


================================================
FILE: cmd/hot/pkg/co/misc.go
================================================
package co

import (
	"fmt"

	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/pkg/version"
)

func NewUserAgent() (string, bool) {
	if !version.TelemetryEnabled() {
		return "", false
	}
	u, err := version.Uname()
	if err != nil {
		return "", false
	}
	v, err := git.VersionDetect()
	if err != nil {
		return "", false
	}
	return fmt.Sprintf("git/%s (%s; %s; %s; %s)", v, u.Node, u.Name, u.Machine, u.Release), true
}


================================================
FILE: cmd/hot/pkg/co/misc_test.go
================================================
package co

import (
	"fmt"
	"os"
	"testing"
)

func TestNewUserAgent(t *testing.T) {
	u, ok := NewUserAgent()
	if ok {
		fmt.Fprintf(os.Stderr, "New user-agent: %s\n", u)
	}
}


================================================
FILE: cmd/hot/pkg/diff/diff.go
================================================
// Package diff provides a parser for git diff output.
// It parses the output of: git diff --raw --full-index --find-renames
// Based on gitaly's implementation (MIT License).
package diff

import (
	"bufio"
	"bytes"
	"errors"
	"fmt"
	"io"
	"path/filepath"
	"regexp"
	"strconv"
	"strings"

	"github.com/antgroup/hugescm/modules/diferenco"
	"github.com/antgroup/hugescm/modules/git"
)

// Patch represents a single parsed diff entry, extending diferenco.Patch with git metadata.
type Patch struct {
	*diferenco.Patch
	Status          byte // 'A', 'D', 'M', 'R', 'C', 'T' etc.
	Binary          bool
	OverflowMarker  bool
	Collapsed       bool
	TooLarge        bool
	CollectAllPaths bool
	PatchSize       int32
	LinesAdded      int32
	LinesRemoved    int32
	lineCount       int
	byteCount       int
}

// Reset clears all fields of p in a way that lets the underlying memory be reused.
func (p *Patch) Reset() {
	*p = Patch{Patch: &diferenco.Patch{}}
}

// ClearPatch clears only the patch content.
func (p *Patch) ClearPatch() {
	if p.Patch != nil {
		p.Hunks = nil
	}
}

// Parser holds necessary state for parsing a diff stream.
type Parser struct {
	hashFormat          git.HashFormat
	limits              Limits
	patchReader         *bufio.Reader
	rawLines            [][]byte
	currentPatch        Patch
	nextPatchFromPath   []byte
	unreadLine          []byte
	filesProcessed      int
	scannedLines        int // Total lines scanned (never decreases)
	scannedBytes        int // Total bytes scanned (never decreases)
	finished            bool
	stopPatchCollection bool
	err                 error
}

// Limits holds the limits at which either parsing stops or patches are collapsed.
type Limits struct {
	// EnforceLimits causes parsing to stop if Max{Files,Lines,Bytes} is reached.
	EnforceLimits bool
	// CollapseDiffs causes patches to be emptied after SafeMax{Files,Lines,Bytes} reached.
	CollapseDiffs bool
	// CollectAllPaths parses all diffs but info outside of path may be empty.
	CollectAllPaths bool
	// MaxFiles is the maximum number of files to parse.
	MaxFiles int
	// MaxLines is the maximum number of diff lines to parse.
	MaxLines int
	// MaxBytes is the maximum number of bytes to parse.
	MaxBytes int
	// SafeMaxFiles is the number of files after which subsequent files are collapsed.
	SafeMaxFiles int
	// SafeMaxLines is the number of lines after which subsequent files are collapsed.
	SafeMaxLines int
	// SafeMaxBytes is the number of bytes after which subsequent files are collapsed.
	SafeMaxBytes int
	// MaxPatchBytes is the maximum bytes a single patch can have.
	MaxPatchBytes int
	// MaxPatchBytesForFileExtension overrides MaxPatchBytes for specific file types.
	MaxPatchBytesForFileExtension map[string]int
	// PatchLimitsOnly uses only MaxPatchBytes limits, ignoring cumulative limits.
	PatchLimitsOnly bool
}

const (
	maxFilesUpperBound      = 5000
	maxLinesUpperBound      = 250000
	maxBytesUpperBound      = 5000 * 5120 // 24MB
	safeMaxFilesUpperBound  = 500
	safeMaxLinesUpperBound  = 25000
	safeMaxBytesUpperBound  = 500 * 5120 // 2.4MB
	maxPatchBytesUpperBound = 512000     // 500KB
)

var (
	rawSHA1LineRegexp   = regexp.MustCompile(`(?m)^:(\d+) (\d+) ([[:xdigit:]]{40}) ([[:xdigit:]]{40}) ([ADTUXMRC]\d*)\t(.*?)(?:\t(.*?))?$`)
	rawSHA256LineRegexp = regexp.MustCompile(`(?m)^:(\d+) (\d+) ([[:xdigit:]]{64}) ([[:xdigit:]]{64}) ([ADTUXMRC]\d*)\t(.*?)(?:\t(.*?))?$`)
)

// NewParser returns a new Parser.
func NewParser(hashFormat git.HashFormat, src io.Reader, limits Limits) *Parser {
	limits.enforceUpperBound()

	parser := &Parser{
		hashFormat: hashFormat,
		limits:     limits,
	}
	reader := bufio.NewReader(src)
	parser.cacheRawLines(reader)
	parser.patchReader = reader

	return parser
}

// Parse parses a single diff. It returns true if successful, false if finished or error.
func (parser *Parser) Parse() bool {
	if parser.finished || len(parser.rawLines) == 0 {
		return false
	}

	if err := parser.initializeCurrentPatch(); err != nil {
		return false
	}

	if parser.nextPatchFromPath == nil {
		path, err := parser.readDiffHeaderFromPath()
		if err != nil {
			parser.err = err
			return false
		}
		parser.nextPatchFromPath = path
	}

	if !bytes.Equal(parser.nextPatchFromPath, parser.currentPatchFromPath()) {
		// The current diff has an empty patch
		return true
	}

	parser.nextPatchFromPath = nil

	if err := readNextDiff(parser.patchReader, &parser.currentPatch, parser.stopPatchCollection); err != nil {
		parser.err = err
		return false
	}

	parser.scannedLines += parser.currentPatch.lineCount
	parser.scannedBytes += parser.currentPatch.byteCount

	// Calculate PatchSize from hunks
	parser.currentPatch.PatchSize = int32(parser.currentPatch.byteCount)

	if parser.limits.CollapseDiffs && parser.isOverSafeLimits() && parser.currentPatch.lineCount > 0 {
		parser.prunePatch()
		parser.currentPatch.Collapsed = true
		if parser.limits.CollectAllPaths {
			parser.currentPatch.CollectAllPaths = true
		}
	}

	if parser.limits.EnforceLimits {
		maxPatchBytesExceeded := parser.limits.MaxPatchBytes > 0 && parser.currentPatch.byteCount >= parser.maxPatchBytesForCurrentFile()
		if maxPatchBytesExceeded {
			parser.prunePatch()
			parser.currentPatch.TooLarge = true
		}

		maxFilesExceeded := exceeded(parser.filesProcessed, parser.limits.MaxFiles)
		maxLinesExceeded := exceeded(parser.scannedLines, parser.limits.MaxLines)
		maxBytesExceeded := exceeded(parser.scannedBytes, parser.limits.MaxBytes)
		maxLimitsExceeded := maxLinesExceeded || maxBytesExceeded || maxFilesExceeded
		if maxLimitsExceeded && !parser.limits.PatchLimitsOnly {
			if parser.limits.CollectAllPaths {
				parser.currentPatch.CollectAllPaths = true
				parser.currentPatch.ClearPatch()
				parser.stopPatchCollection = true
			} else {
				parser.finished = true
				parser.currentPatch.Reset()
			}
			parser.currentPatch.OverflowMarker = true
		}
	}

	return true
}

// Patch returns a successfully parsed patch. Valid until next Parse() call.
func (parser *Parser) Patch() *Patch {
	return &parser.currentPatch
}

// Err returns the error encountered during parsing.
func (parser *Parser) Err() error {
	return parser.err
}

func (parser *Parser) currentPatchFromPath() []byte {
	if parser.currentPatch.From != nil {
		return []byte(parser.currentPatch.From.Name)
	}
	if parser.currentPatch.To != nil {
		return []byte(parser.currentPatch.To.Name)
	}
	return nil
}

func (parser *Parser) cacheRawLines(reader *bufio.Reader) {
	for {
		line, err := reader.ReadBytes('\n')
		if err != nil {
			if errors.Is(err, io.EOF) {
				// Handle EOF with data - last line without newline
				if len(line) > 0 {
					if bytes.HasPrefix(line, []byte(":")) {
						parser.rawLines = append(parser.rawLines, line)
					} else {
						parser.unreadLine = line
					}
				}
			} else {
				parser.err = err
				parser.finished = true
			}
			return
		}

		if !bytes.HasPrefix(line, []byte(":")) {
			// Store the non-raw line for later use
			parser.unreadLine = line
			return
		}

		parser.rawLines = append(parser.rawLines, line)
	}
}

func (parser *Parser) nextRawLine() []byte {
	if len(parser.rawLines) == 0 {
		return nil
	}
	line := parser.rawLines[0]
	parser.rawLines = parser.rawLines[1:]
	return line
}

func (parser *Parser) initializeCurrentPatch() error {
	parser.currentPatch.Reset()

	line := parser.nextRawLine()
	if line == nil {
		return nil
	}

	if err := parseRawLine(parser.hashFormat, line, &parser.currentPatch); err != nil {
		parser.err = err
		return err
	}

	if parser.currentPatch.Status == 'T' {
		parser.handleTypeChangeDiff()
	}

	parser.filesProcessed++
	return nil
}

func (parser *Parser) readDiffHeaderFromPath() ([]byte, error) {
	var line []byte
	var err error

	for {
		// Use unread line if available
		if len(parser.unreadLine) > 0 {
			line = parser.unreadLine
			parser.unreadLine = nil
		} else {
			line, err = parser.patchReader.ReadBytes('\n')
			if err != nil {
				if errors.Is(err, io.EOF) {
					// Handle EOF with data - last line without newline
					if len(line) > 0 {
						// Process the last line
					} else {
						return nil, nil
					}
				} else {
					return nil, fmt.Errorf("read diff header line: %w", err)
				}
			}
		}

		// Skip empty lines
		if len(bytes.TrimSpace(line)) == 0 {
			continue
		}

		// Skip non-diff-header lines (index, ---, +++, new file mode, deleted file mode, etc.)
		if bytes.HasPrefix(line, []byte("index ")) ||
			bytes.HasPrefix(line, []byte("---")) ||
			bytes.HasPrefix(line, []byte("+++")) ||
			bytes.HasPrefix(line, []byte("new file mode ")) ||
			bytes.HasPrefix(line, []byte("deleted file mode ")) ||
			bytes.HasPrefix(line, []byte("old mode ")) ||
			bytes.HasPrefix(line, []byte("new mode ")) ||
			bytes.HasPrefix(line, []byte("similarity index ")) ||
			bytes.HasPrefix(line, []byte("copy from ")) ||
			bytes.HasPrefix(line, []byte("copy to ")) ||
			bytes.HasPrefix(line, []byte("rename from ")) ||
			bytes.HasPrefix(line, []byte("rename to ")) {
			continue
		}

		// Hand-parse diff --git header instead of regex
		path, err := parseDiffHeaderPath(line)
		if err != nil {
			return nil, err
		}
		return path, nil
	}
}

// parseDiffHeaderPath hand-parses "diff --git a/path b/path" to extract the from-path
// This function properly handles quoted paths with escape sequences
func parseDiffHeaderPath(line []byte) ([]byte, error) {
	// Must start with "diff --git "
	if !bytes.HasPrefix(line, []byte("diff --git ")) {
		return nil, fmt.Errorf("not a diff --git header: %q", line)
	}

	line = line[11:] // Skip "diff --git "

	// Parse two paths: "a/path" "b/path" or "a/path" b/path or a/path b/path
	paths, err := parseTwoPaths(line)
	if err != nil {
		return nil, err
	}

	if len(paths) != 2 {
		return nil, fmt.Errorf("expected 2 paths in diff header, got %d", len(paths))
	}

	// Extract first path (from-path)
	path1 := paths[0]

	// Verify it starts with "a/"
	if !bytes.HasPrefix(path1, []byte("a/")) {
		return nil, fmt.Errorf("first path must start with a/: %q", path1)
	}

	// Verify second path starts with "b/"
	if len(paths) > 1 && !bytes.HasPrefix(paths[1], []byte("b/")) {
		return nil, fmt.Errorf("second path must start with b/: %q", paths[1])
	}

	// Strip "a/" prefix and unescape
	path := path1[2:]
	return unescape(path), nil
}

// parseTwoPaths parses two paths from a diff header line
// Handles both quoted and unquoted paths
func parseTwoPaths(line []byte) ([][]byte, error) {
	var paths [][]byte

	for len(line) > 0 && len(paths) < 2 {
		// Skip leading whitespace
		line = bytes.TrimSpace(line)
		if len(line) == 0 {
			break
		}

		var path []byte
		var err error

		if line[0] == '"' {
			// Quoted path: find matching quote handling escape sequences
			path, line, err = parseQuotedPath(line)
			if err != nil {
				return nil, err
			}
			// Unquote after extracting the path
			path = unquoteBytes(path)
		} else {
			// Unquoted path: find next whitespace or end
			path, line = parseUnquotedPath(line)
		}

		if len(path) > 0 {
			paths = append(paths, path)
		}
	}

	return paths, nil
}

// parseQuotedPath parses a quoted path, handling escape sequences
func parseQuotedPath(line []byte) ([]byte, []byte, error) {
	if len(line) == 0 || line[0] != '"' {
		return nil, line, fmt.Errorf("expected quoted path")
	}

	// Find matching quote, handling escape sequences
	i := 1
	for i < len(line) {
		if line[i] == '\\' && i+1 < len(line) {
			// Skip escaped character (handles \", \\, and other escapes)
			i += 2
			continue
		}
		if line[i] == '"' {
			// Found matching quote
			path := line[:i+1]
			remaining := line[i+1:]
			return path, remaining, nil
		}
		i++
	}

	return nil, line, fmt.Errorf("unclosed quote in path: %q", line)
}

// parseUnquotedPath parses an unquoted path up to next whitespace
func parseUnquotedPath(line []byte) ([]byte, []byte) {
	i := 0
	for i < len(line) && line[i] != ' ' && line[i] != '\t' {
		i++
	}
	return line[:i], line[i:]
}

func (parser *Parser) handleTypeChangeDiff() {
	// Type change: split into deletion + addition
	// Use To.Name for synthetic add path, not From.Name
	newRawLine := fmt.Sprintf(
		":%o %o %s %s A\t%s\n",
		0,
		parser.currentPatch.To.Mode,
		parser.hashFormat.ZeroOID(),
		parser.currentPatch.To.Hash,
		parser.currentPatch.To.Name,
	)

	parser.currentPatch.From = &diferenco.File{
		Name: parser.currentPatch.From.Name,
		Hash: parser.currentPatch.From.Hash,
		Mode: 0,
	}
	parser.currentPatch.To = nil

	parser.rawLines = append([][]byte{[]byte(newRawLine)}, parser.rawLines...)
}

func parseRawLine(hashFormat git.HashFormat, line []byte, patch *Patch) error {
	var re *regexp.Regexp
	switch hashFormat {
	case git.HashSHA1:
		re = rawSHA1LineRegexp
	case git.HashSHA256:
		re = rawSHA256LineRegexp
	default:
		return fmt.Errorf("cannot parse raw diff line with unknown hash format %q", hashFormat)
	}

	matches := re.FindSubmatch(line)
	if len(matches) == 0 {
		return fmt.Errorf("raw line regexp mismatch")
	}

	oldMode, err := strconv.ParseInt(string(matches[1]), 8, 32)
	if err != nil {
		return fmt.Errorf("parse old mode: %w", err)
	}

	newMode, err := strconv.ParseInt(string(matches[2]), 8, 32)
	if err != nil {
		return fmt.Errorf("parse new mode: %w", err)
	}

	oldOID := string(matches[3])
	newOID := string(matches[4])
	status := matches[5][0]

	fromPath := unescape(unquoteBytes(matches[6]))
	var toPath []byte

	if status == 'C' || status == 'R' {
		if len(matches) < 8 || len(matches[7]) == 0 {
			return fmt.Errorf("raw line missing target path for status %c", status)
		}
		toPath = unescape(unquoteBytes(matches[7]))
	} else {
		toPath = fromPath
	}

	// Build From file info
	if oldOID != hashFormat.ZeroOID() {
		patch.From = &diferenco.File{
			Name: string(fromPath),
			Hash: oldOID,
			Mode: uint32(oldMode),
		}
	}

	// Build To file info
	if newOID != hashFormat.ZeroOID() {
		patch.To = &diferenco.File{
			Name: string(toPath),
			Hash: newOID,
			Mode: uint32(newMode),
		}
	}

	patch.Status = status
	return nil
}

func readNextDiff(reader *bufio.Reader, patch *Patch, skipPatch bool) error {
	var patchLines []string
	for currentPatchDone := false; !currentPatchDone || reader.Buffered() > 0; {
		line, err := reader.Peek(10)
		if errors.Is(err, io.EOF) {
			currentPatchDone = true
		} else if err != nil {
			return fmt.Errorf("peek diff line: %w", err)
		}

		switch {
		case bytes.HasPrefix(line, []byte("diff --git")):
			// Parse hunks before returning
			if !skipPatch && len(patchLines) > 0 {
				hunks, err := parseHunks(patchLines)
				if err != nil {
					return err
				}
				patch.Hunks = hunks
			}
			return nil
		case bytes.HasPrefix(line, []byte("---")) || bytes.HasPrefix(line, []byte("+++")):
			if len(patchLines) == 0 {
				if err := discardLine(reader); err != nil {
					return err
				}
				continue
			}
		case bytes.HasPrefix(line, []byte("@@")):
			if err := consumeChunkLine(reader, patch, skipPatch, false, &patchLines); err != nil {
				return err
			}
		case bytes.HasPrefix(line, []byte("Binary")):
			patch.Binary = true
			patch.IsBinary = true
			fallthrough
		case bytes.HasPrefix(line, []byte("-")) ||
			bytes.HasPrefix(line, []byte("+")) ||
			bytes.HasPrefix(line, []byte(" ")) ||
			bytes.HasPrefix(line, []byte("\\")) ||
			bytes.HasPrefix(line, []byte("~\n")):
			if err := consumeChunkLine(reader, patch, skipPatch, true, &patchLines); err != nil {
				return err
			}
		default:
			if err := discardLine(reader); err != nil {
				return err
			}
		}
	}

	// Parse hunks for the last patch
	if !skipPatch && len(patchLines) > 0 {
		hunks, err := parseHunks(patchLines)
		if err != nil {
			return err
		}
		patch.Hunks = hunks
	}
	return nil
}

func consumeChunkLine(reader *bufio.Reader, patch *Patch, skipPatch, updateStats bool, patchLines *[]string) error {
	var byteCount int
	for done := false; !done; {
		line, err := reader.ReadSlice('\n')
		if updateStats && byteCount == 0 && len(line) > 0 {
			switch line[0] {
			case '+':
				patch.LinesAdded++
			case '-':
				patch.LinesRemoved++
			}
		}
		byteCount += len(line)

		switch {
		case errors.Is(err, bufio.ErrBufferFull):
			// long line: keep reading
		case err != nil && !errors.Is(err, io.EOF):
			return fmt.Errorf("read chunk line: %w", err)
		default:
			done = true
		}

		if !skipPatch {
			*patchLines = append(*patchLines, string(line))
		}
	}

	if updateStats {
		patch.byteCount += byteCount
		patch.lineCount++
	}
	return nil
}

func discardLine(reader *bufio.Reader) error {
	_, err := reader.ReadBytes('\n')
	if err != nil && !errors.Is(err, io.EOF) {
		return fmt.Errorf("read line: %w", err)
	}
	return nil
}

func (limit *Limits) enforceUpperBound() {
	limit.MaxFiles = min(limit.MaxFiles, maxFilesUpperBound)
	limit.MaxLines = min(limit.MaxLines, maxLinesUpperBound)
	limit.MaxBytes = min(limit.MaxBytes, maxBytesUpperBound)
	limit.SafeMaxFiles = min(limit.SafeMaxFiles, safeMaxFilesUpperBound)
	limit.SafeMaxLines = min(limit.SafeMaxLines, safeMaxLinesUpperBound)
	limit.SafeMaxBytes = min(limit.SafeMaxBytes, safeMaxBytesUpperBound)
	limit.MaxPatchBytes = min(limit.MaxPatchBytes, maxPatchBytesUpperBound)
}

func (parser *Parser) prunePatch() {
	// Only clear patch content, do NOT decrease scannedLines/scannedBytes
	// Cumulative limits track what was actually read, not what is kept
	parser.currentPatch.ClearPatch()
}

// exceeded returns true if current > limit and limit > 0.
// A limit of 0 means "no limit", so it never triggers exceeded.
func exceeded(current, limit int) bool {
	return limit > 0 && current > limit
}

func (parser *Parser) isOverSafeLimits() bool {
	return exceeded(parser.filesProcessed, parser.limits.SafeMaxFiles) ||
		exceeded(parser.scannedLines, parser.limits.SafeMaxLines) ||
		exceeded(parser.scannedBytes, parser.limits.SafeMaxBytes)
}

func (parser *Parser) maxPatchBytesForCurrentFile() int {
	if len(parser.limits.MaxPatchBytesForFileExtension) > 0 {
		var toPath string
		if parser.currentPatch.To != nil {
			toPath = parser.currentPatch.To.Name
		} else if parser.currentPatch.From != nil {
			toPath = parser.currentPatch.From.Name
		}

		if toPath != "" {
			fileName := filepath.Base(toPath)
			key := filepath.Ext(fileName)
			if key == "" {
				key = fileName
			}
			if limit, ok := parser.limits.MaxPatchBytesForFileExtension[key]; ok {
				return limit
			}
		}
	}
	return parser.limits.MaxPatchBytes
}

// unescape unescapes the escape codes used by 'git diff'.
func unescape(s []byte) []byte {
	var unescaped []byte

	for i := 0; i < len(s); i++ {
		if s[i] == '\\' {
			if i+3 < len(s) && isOctalDigit(s[i+1]) && isOctalDigit(s[i+2]) && isOctalDigit(s[i+3]) {
				octalByte, err := strconv.ParseUint(string(s[i+1:i+4]), 8, 8)
				if err == nil {
					unescaped = append(unescaped, byte(octalByte))
					i += 3
					continue
				}
			}

			if i+1 < len(s) {
				var unescapedByte byte

				switch s[i+1] {
				case '"', '\\', '/', '\'':
					unescapedByte = s[i+1]
				case 'a':
					unescapedByte = '\a'
				case 'b':
					unescapedByte = '\b'
				case 'f':
					unescapedByte = '\f'
				case 'n':
					unescapedByte = '\n'
				case 'r':
					unescapedByte = '\r'
				case 't':
					unescapedByte = '\t'
				case 'v':
					unescapedByte = '\v'
				default:
					unescaped = append(unescaped, '\\')
					unescapedByte = s[i+1]
				}

				unescaped = append(unescaped, unescapedByte)
				i++
				continue
			}
		}

		unescaped = append(unescaped, s[i])
	}

	return unescaped
}

func isOctalDigit(b byte) bool {
	return b >= '0' && b <= '7'
}

// unquoteBytes removes surrounding quotes from a byte slice
func unquoteBytes(s []byte) []byte {
	if len(s) >= 2 && s[0] == '"' && s[len(s)-1] == '"' {
		s = s[1 : len(s)-1]
	}
	return s
}

// parseHunks parses collected patch lines into diferenco.Hunk structures.
func parseHunks(lines []string) ([]*diferenco.Hunk, error) {
	if len(lines) == 0 {
		return nil, nil
	}

	var hunks []*diferenco.Hunk
	var currentHunk *diferenco.Hunk

	for _, line := range lines {
		if strings.HasPrefix(line, "@@") {
			if currentHunk != nil {
				hunks = append(hunks, currentHunk)
			}

			fromLine, fromCount, toLine, toCount, section, err := parseHunkHeader(line)
			if err != nil {
				return nil, err
			}

			currentHunk = &diferenco.Hunk{
				FromLine: fromLine,
				ToLine:   toLine,
				Section:  section,
			}
			_ = fromCount // Reserved for future validation
			_ = toCount   // Reserved for future validation
			continue
		}

		if currentHunk == nil || len(line) == 0 {
			continue
		}

		// Skip "\ No newline at end of file" marker - it's metadata, not content
		if strings.HasPrefix(line, "\\ No newline at end of file") {
			continue
		}

		var kind diferenco.Operation
		switch line[0] {
		case '+':
			kind = diferenco.Insert
		case '-':
			kind = diferenco.Delete
		case ' ':
			kind = diferenco.Equal
		default:
			continue
		}

		currentHunk.Lines = append(currentHunk.Lines, diferenco.Line{
			Kind:    kind,
			Content: line[1:],
		})
	}

	if currentHunk != nil {
		hunks = append(hunks, currentHunk)
	}

	return hunks, nil
}

// parseHunkHeader parses a hunk header line.
// Format: @@ -start,count +start,count @@ section
func parseHunkHeader(header string) (fromLine, fromCount, toLine, toCount int, section string, err error) {
	if !strings.HasPrefix(header, "@@ ") {
		return 0, 0, 0, 0, "", fmt.Errorf("malformed hunk header: %q", header)
	}

	rest := strings.TrimPrefix(header, "@@ ")
	before, after, ok := strings.Cut(rest, " @@")
	if !ok {
		return 0, 0, 0, 0, "", fmt.Errorf("malformed hunk header: %q", header)
	}

	body := before
	remain := after // skip " @@"
	if len(remain) > 0 && remain[0] == ' ' {
		section = strings.TrimRight(remain[1:], "\r\n")
	}

	fields := strings.Fields(body)
	if len(fields) != 2 {
		return 0, 0, 0, 0, "", fmt.Errorf("malformed hunk header: %q", header)
	}
	if !strings.HasPrefix(fields[0], "-") || !strings.HasPrefix(fields[1], "+") {
		return 0, 0, 0, 0, "", fmt.Errorf("malformed hunk header: %q", header)
	}

	fromLine, fromCount, err = parseRange(fields[0], '-')
	if err != nil {
		return 0, 0, 0, 0, "", fmt.Errorf("malformed hunk header: %q", header)
	}
	toLine, toCount, err = parseRange(fields[1], '+')
	if err != nil {
		return 0, 0, 0, 0, "", fmt.Errorf("malformed hunk header: %q", header)
	}

	return fromLine, fromCount, toLine, toCount, section, nil
}

// parseRange parses a line range specification.
// Format: -start,count or +start,count or -start or +start
func parseRange(s string, prefix byte) (start, count int, err error) {
	if len(s) < 2 || s[0] != prefix {
		return 0, 0, fmt.Errorf("invalid range: %q", s)
	}
	s = s[1:]

	before, after, ok := strings.Cut(s, ",")
	if !ok {
		start, err = strconv.Atoi(s)
		if err != nil {
			return 0, 0, err
		}
		return start, 1, nil
	}

	start, err = strconv.Atoi(before)
	if err != nil {
		return 0, 0, err
	}
	count, err = strconv.Atoi(after)
	if err != nil {
		return 0, 0, err
	}
	if count < 0 {
		return 0, 0, fmt.Errorf("invalid count: %d", count)
	}
	return start, count, nil
}


================================================
FILE: cmd/hot/pkg/diff/parser_test.go
================================================
package diff

import (
	"bytes"
	"fmt"
	"strings"
	"testing"

	"github.com/antgroup/hugescm/modules/git"
)

// rawLine generates a raw diff line with proper tab character
func rawLine(oldMode, newMode int, oldOID, newOID, status, path string) string {
	return fmt.Sprintf(":%06o %06o %s %s %s\t%s\n", oldMode, newMode, oldOID, newOID, status, path)
}

// rawLineRename generates a raw diff line for rename/copy with from and to paths
func rawLineRename(oldMode, newMode int, oldOID, newOID, status, fromPath, toPath string) string {
	return fmt.Sprintf(":%06o %06o %s %s %s\t%s\t%s\n", oldMode, newMode, oldOID, newOID, status, fromPath, toPath)
}

var sha1ZeroOID = "0000000000000000000000000000000000000000"

func TestParserBasic(t *testing.T) {
	input := rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", "main.go") +
		"diff --git a/main.go b/main.go\n" +
		"index abcdef12..12345678 100644\n" +
		"--- a/main.go\n" +
		"+++ b/main.go\n" +
		"@@ -1,3 +1,4 @@\n" +
		" package main\n" +
		"+import \"fmt\"\n" +
		" func main() {}\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	count := 0
	for parser.Parse() {
		patch := parser.Patch()
		count++
		t.Logf("Patch %d: status=%c, from=%v, to=%v, hunks=%d, binary=%v",
			count, patch.Status, patch.From, patch.To, len(patch.Hunks), patch.Binary)
	}

	if err := parser.Err(); err != nil {
		t.Fatalf("parser error: %v", err)
	}

	if count != 1 {
		t.Errorf("expected 1 patch, got %d", count)
	}
}

func TestParserModify(t *testing.T) {
	input := rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", "main.go") +
		"diff --git a/main.go b/main.go\n" +
		"--- a/main.go\n" +
		"+++ b/main.go\n" +
		"@@ -1,3 +1,4 @@\n" +
		" package main\n" +
		"+import \"fmt\"\n" +
		" func main() {}\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	if !parser.Parse() {
		if err := parser.Err(); err != nil {
			t.Fatalf("expected to parse one patch, error: %v", err)
		}
		t.Fatal("expected to parse one patch")
	}

	patch := parser.Patch()
	if patch.Status != 'M' {
		t.Errorf("expected status M, got %c", patch.Status)
	}

	if patch.From == nil || patch.From.Name != "main.go" {
		t.Errorf("expected from file 'main.go', got %v", patch.From)
	}

	if patch.To == nil || patch.To.Name != "main.go" {
		t.Errorf("expected to file 'main.go', got %v", patch.To)
	}

	if len(patch.Hunks) == 0 {
		t.Error("expected hunks to be parsed")
	}
}

func TestParserAdd(t *testing.T) {
	input := rawLine(0, 0100644, sha1ZeroOID, "1234567890abcdef1234567890abcdef12345678", "A", "new.go") +
		"diff --git a/new.go b/new.go\n" +
		"--- /dev/null\n" +
		"+++ b/new.go\n" +
		"@@ -0,0 +1,2 @@\n" +
		"+package main\n" +
		"+func newFunc() {}\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	if !parser.Parse() {
		if err := parser.Err(); err != nil {
			t.Fatalf("expected to parse one patch, error: %v", err)
		}
		t.Fatal("expected to parse one patch")
	}

	patch := parser.Patch()
	if patch.Status != 'A' {
		t.Errorf("expected status A, got %c", patch.Status)
	}

	if patch.From != nil {
		t.Errorf("expected from file to be nil for new file, got %v", patch.From)
	}

	if patch.To == nil || patch.To.Name != "new.go" {
		t.Errorf("expected to file 'new.go', got %v", patch.To)
	}
}

func TestParserDelete(t *testing.T) {
	input := rawLine(0100644, 0, "abcdef1234567890abcdef1234567890abcdef12", sha1ZeroOID, "D", "old.go") +
		"diff --git a/old.go b/old.go\n" +
		"--- a/old.go\n" +
		"+++ /dev/null\n" +
		"@@ -1,2 +0,0 @@\n" +
		"-package main\n" +
		"-func oldFunc() {}\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	if !parser.Parse() {
		if err := parser.Err(); err != nil {
			t.Fatalf("expected to parse one patch, error: %v", err)
		}
		t.Fatal("expected to parse one patch")
	}

	patch := parser.Patch()
	if patch.Status != 'D' {
		t.Errorf("expected status D, got %c", patch.Status)
	}

	if patch.From == nil || patch.From.Name != "old.go" {
		t.Errorf("expected from file 'old.go', got %v", patch.From)
	}

	if patch.To != nil {
		t.Errorf("expected to file to be nil for deleted file, got %v", patch.To)
	}
}

func TestParserBinary(t *testing.T) {
	input := rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", "image.png") +
		"diff --git a/image.png b/image.png\n" +
		"Binary files a/image.png and b/image.png differ\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	if !parser.Parse() {
		if err := parser.Err(); err != nil {
			t.Fatalf("expected to parse one patch, error: %v", err)
		}
		t.Fatal("expected to parse one patch")
	}

	patch := parser.Patch()
	if !patch.Binary {
		t.Error("expected binary flag to be true")
	}

	if !patch.IsBinary {
		t.Error("expected IsBinary to be true")
	}
}

func TestParserLimits(t *testing.T) {
	input := rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", "file1.go") +
		"diff --git a/file1.go b/file1.go\n" +
		"--- a/file1.go\n" +
		"+++ b/file1.go\n" +
		"@@ -1 +1 @@\n" +
		"-old\n" +
		"+new\n" +
		rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", "file2.go") +
		"diff --git a/file2.go b/file2.go\n" +
		"--- a/file2.go\n" +
		"+++ b/file2.go\n" +
		"@@ -1 +1 @@\n" +
		"-old\n" +
		"+new\n"

	limits := Limits{
		EnforceLimits: true,
		MaxFiles:      1,
	}
	parser := NewParser(git.HashSHA1, strings.NewReader(input), limits)

	count := 0
	for parser.Parse() {
		count++
	}

	if count > 2 {
		t.Errorf("expected at most 2 patches with limit, got %d", count)
	}
}

func TestParseHunks(t *testing.T) {
	lines := []string{
		"--- a/main.go\n",
		"+++ b/main.go\n",
		"@@ -1,5 +1,6 @@\n",
		" package main\n",
		"\n",
		"+import \"fmt\"\n",
		" func main() {\n",
		"-	println(\"hello\")\n",
		"+	fmt.Println(\"hello world\")\n",
		" }\n",
	}

	hunks, err := parseHunks(lines)
	if err != nil {
		t.Fatalf("parseHunks error: %v", err)
	}

	if len(hunks) != 1 {
		t.Fatalf("expected 1 hunk, got %d", len(hunks))
	}

	hunk := hunks[0]
	if hunk.FromLine != 1 {
		t.Errorf("expected FromLine=1, got %d", hunk.FromLine)
	}

	if hunk.ToLine != 1 {
		t.Errorf("expected ToLine=1, got %d", hunk.ToLine)
	}

	if len(hunk.Lines) == 0 {
		t.Fatal("expected hunk to have lines")
	}

	var added, removed int
	for _, line := range hunk.Lines {
		switch line.Kind {
		case 1: // Insert
			added++
		case -1: // Delete
			removed++
		}
	}

	if added != 2 {
		t.Errorf("expected 2 added lines, got %d", added)
	}

	if removed != 1 {
		t.Errorf("expected 1 removed line, got %d", removed)
	}
}

func TestParseHunksWithSection(t *testing.T) {
	lines := []string{
		"@@ -1,3 +1,4 @@ function main() {\n",
		" package main\n",
		"+import \"fmt\"\n",
		" func main() {}\n",
	}

	hunks, err := parseHunks(lines)
	if err != nil {
		t.Fatalf("parseHunks error: %v", err)
	}

	if len(hunks) != 1 {
		t.Fatalf("expected 1 hunk, got %d", len(hunks))
	}

	hunk := hunks[0]
	if hunk.Section != "function main() {" {
		t.Errorf("expected Section='function main() {', got %q", hunk.Section)
	}

	if hunk.FromLine != 1 {
		t.Errorf("expected FromLine=1, got %d", hunk.FromLine)
	}

	if hunk.ToLine != 1 {
		t.Errorf("expected ToLine=1, got %d", hunk.ToLine)
	}
}

func TestParseHunksWithEmptySection(t *testing.T) {
	lines := []string{
		"@@ -1,3 +1,4 @@\n",
		" package main\n",
		"+import \"fmt\"\n",
		" func main() {}\n",
	}

	hunks, err := parseHunks(lines)
	if err != nil {
		t.Fatalf("parseHunks error: %v", err)
	}

	if len(hunks) != 1 {
		t.Fatalf("expected 1 hunk, got %d", len(hunks))
	}

	hunk := hunks[0]
	if hunk.Section != "" {
		t.Errorf("expected empty Section, got %q", hunk.Section)
	}
}

func TestUnescape(t *testing.T) {
	tests := []struct {
		input  string
		expect string
	}{
		{"simple.txt", "simple.txt"},
		{"file\\040with\\040spaces.txt", "file with spaces.txt"},
		{"file\\twith\\ttabs.txt", "file\twith\ttabs.txt"},
		{"file\\nwith\\nnewline.txt", "file\nwith\nnewline.txt"},
		{"file\\\"quotes\\\".txt", "file\"quotes\".txt"},
		{"file\\\\backslash.txt", "file\\backslash.txt"},
	}

	for _, tt := range tests {
		t.Run(tt.input, func(t *testing.T) {
			result := unescape([]byte(tt.input))
			if string(result) != tt.expect {
				t.Errorf("unescape(%q) = %q, want %q", tt.input, result, tt.expect)
			}
		})
	}
}

func TestLimitsEnforceUpperBound(t *testing.T) {
	limits := Limits{
		MaxFiles:      10000,
		MaxLines:      500000,
		MaxBytes:      100 * 1024 * 1024,
		SafeMaxFiles:  1000,
		SafeMaxLines:  50000,
		SafeMaxBytes:  10 * 1024 * 1024,
		MaxPatchBytes: 1024 * 1024,
	}
	limits.enforceUpperBound()

	if limits.MaxFiles > maxFilesUpperBound {
		t.Errorf("MaxFiles should be <= %d, got %d", maxFilesUpperBound, limits.MaxFiles)
	}
}

// TestParserConsecutiveEmptyPatches tests consecutive files with mode changes only (no diff content)
func TestParserConsecutiveEmptyPatches(t *testing.T) {
	// Two files with only mode changes - no actual diff content
	input := rawLine(0100644, 0100755, "abcdef1234567890abcdef1234567890abcdef12", "abcdef1234567890abcdef1234567890abcdef12", "M", "script.sh") +
		rawLine(0100644, 0100755, "1234567890abcdef1234567890abcdef12345678", "1234567890abcdef1234567890abcdef12345678", "M", "tool.sh")

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	count := 0
	for parser.Parse() {
		patch := parser.Patch()
		count++
		path := "<nil>"
		if patch.From != nil {
			path = patch.From.Name
		} else if patch.To != nil {
			path = patch.To.Name
		}
		t.Logf("Patch %d: status=%c, path=%s, binary=%v, hunks=%d",
			count, patch.Status, path, patch.Binary, len(patch.Hunks))

		// Mode-only changes should have no hunks
		if len(patch.Hunks) > 0 {
			t.Errorf("patch %d: expected no hunks for mode-only change, got %d", count, len(patch.Hunks))
		}
	}

	if err := parser.Err(); err != nil {
		t.Fatalf("parser error: %v", err)
	}

	if count != 2 {
		t.Errorf("expected 2 patches for mode-only changes, got %d", count)
	}
}

// TestParserQuotedPaths tests handling of paths with special characters
func TestParserQuotedPaths(t *testing.T) {
	// Paths with spaces and special characters are quoted in git diff
	input := rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", "file with spaces.go") +
		"diff --git \"a/file with spaces.go\" \"b/file with spaces.go\"\n" +
		"index abcdef12..12345678 100644\n" +
		"--- \"a/file with spaces.go\"\n" +
		"+++ \"b/file with spaces.go\"\n" +
		"@@ -1 +1 @@\n" +
		"-old\n" +
		"+new\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	if !parser.Parse() {
		if err := parser.Err(); err != nil {
			t.Fatalf("expected to parse one patch, error: %v", err)
		}
		t.Fatal("expected to parse one patch")
	}

	patch := parser.Patch()
	if patch.Status != 'M' {
		t.Errorf("expected status M, got %c", patch.Status)
	}

	// Path should be correctly extracted (unquoted)
	if patch.From == nil || patch.From.Name != "file with spaces.go" {
		t.Errorf("expected from file 'file with spaces.go', got %v", patch.From)
	}

	if patch.To == nil || patch.To.Name != "file with spaces.go" {
		t.Errorf("expected to file 'file with spaces.go', got %v", patch.To)
	}

	t.Logf("Quoted path parsed: %s", patch.To.Name)
}

// TestParserQuotedPathsWithEscapes tests handling of quoted paths with escape sequences
func TestParserQuotedPathsWithEscapes(t *testing.T) {
	tests := []struct {
		name     string
		input    string
		fromPath string
		toPath   string
	}{
		{
			name: "quoted path with spaces",
			input: rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", "foo bar.go") +
				"diff --git \"a/foo bar.go\" \"b/foo bar.go\"\n" +
				"index abcdef12..12345678 100644\n" +
				"--- \"a/foo bar.go\"\n" +
				"+++ \"b/foo bar.go\"\n" +
				"@@ -1 +1 @@\n" +
				"-old\n" +
				"+new\n",
			fromPath: "foo bar.go",
			toPath:   "foo bar.go",
		},
		{
			name: "quoted path with octal escape",
			input: rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", "foo bar.go") +
				"diff --git \"a/foo\\040bar.go\" \"b/foo\\040bar.go\"\n" +
				"index abcdef12..12345678 100644\n" +
				"--- \"a/foo\\040bar.go\"\n" +
				"+++ \"b/foo\\040bar.go\"\n" +
				"@@ -1 +1 @@\n" +
				"-old\n" +
				"+new\n",
			fromPath: "foo bar.go",
			toPath:   "foo bar.go",
		},
		{
			name: "quoted path with escaped quote",
			input: rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", "foo\"bar.go") +
				"diff --git \"a/foo\\\"bar.go\" \"b/foo\\\"bar.go\"\n" +
				"index abcdef12..12345678 100644\n" +
				"--- \"a/foo\\\"bar.go\"\n" +
				"+++ \"b/foo\\\"bar.go\"\n" +
				"@@ -1 +1 @@\n" +
				"-old\n" +
				"+new\n",
			fromPath: "foo\"bar.go",
			toPath:   "foo\"bar.go",
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			parser := NewParser(git.HashSHA1, strings.NewReader(tt.input), Limits{})

			if !parser.Parse() {
				if err := parser.Err(); err != nil {
					t.Fatalf("expected to parse one patch, error: %v", err)
				}
				t.Fatal("expected to parse one patch")
			}

			patch := parser.Patch()
			if patch.From == nil || patch.From.Name != tt.fromPath {
				t.Errorf("expected from file %q, got %v", tt.fromPath, patch.From)
			}
			if patch.To == nil || patch.To.Name != tt.toPath {
				t.Errorf("expected to file %q, got %v", tt.toPath, patch.To)
			}
			t.Logf("Parsed quoted path with escapes: %s -> %s", patch.From.Name, patch.To.Name)
		})
	}
}

// TestParserRenameWithPatch tests rename operations with content changes
func TestParserRenameWithPatch(t *testing.T) {
	// Rename with content modification - R100 means 100% similarity
	input := rawLineRename(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "R100", "old.go", "new.go") +
		"diff --git a/old.go b/new.go\n" +
		"similarity index 100%\n" +
		"rename from old.go\n" +
		"rename to new.go\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	if !parser.Parse() {
		if err := parser.Err(); err != nil {
			t.Fatalf("expected to parse one patch, error: %v", err)
		}
		t.Fatal("expected to parse one patch")
	}

	patch := parser.Patch()
	if patch.Status != 'R' {
		t.Errorf("expected status R, got %c", patch.Status)
	}

	if patch.From == nil || patch.From.Name != "old.go" {
		t.Errorf("expected from file 'old.go', got %v", patch.From)
	}

	if patch.To == nil || patch.To.Name != "new.go" {
		t.Errorf("expected to file 'new.go', got %v", patch.To)
	}

	t.Logf("Rename: %s -> %s, similarity=100%%", patch.From.Name, patch.To.Name)
}

// TestParserCopyWithPatch tests copy operations
func TestParserCopyWithPatch(t *testing.T) {
	input := rawLineRename(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "C100", "original.go", "copy.go") +
		"diff --git a/original.go b/copy.go\n" +
		"similarity index 100%\n" +
		"copy from original.go\n" +
		"copy to copy.go\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	if !parser.Parse() {
		if err := parser.Err(); err != nil {
			t.Fatalf("expected to parse one patch, error: %v", err)
		}
		t.Fatal("expected to parse one patch")
	}

	patch := parser.Patch()
	if patch.Status != 'C' {
		t.Errorf("expected status C, got %c", patch.Status)
	}

	if patch.From == nil || patch.From.Name != "original.go" {
		t.Errorf("expected from file 'original.go', got %v", patch.From)
	}

	if patch.To == nil || patch.To.Name != "copy.go" {
		t.Errorf("expected to file 'copy.go', got %v", patch.To)
	}

	t.Logf("Copy: %s -> %s, similarity=100%%", patch.From.Name, patch.To.Name)
}

// TestParserNoNewlineAtEOF tests handling of files without newline at end
func TestParserNoNewlineAtEOF(t *testing.T) {
	input := rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", "file.go") +
		"diff --git a/file.go b/file.go\n" +
		"--- a/file.go\n" +
		"+++ b/file.go\n" +
		"@@ -1,2 +1,2 @@\n" +
		" line1\n" +
		"-line2\n" +
		"\\ No newline at end of file\n" +
		"+line2new\n" +
		"\\ No newline at end of file\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	if !parser.Parse() {
		if err := parser.Err(); err != nil {
			t.Fatalf("expected to parse one patch, error: %v", err)
		}
		t.Fatal("expected to parse one patch")
	}

	patch := parser.Patch()
	if len(patch.Hunks) == 0 {
		t.Fatal("expected hunks to be parsed")
	}

	// The "No newline at end of file" marker should not create extra lines
	hunk := patch.Hunks[0]
	var deleteCount, insertCount int
	for _, line := range hunk.Lines {
		if line.Kind == -1 {
			deleteCount++
			continue
		}
		if line.Kind == 1 {
			insertCount++
		}
	}

	if deleteCount != 1 {
		t.Errorf("expected 1 deleted line, got %d", deleteCount)
	}

	if insertCount != 1 {
		t.Errorf("expected 1 inserted line, got %d", insertCount)
	}

	t.Logf("No-newline-at-EOF handled correctly: %d deletes, %d inserts", deleteCount, insertCount)
}

// TestParserTypeChange tests type-change (file to symlink, etc.) handling
func TestParserTypeChange(t *testing.T) {
	// Type change: regular file to symlink
	input := rawLine(0100644, 0120755, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "T", "link") +
		"diff --git a/link b/link\n" +
		"deleted file mode 100644\n" +
		"index abcdef12..12345678\n" +
		"--- a/link\n" +
		"+++ /dev/null\n" +
		"@@ -1 +0,0 @@\n" +
		"-content\n" +
		"diff --git a/link b/link\n" +
		"new file mode 120755\n" +
		"index 00000000..12345678\n" +
		"--- /dev/null\n" +
		"+++ b/link\n" +
		"@@ -0,0 +1 @@\n" +
		"+content\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	patches := make([]*Patch, 0)
	for parser.Parse() {
		patches = append(patches, parser.Patch())
	}

	if err := parser.Err(); err != nil {
		t.Fatalf("parser error: %v", err)
	}

	// Type change may produce multiple patches
	t.Logf("Type-change produced %d patches", len(patches))
	for i, p := range patches {
		t.Logf("  Patch %d: status=%c", i+1, p.Status)
	}
}

// TestParserEnforceLimitsZeroMeansUnlimited verifies that zero-value limits mean "no limit"
func TestParserEnforceLimitsZeroMeansUnlimited(t *testing.T) {
	input := rawLine(0100644, 0100644,
		"abcdef1234567890abcdef1234567890abcdef12",
		"1234567890abcdef1234567890abcdef12345678",
		"M", "main.go") +
		"diff --git a/main.go b/main.go\n" +
		"--- a/main.go\n" +
		"+++ b/main.go\n" +
		"@@ -1 +1 @@\n" +
		"-old\n" +
		"+new\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{
		EnforceLimits: true,
		// all max values left as zero - should mean "no limit"
	})

	if !parser.Parse() {
		t.Fatalf("expected first patch to parse, err=%v", parser.Err())
	}

	patch := parser.Patch()
	if patch.OverflowMarker {
		t.Fatalf("did not expect overflow marker with zero-value limits")
	}
	if patch.From == nil || patch.From.Name != "main.go" {
		t.Errorf("expected from file 'main.go', got %v", patch.From)
	}
}

// TestParserPatchObjectIsReused verifies that Patch() returns a reused object
// This test documents the API behavior that callers should not retain the pointer
func TestParserPatchObjectIsReused(t *testing.T) {
	// Note: raw lines must come BEFORE all patch content in git diff --raw --patch output
	input := rawLine(0100644, 0100644,
		"abcdef1234567890abcdef1234567890abcdef12",
		"1234567890abcdef1234567890abcdef12345678",
		"M", "file1.go") +
		rawLine(0100644, 0100644,
			"abcdef1234567890abcdef1234567890abcdef12",
			"1234567890abcdef1234567890abcdef12345678",
			"M", "file2.go") +
		"diff --git a/file1.go b/file1.go\n" +
		"--- a/file1.go\n" +
		"+++ b/file1.go\n" +
		"@@ -1 +1 @@\n-old\n+new\n" +
		"diff --git a/file2.go b/file2.go\n" +
		"--- a/file2.go\n" +
		"+++ b/file2.go\n" +
		"@@ -1 +1 @@\n-old\n+new\n"

	parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})

	if !parser.Parse() {
		t.Fatalf("first parse failed: %v", parser.Err())
	}
	first := parser.Patch()
	if first.From == nil || first.From.Name != "file1.go" {
		t.Fatalf("expected first patch to be file1.go, got %+v", first.From)
	}

	if !parser.Parse() {
		t.Fatalf("second parse failed: %v", parser.Err())
	}

	// first has now been overwritten because Patch() is reused
	if first.From == nil || first.From.Name != "file2.go" {
		t.Fatalf("expected reused patch object to now point to file2.go, got %+v", first.From)
	}
}

func BenchmarkParser(b *testing.B) {
	var buf bytes.Buffer
	for i := range 100 {
		buf.WriteString(rawLine(0100644, 0100644, "abcdef1234567890abcdef1234567890abcdef12", "1234567890abcdef1234567890abcdef12345678", "M", fmt.Sprintf("file%d.go", i%10)))
		fmt.Fprintf(&buf, "diff --git a/file%d.go b/file%d.go\n", i%10, i%10)
		buf.WriteString("--- a/file.go\n+++ b/file.go\n@@ -1,3 +1,4 @@\n package main\n func main() {\n+println(\"test\")\n }\n")
	}

	input := buf.String()

	for b.Loop() {
		parser := NewParser(git.HashSHA1, strings.NewReader(input), Limits{})
		for parser.Parse() {
		}
	}
}


================================================
FILE: cmd/hot/pkg/hud/bar.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package hud

import (
	"fmt"
	"os"

	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/progressbar"
)

type ProgressBar struct {
	bar         *progressbar.ProgressBar
	total       int
	stepCurrent int
	stepEnd     int
}

func NewBar(description string, total int, stepCurrent, stepEnd int, verbose bool) *ProgressBar {
	if verbose {
		return &ProgressBar{}
	}
	bar := progressbar.NewOptions(total,
		progressbar.OptionEnableColorCodes(true),
		progressbar.OptionSetDescription(fmt.Sprintf("\x1b[38;2;72;198;239m[%d/%d]\x1b[0m %s...", stepCurrent, stepEnd, description)),
		progressbar.OptionFullWidth(),
		progressbar.OptionSetTheme(progressbar.Theme{
			Saucer:        "\x1b[38;2;72;198;239m#\x1b[0m",
			SaucerHead:    "\x1b[38;2;72;198;239m>\x1b[0m",
			SaucerPadding: " ",
			BarStart:      "[",
			BarEnd:        "]",
		}))

	return &ProgressBar{bar: bar, total: total, stepCurrent: stepCurrent, stepEnd: stepEnd}
}

func (b *ProgressBar) Add(n int) {
	if b.bar != nil {
		_ = b.bar.Add(n)
	}
}

func (b *ProgressBar) Done() {
	if b.bar == nil {
		return
	}
	_ = b.bar.Finish()
	if b.total <= 0 {
		fmt.Fprintf(os.Stderr, "\n\x1b[38;2;72;198;239m[%d/%d]\x1b[0m %s.\n", b.stepCurrent, b.stepEnd, tr.W("processing completed"))
		return
	}
	fmt.Fprintf(os.Stderr, "\n\x1b[38;2;72;198;239m[%d/%d]\x1b[0m %s, %s: %d\n", b.stepCurrent, b.stepEnd, tr.W("processing completed"), tr.W("total"), b.total)
}


================================================
FILE: cmd/hot/pkg/hud/display.go
================================================
package hud

import (
	"fmt"
	"io"
	"slices"
	"strings"

	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/term"
)

func typePadding(e *git.TreeEntry, padding int) string {
	t := e.Type()
	if padding > len(t) {
		return t + strings.Repeat(" ", padding-len(t))
	}
	return t
}

func encodeEntry(w io.Writer, e *git.TreeEntry, t string, v term.Level) error {
	switch e.Filemode {
	case git.Symlink:
		if _, err := fmt.Fprintf(w, "%s %s %s %s\n", e.Filemode, v.Purple(t), e.Hash, v.Purple(e.Name)); err != nil {
			return err
		}
	case git.Executable:
		if _, err := fmt.Fprintf(w, "%s %s %s %s\n", e.Filemode, v.Red(t), e.Hash, v.Red(e.Name)); err != nil {
			return err
		}
	case git.Regular:
		if _, err := fmt.Fprintf(w, "%s %s %s %s\n", e.Filemode, t, e.Hash, e.Name); err != nil {
			return err
		}
	case git.Dir:
		if _, err := fmt.Fprintf(w, "%s %s %s %s\n", e.Filemode, v.Blue(t), e.Hash, v.Blue(e.Name)); err != nil {
			return err
		}
	case git.Submodule:
		if _, err := fmt.Fprintf(w, "%s %s %s %s\n", e.Filemode, v.Yellow(t), e.Hash, v.Yellow(e.Name)); err != nil {
			return err
		}
	default:
		if _, err := fmt.Fprintf(w, "%s %s %s %s\n", e.Filemode, t, e.Hash, e.Name); err != nil {
			return err
		}
	}
	return nil
}

const (
	commitTypeName = "commit"
)

func encodeTree(w io.Writer, t *git.Tree, v term.Level) error {
	p := 0
	if v != term.LevelNone && slices.IndexFunc(t.Entries, func(e *git.TreeEntry) bool { return e.Filemode == git.Submodule }) != -1 {
		p = len(commitTypeName) // commit
	}
	for _, e := range t.Entries {
		if err := encodeEntry(w, e, typePadding(e, p), v); err != nil {
			return err
		}
	}
	return nil
}

func encodeTag(w io.Writer, t *git.Tag, v term.Level) error {
	headers := []string{
		fmt.Sprintf("%s %s", v.Blue("object"), v.Green(t.Object)),
		fmt.Sprintf("%s %s", v.Blue("type"), v.Green(t.Type)),
		fmt.Sprintf("%s %s", v.Blue("tag"), v.Green(t.Name)),
		fmt.Sprintf("%s %s", v.Blue("tagger"), v.Green(t.Tagger.String())),
	}
	_, err := fmt.Fprintf(w, "%s\n\n%s", strings.Join(headers, "\n"), t.Content)
	return err
}

func encodeCommit(w io.Writer, c *git.Commit, v term.Level) (err error) {
	if _, err = fmt.Fprintf(w, "%s %s\n", v.Blue("tree"), v.Green(c.Tree)); err != nil {
		return err
	}

	for _, parent := range c.Parents {
		if _, err = fmt.Fprintf(w, "%s %s\n", v.Blue("parent"), v.Green(parent)); err != nil {
			return err
		}
	}

	if _, err = fmt.Fprintf(w, "%s %s\n%s %s\n", v.Blue("author"), v.Green(c.Author.String()), v.Blue("committer"), v.Green(c.Committer.String())); err != nil {
		return err
	}

	for _, hdr := range c.ExtraHeaders {
		if _, err = fmt.Fprintf(w, "%s %s\n", v.Blue(hdr.K), strings.ReplaceAll(hdr.V, "\n", "\n ")); err != nil {
			return err
		}

	}
	// c.Message is built from messageParts in the Decode() function.
	//
	// Since each entry in messageParts _does not_ contain its trailing LF,
	// append an empty string to capture the final newline.

	if _, err = fmt.Fprintf(w, "\n%s", c.Message); err != nil {
		return err
	}

	return nil
}

func Display(w io.Writer, a any, v term.Level) error {
	switch o := a.(type) {
	case *git.Commit:
		return encodeCommit(w, o, v)
	case *git.Tag:
		return encodeTag(w, o, v)
	case *git.Tree:
		return encodeTree(w, o, v)
	}
	_, err := fmt.Fprintln(w, a)
	return err
}


================================================
FILE: cmd/hot/pkg/mc/migrate.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package mc

import (
	"bufio"
	"context"
	"encoding/hex"
	"errors"
	"fmt"
	"os"
	"path/filepath"
	"strconv"
	"strings"
	"sync"

	"github.com/antgroup/hugescm/cmd/hot/pkg/hud"
	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/command"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/git/gitobj"
	"github.com/antgroup/hugescm/modules/strengthen"
	"github.com/antgroup/hugescm/modules/trace"
)

type Migrator struct {
	from string
	to   string
	// mu guards entries and commits (see below)
	mu *sync.Mutex
	// objects is a mapping of old objects SHAs (SHA1) to new ones (SHA256), where the ASCII
	// hex encoding of the SHA1 values are used as map keys.
	objects     map[string][]byte
	odb         *git.ODB
	newODB      *git.ODB
	worktree    string
	stepEnd     int
	stepCurrent int
	verbose     bool
}

func (m *Migrator) uncache(from []byte) ([]byte, bool) {
	m.mu.Lock()
	c, ok := m.objects[hex.EncodeToString(from)]
	m.mu.Unlock()
	return c, ok
}

func (m *Migrator) cache(from, to []byte) {
	m.mu.Lock()
	m.objects[hex.EncodeToString(from)] = to
	m.mu.Unlock()
}

type MigrateOptions struct {
	From    string
	To      string
	Format  string
	Bare    bool
	Verbose bool
	StepEnd int
}

func NewMigrator(ctx context.Context, opts *MigrateOptions) (*Migrator, error) {
	fromPath := git.RevParseRepoPath(ctx, opts.From)
	current, err := git.RevParseCurrentName(ctx, nil, opts.From)
	if err != nil {
		return nil, err
	}
	oldFormat := git.HashFormatOK(fromPath)
	newFormat := git.HashFormatFromName(opts.Format)
	if oldFormat == newFormat {
		return nil, fmt.Errorf("source repository object format is already: %s", opts.Format)
	}
	odb, err := git.NewODB(fromPath, oldFormat)
	if err != nil {
		return nil, err
	}
	if err := git.NewRepo(ctx, opts.To, current, opts.Bare, newFormat); err != nil {
		_ = odb.Close()
		return nil, err
	}
	toPath := git.RevParseRepoPath(ctx, opts.To)
	newODB, err := git.NewODB(toPath, newFormat)
	if err != nil {
		_ = odb.Close()
		return nil, err
	}
	r := &Migrator{
		from:        fromPath,
		to:          toPath,
		mu:          new(sync.Mutex),
		objects:     make(map[string][]byte),
		odb:         odb,
		newODB:      newODB,
		stepEnd:     opts.StepEnd,
		stepCurrent: 1,
		verbose:     opts.Verbose,
	}
	if !opts.Bare {
		r.worktree = opts.To
	}
	return r, nil
}

func (m *Migrator) Close() error {
	if m.newODB != nil {
		_ = m.newODB.Close()
	}
	if m.odb != nil {
		_ = m.odb.Close()
	}
	return nil
}

// getAllCommits: Return all branch/tags commit reverse order
func (m *Migrator) getAllCommits(ctx context.Context) ([][]byte, error) {
	// --topo-order is required to ensure topological order.
	reader, err := git.NewReader(ctx, &command.RunOpts{RepoPath: m.from}, "rev-list", "--reverse", "--topo-order", "--all")
	if err != nil {
		return nil, err
	}
	defer reader.Close() // nolint
	sr := bufio.NewScanner(reader)
	var commits [][]byte
	for sr.Scan() {
		oid, err := hex.DecodeString(strings.TrimSpace(sr.Text()))
		if err != nil {
			continue
		}
		commits = append(commits, oid)
	}
	return commits, nil
}

func (m *Migrator) hashObject(oid []byte) ([]byte, error) {
	br, err := m.odb.Blob(oid)
	if err != nil {
		return nil, err
	}
	defer br.Close() // nolint
	return m.newODB.WriteBlob(&gitobj.Blob{
		Size:     br.Size,
		Contents: br.Contents,
	})
}

func countObjects(ctx context.Context, repoPath string) int {
	reader, err := git.NewReader(ctx, &command.RunOpts{RepoPath: repoPath}, "count-objects", "-v")
	if err != nil {
		return -1
	}
	defer reader.Close() // nolint
	nums := make(map[string]int)
	br := bufio.NewScanner(reader)
	for br.Scan() {
		k, v, ok := strings.Cut(br.Text(), ":")
		if !ok {
			continue
		}
		n, err := strconv.Atoi(strings.TrimSpace(v))
		if err != nil {
			return -1
		}
		nums[k] = n
	}
	if total := nums["count"] + nums["in-pack"]; total != 0 {
		return total
	}
	return -1
}

func (m *Migrator) hashObjects(ctx context.Context) error {
	if !git.IsGitVersionAtLeast(git.NewVersion(2, 35, 0)) {
		return errors.New("require Git 2.35.0 or later")
	}
	args := []string{"cat-file", "--batch-check", "--batch-all-objects"}
	if git.IsGitVersionAtLeast(git.NewVersion(2, 42, 0)) {
		args = append(args, "--unordered")
	}
	reader, err := git.NewReader(ctx, &command.RunOpts{RepoPath: m.from}, args...)
	if err != nil {
		return fmt.Errorf("start git cat-file error %w", err)
	}
	defer reader.Close() // nolint
	br := bufio.NewScanner(reader)
	objectsCount := countObjects(ctx, m.from)
	b := hud.NewBar(tr.W("fast rewrite objects"), objectsCount, m.stepCurrent, m.stepEnd, m.verbose)
	m.stepCurrent++
	// format: 1a1db8dba9f976364fb6dab3e29deaf0f1140ed8 blob 5155
	for br.Scan() {
		line := br.Text()
		sv := strings.Fields(line)
		if len(sv) < 3 {
			b.Add(1)
			continue
		}
		if sv[1] != "blob" {
			b.Add(1)
			continue
		}
		oid, err := hex.DecodeString(sv[0])
		if err != nil {
			return fmt.Errorf("git cat-file decode hex error %w", err)
		}

		newOID, err := m.hashObject(oid)
		if err != nil {
			return fmt.Errorf("convert blob from sha1 to sha256 error %w", err)
		}
		m.cache(oid, newOID)
		b.Add(1)
	}
	b.Done()
	return nil
}

func (m *Migrator) rewriteTree(commitOID []byte, treeOID []byte) ([]byte, error) {
	tree, err := m.odb.Tree(treeOID)
	if err != nil {
		return nil, err
	}
	var oid []byte
	var ok bool
	entries := make([]*gitobj.TreeEntry, 0, len(tree.Entries))
	for _, e := range tree.Entries {
		switch e.Type() {
		case gitobj.BlobObjectType:
			if oid, ok = m.uncache(e.Oid); !ok {
				if oid, err = m.hashObject(e.Oid); err != nil {
					return nil, fmt.Errorf("rewrite %s error: %w", hex.EncodeToString(e.Oid), err)
				}
				m.cache(e.Oid, oid)
			}
			entries = append(entries, &gitobj.TreeEntry{Name: e.Name, Oid: oid, Filemode: e.Filemode})
		case gitobj.TreeObjectType:
			if oid, ok = m.uncache(e.Oid); !ok {
				if oid, err = m.rewriteTree(commitOID, e.Oid); err != nil {
					return nil, fmt.Errorf("rewrite %s error: %w", hex.EncodeToString(e.Oid), err)
				}
				m.cache(e.Oid, oid)
			}
			entries = append(entries, &gitobj.TreeEntry{Name: e.Name, Oid: oid, Filemode: e.Filemode})
		default:
			// FIXME: git currently does not support managing sha1 submodules in sha256 repositories
			// if e.Type() == gitobj.CommitObjectType {
			// 	newOID := make([]byte, len(e.Oid))
			// 	copy(newOID, e.Oid)
			// 	entries = append(entries, &gitobj.TreeEntry{Name: e.Name, Oid: newOID, Filemode: e.Filemode})
			// 	continue
			// }
			fmt.Fprintf(os.Stderr, "\nTreeEntry type '%s' not supported for migration\n", e.Type())
		}
	}
	return m.newODB.WriteTree(&gitobj.Tree{Entries: entries})
}

func (m *Migrator) rewriteCommits(ctx context.Context) error {
	commits, err := m.getAllCommits(ctx)
	if err != nil {
		return fmt.Errorf("commits to migrate error: %w", err)
	}
	b := hud.NewBar(tr.W("rewrite commits"), len(commits), m.stepCurrent, m.stepEnd, m.verbose)
	m.stepCurrent++
	trace.DbgPrint("commits: %v", len(commits))
	for _, oid := range commits {
		oc, err := m.odb.Commit(oid)
		if err != nil {
			return err
		}
		var newTree []byte
		var ok bool
		if newTree, ok = m.uncache(oc.TreeID); !ok {
			if newTree, err = m.rewriteTree(oid, oc.TreeID); err != nil {
				return err
			}
			m.cache(oc.TreeID, newTree)
		}
		// Create a new list of parents from the original commit to
		// point at the rewritten parents in order to create a
		// topologically equivalent DAG.
		//
		// This operation is safe since we are visiting the commits in
		// reverse topological order and therefore have seen all parents
		// before children (in other words, r.uncacheCommit(...) will
		// always return a value, if the prospective parent is a part of
		// the migration).
		rewrittenParents := make([][]byte, 0, len(oc.ParentIDs))
		for _, sha1Parent := range oc.ParentIDs {
			rewrittenParent, ok := m.uncache(sha1Parent)
			if !ok {
				// If we haven't seen the parent before, this
				// means that we're doing a partial migration
				// and the parent that we're looking for isn't
				// included.
				//
				// Use the original parent to properly link
				// history across the migration boundary.
				continue
			}

			rewrittenParents = append(rewrittenParents, rewrittenParent)
		}

		// Construct a new commit using the original header information,
		// but the rewritten set of parents as well as root tree.
		rewrittenCommit := &gitobj.Commit{
			Author:       oc.Author,
			Committer:    oc.Committer,
			ExtraHeaders: oc.ExtraHeaders,
			Message:      oc.Message,

			ParentIDs: rewrittenParents,
			TreeID:    newTree,
		}

		var newSha []byte
		if newSha, err = m.newODB.WriteCommit(rewrittenCommit); err != nil {
			return err
		}
		// Cache that commit so that we can reassign children of this
		// commit.
		m.cache(oid, newSha)
		b.Add(1)
	}
	b.Done()
	return nil
}

// getReferences returns a list of references to migrate, or an error if loading
// those references failed.
func (m *Migrator) getReferences(ctx context.Context) ([]*git.Reference, error) {
	refs, err := git.ParseReferences(ctx, m.from, git.OrderNone)
	if err != nil {
		return nil, err
	}
	references := make([]*git.Reference, 0, len(refs))
	for _, ref := range refs {
		if ref.Name.IsRemote() {
			continue
		}
		references = append(references, ref)
	}

	return references, nil
}

func (m *Migrator) encodeTag(tag *gitobj.Tag, newObj []byte) ([]byte, error) {
	newTag, err := m.newODB.WriteTag(&gitobj.Tag{
		Object:     newObj,
		ObjectType: tag.ObjectType,
		Name:       tag.Name,
		Tagger:     tag.Tagger,

		Message: tag.Message,
	})

	if err != nil {
		return nil, fmt.Errorf("could not rewrite tag: %s", tag.Name)
	}
	return newTag, nil
}

func (m *Migrator) rewriteTag(oid []byte) ([]byte, error) {
	tag, err := m.odb.Tag(oid)
	if err != nil {
		return nil, err
	}
	if tag.ObjectType == gitobj.TagObjectType {
		newTag, err := m.rewriteTag(tag.Object)
		if err != nil {
			return nil, err
		}
		return m.encodeTag(tag, newTag)

	}
	if tag.ObjectType == gitobj.CommitObjectType {
		if to, ok := m.uncache(tag.Object); ok {
			return m.encodeTag(tag, to)
		}
	}
	return oid, nil
}

func (m *Migrator) rewriteOneRef(ref *git.Reference) ([]byte, error) {
	oid, err := hex.DecodeString(ref.Target)
	if err != nil {
		return nil, fmt.Errorf("could not decode: '%s'", ref.Target)
	}
	if newOID, ok := m.uncache(oid); ok {
		return newOID, nil
	}
	if ref.ObjectType == git.CommitObject {
		// BUGS: We have completed the conversion of all commits
		return nil, nil
	}
	return m.rewriteTag(oid)
}

func (m *Migrator) reconstruct(ctx context.Context) error {
	refs, err := m.getReferences(ctx)
	if err != nil {
		return err
	}
	if len(refs) == 0 {
		fmt.Fprintf(os.Stderr, "%s", tr.W("No references to be deleted\n"))
		return nil
	}
	b := hud.NewBar(tr.W("rewrite references"), len(refs), m.stepCurrent, m.stepEnd, m.verbose)
	m.stepCurrent++
	var oid []byte
	u, err := git.NewRefUpdater(ctx, m.to, nil, false)
	if err != nil {
		return err
	}
	defer u.Close() // nolint
	if err := u.Start(); err != nil {
		fmt.Fprintf(os.Stderr, "RefUpdater: Start ref updater error: %v\n", err)
		return err
	}
	for _, ref := range refs {
		if oid, err = m.rewriteOneRef(ref); err != nil {
			return fmt.Errorf("rewrite one ref '%s' error: %w", ref.Name, err)
		}
		if oid == nil {
			continue
		}
		if err := u.Create(ref.Name, hex.EncodeToString(oid)); err != nil {
			return fmt.Errorf("update-ref '%s' error: %w", ref.Name, err)
		}
		b.Add(1)
	}
	if err := u.Prepare(); err != nil {
		fmt.Fprintf(os.Stderr, "\x1b[2K\rRefUpdater: Prepare error: %v\n", err)
		return err
	}
	if err := u.Commit(); err != nil {
		fmt.Fprintf(os.Stderr, "\x1b[2K\rRefUpdater: Commit error: %v\n", err)
		return err
	}
	b.Done()
	return nil
}

func (m *Migrator) Execute(ctx context.Context) error {
	if err := m.hashObjects(ctx); err != nil {
		return err
	}
	if err := m.rewriteCommits(ctx); err != nil {
		return err
	}
	if err := m.reconstruct(ctx); err != nil {
		return err
	}
	return m.cleanup(ctx)
}

func (m *Migrator) reset(ctx context.Context) error {
	cmd := command.NewFromOptions(ctx,
		&command.RunOpts{
			Environ:   os.Environ(),
			RepoPath:  m.worktree,
			Stderr:    os.Stderr,
			Stdout:    os.Stdout,
			Stdin:     os.Stdin,
			NoSetpgid: true,
		}, "git", "reset", "--hard")
	if err := cmd.Run(); err != nil {
		fmt.Fprintf(os.Stderr, "checkout error: %v", err)
		return err
	}
	return nil
}

func (m *Migrator) cleanup(ctx context.Context) error {
	cmd := command.NewFromOptions(ctx,
		&command.RunOpts{
			Environ:   os.Environ(),
			RepoPath:  m.to,
			Stderr:    os.Stderr,
			Stdout:    os.Stdout,
			Stdin:     os.Stdin,
			NoSetpgid: true,
		}, "git", "-c", "repack.writeBitmaps=true", "-c", "pack.packSizeLimit=16g", "gc")
	if err := cmd.Run(); err != nil {
		return fmt.Errorf("run git gc error: %w", err)
	}
	diskSize, err := strengthen.Du(filepath.Join(m.to, "objects"))
	if err != nil {
		return fmt.Errorf("du repo size error: %w", err)
	}
	fmt.Fprintf(os.Stderr, "\x1b[38;2;72;198;239m[%d/%d]\x1b[0m %s: \x1b[38;2;32;225;215m%s\x1b[0m %s: \x1b[38;2;72;198;239m%s\x1b[0m\n",
		m.stepCurrent, m.stepEnd, tr.W("Repository"), m.to, tr.W("size"), strengthen.FormatSize(diskSize))
	if len(m.worktree) != 0 {
		_ = m.reset(ctx)
	}
	return nil
}


================================================
FILE: cmd/hot/pkg/refs/refs.go
================================================
package refs

import (
	"context"
	"encoding/hex"
	"fmt"
	"os"
	"path/filepath"
	"strings"

	"github.com/antgroup/hugescm/cmd/hot/pkg/hud"
	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/git/gitobj"
)

// CommitGPGSignature represents a git commit signature part.
type CommitGPGSignature struct {
	Signature string
	Payload   string // TODO check if can be reconstruct from the rest of commit information to not have duplicate data
}

type Reference struct {
	Name      string
	ShortName string
	Hash      string
	Peeling   string
	Tree      string
	Parents   []string
	Author    *git.Signature
	Committer *git.Signature
	Message   string
	Leading   int // leading > mainline
	Lagging   int // lagging < mainline
	Broken    bool
}

func (r *Reference) Merged() bool {
	return r.IsBranch() && r.Leading == 0
}

func (r *Reference) IsBranch() bool {
	return strings.HasPrefix(r.Name, "refs/heads/")
}

func (r *Reference) IsTag() bool {
	return strings.HasPrefix(r.Name, "refs/tags/")
}

type Matcher interface {
	Match(string) bool
}

type References struct {
	BasePoint string
	Current   string
	Items     []*Reference
}

func (r *References) resolveRefCommit(odb *git.ODB, ref *git.Reference) ([]byte, *gitobj.Commit, error) {
	sha, err := hex.DecodeString(ref.Target)
	if err != nil {
		return nil, nil, fmt.Errorf("could not decode: %q", ref.Target)
	}
	for range 20 {
		obj, err := odb.Object(sha)
		if err != nil {
			return nil, nil, fmt.Errorf("open git object error: %w", err)
		}
		if obj.Type() == gitobj.CommitObjectType {
			return sha, obj.(*gitobj.Commit), nil
		}
		if obj.Type() != gitobj.TagObjectType {
			return nil, nil, fmt.Errorf("oid: %s unsupport object type: %s", hex.EncodeToString(sha), obj.Type())
		}
		tag := obj.(*gitobj.Tag)
		sha = tag.Object
	}
	return nil, nil, fmt.Errorf("ref '%s' recursion depth is not supported", ref.Name)
}

func (r *References) resolve(ctx context.Context, repoPath string, odb *git.ODB, ref *git.Reference) error {
	sha, cc, err := r.resolveRefCommit(odb, ref)
	if err != nil {
		r.Items = append(r.Items, &Reference{Name: ref.Name.String(), Hash: ref.Target, Broken: true})
		return err
	}
	reference := &Reference{
		Name:      ref.Name.String(),
		ShortName: ref.ShortName,
		Hash:      ref.Target,
		Tree:      hex.EncodeToString(cc.TreeID),
		Message:   cc.Message,
		Author:    git.SignatureFromLine(cc.Author),
		Committer: git.SignatureFromLine(cc.Committer),
	}
	for _, p := range cc.ParentIDs {
		reference.Parents = append(reference.Parents, hex.EncodeToString(p))
	}
	if peeling := hex.EncodeToString(sha); peeling != ref.Target {
		reference.Peeling = peeling
	}
	if reference.Hash != r.BasePoint && ref.Name.IsBranch() {
		reference.Leading, reference.Lagging, _ = git.RevDivergingCount(ctx, repoPath, reference.Hash, r.BasePoint)
	}
	r.Items = append(r.Items, reference)
	return nil
}

func ScanReferences(ctx context.Context, repoPath string, m Matcher, order git.Order) (*References, error) {
	odb, err := git.NewODB(repoPath, git.HashFormatOK(repoPath))
	if err != nil {
		return nil, err
	}
	defer odb.Close() // nolint
	refs, err := git.ParseReferences(ctx, repoPath, order)
	if err != nil {
		return nil, err
	}
	b := hud.NewBar(tr.W("scan references"), len(refs), 1, 1, false)
	hash, refname, _ := git.ParseReference(ctx, repoPath, "HEAD")
	r := &References{
		BasePoint: hash,
		Current:   refname,
		Items:     make([]*Reference, 0, 200),
	}
	for _, ref := range refs {
		b.Add(1)
		if !m.Match(ref.Name.String()) {
			continue
		}
		if err := r.resolve(ctx, repoPath, odb, ref); err != nil {
			fmt.Fprintf(os.Stderr, "Parse ref: %s error: %v\n", ref.Name, err)
		}
	}
	b.Done()
	return r, nil
}

func RemoveBrokenRef(repoPath string, refName string) error {
	refPath := filepath.Join(repoPath, refName)
	return os.Remove(refPath)
}


================================================
FILE: cmd/hot/pkg/replay/cache.go
================================================
// Copyright (c) 2014- GitHub, Inc. and Git LFS contributors
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package replay

import (
	"encoding/hex"
	"fmt"

	"github.com/antgroup/hugescm/modules/git/gitobj"
)

// cacheEntry caches then given "from" entry so that it is always rewritten as
// a *TreeEntry equivalent to "to".
func (r *Replayer) cacheEntry(path string, from, to *gitobj.TreeEntry) *gitobj.TreeEntry {
	r.mu.Lock()
	defer r.mu.Unlock()

	r.entries[r.entryKey(path, from)] = to

	return to
}

// uncacheEntry returns a *TreeEntry that is cached from the given *TreeEntry
// "from". That is to say, it returns the *TreeEntry that "from" should be
// rewritten to, or nil if none could be found.
func (r *Replayer) uncacheEntry(path string, from *gitobj.TreeEntry) *gitobj.TreeEntry {
	r.mu.Lock()
	defer r.mu.Unlock()

	return r.entries[r.entryKey(path, from)]
}

// entryKey returns a unique key for a given *TreeEntry "e".
func (r *Replayer) entryKey(path string, e *gitobj.TreeEntry) string {
	return fmt.Sprintf("%s:%x", path, e.Oid)
}

// cacheEntry caches then given "from" commit so that it is always rewritten as
// a *git/gitobj.Commit equivalent to "to".
func (r *Replayer) cacheCommit(from, to []byte) {
	r.mu.Lock()
	defer r.mu.Unlock()

	r.commits[hex.EncodeToString(from)] = to
}

// uncacheCommit returns a *git/gitobj.Commit that is cached from the given
// *git/gitobj.Commit "from". That is to say, it returns the *git/gitobj.Commit that
// "from" should be rewritten to and true, or nil and false if none could be
// found.
func (r *Replayer) uncacheCommit(from []byte) ([]byte, bool) {
	r.mu.Lock()
	defer r.mu.Unlock()

	c, ok := r.commits[hex.EncodeToString(from)]
	return c, ok
}

func copyEntry(e *gitobj.TreeEntry) *gitobj.TreeEntry {
	if e == nil {
		return nil
	}

	oid := make([]byte, len(e.Oid))
	copy(oid, e.Oid)

	return &gitobj.TreeEntry{
		Filemode: e.Filemode,
		Name:     e.Name,
		Oid:      oid,
	}
}

func copyEntryMode(e *gitobj.TreeEntry, mode int32) *gitobj.TreeEntry {
	copied := copyEntry(e)
	copied.Filemode = mode

	return copied
}


================================================
FILE: cmd/hot/pkg/replay/cleanup.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package replay

import (
	"fmt"
	"os"
	"path/filepath"

	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/command"
	"github.com/antgroup/hugescm/modules/strengthen"
	"github.com/antgroup/hugescm/modules/tui"
)

func (r *Replayer) cleanup(prune bool) error {
	if !prune {
		if err := tui.AskConfirm(&prune, "%s", tr.W("Do you want to prune the repository right away")); err != nil {
			return err
		}
		if !prune {
			return nil
		}
	}
	cmd := command.NewFromOptions(r.ctx,
		&command.RunOpts{
			Environ:   os.Environ(),
			RepoPath:  r.repoPath,
			Stderr:    os.Stderr,
			Stdout:    os.Stdout,
			Stdin:     os.Stdin,
			NoSetpgid: true,
		}, "git", "-c", "repack.writeBitmaps=true", "-c", "pack.packSizeLimit=16g", "gc", "--prune=now", "--aggressive")
	if err := cmd.Run(); err != nil {
		return fmt.Errorf("run git gc error: %w", err)
	}
	diskSize, err := strengthen.Du(filepath.Join(r.repoPath, "objects"))
	if err != nil {
		return fmt.Errorf("du repo size error: %w", err)
	}
	fmt.Fprintf(os.Stderr, "\x1b[38;2;72;198;239m[%d/%d]\x1b[0m %s: \x1b[38;2;32;225;215m%s\x1b[0m %s: \x1b[38;2;72;198;239m%s\x1b[0m\n",
		r.stepCurrent, r.stepEnd, tr.W("Repository"), r.repoPath, tr.W("size"), strengthen.FormatSize(diskSize))
	return nil
}


================================================
FILE: cmd/hot/pkg/replay/drop.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package replay

import (
	"errors"
	"fmt"
	"path"

	"github.com/antgroup/hugescm/cmd/hot/pkg/hud"
	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/git/gitobj"
	"github.com/antgroup/hugescm/modules/trace"
	"github.com/antgroup/hugescm/modules/tui"
)

func (r *Replayer) rewriteTree(m Matcher, commitOID []byte, treeOID []byte, parent string) ([]byte, error) {
	tree, err := r.odb.Tree(treeOID)
	if err != nil {
		return nil, err
	}

	entries := make([]*gitobj.TreeEntry, 0, len(tree.Entries))
	for _, entry := range tree.Entries {
		name := path.Join(parent, entry.Name)
		// matched path
		if m.Match(entry, name) {
			continue
		}
		if entry.Type() == gitobj.BlobObjectType {
			entries = append(entries, copyEntry(entry))
			continue
		}
		// If this is a symlink, skip it
		if entry.Filemode == 0120000 {
			entries = append(entries, copyEntry(entry))
			continue
		}

		if cached := r.uncacheEntry(name, entry); cached != nil {
			entries = append(entries, copyEntryMode(cached, entry.Filemode))
			continue
		}

		var oid []byte

		switch entry.Type() {
		case gitobj.TreeObjectType:
			oid, err = r.rewriteTree(m, commitOID, entry.Oid, name)
		default:
			oid = entry.Oid

		}
		if err != nil {
			return nil, err
		}

		entries = append(entries, r.cacheEntry(name, entry, &gitobj.TreeEntry{
			Filemode: entry.Filemode,
			Name:     entry.Name,
			Oid:      oid,
		}))
	}
	rewritten := &gitobj.Tree{Entries: entries}
	if tree.Equal(rewritten) {
		return treeOID, nil
	}
	return r.odb.WriteTree(rewritten)
}

func (r *Replayer) rewriteCommits(m Matcher) error {
	commits, err := r.commitsToRewrite()
	if err != nil {
		return fmt.Errorf("commits to rewrite error: %w", err)
	}
	b := hud.NewBar(tr.W("rewrite commits"), len(commits), r.stepCurrent, r.stepEnd, r.verbose)
	r.stepCurrent++
	trace.DbgPrint("commits: %v", len(commits))
	for _, oid := range commits {
		original, err := r.odb.Commit(oid)
		if err != nil {
			return err
		}
		rewrittenTree, err := r.rewriteTree(m, oid, original.TreeID, "")
		if err != nil {
			return err
		}
		// Create a new list of parents from the original commit to
		// point at the rewritten parents in order to create a
		// topologically equivalent DAG.
		//
		// This operation is safe since we are visiting the commits in
		// reverse topological order and therefore have seen all parents
		// before children (in other words, r.uncacheCommit(...) will
		// always return a value, if the prospective parent is a part of
		// the migration).
		rewrittenParents := make([][]byte, 0, len(original.ParentIDs))
		for _, originalParent := range original.ParentIDs {
			rewrittenParent, ok := r.uncacheCommit(originalParent)
			if !ok {
				// If we haven't seen the parent before, this
				// means that we're doing a partial migration
				// and the parent that we're looking for isn't
				// included.
				//
				// Use the original parent to properly link
				// history across the migration boundary.
				rewrittenParent = originalParent
			}

			rewrittenParents = append(rewrittenParents, rewrittenParent)
		}

		// Construct a new commit using the original header information,
		// but the rewritten set of parents as well as root tree.
		rewrittenCommit := &gitobj.Commit{
			Author:       original.Author,
			Committer:    original.Committer,
			ExtraHeaders: original.ExtraHeaders,
			Message:      original.Message,

			ParentIDs: rewrittenParents,
			TreeID:    rewrittenTree,
		}

		var newSha []byte

		if original.Equal(rewrittenCommit) {
			newSha = make([]byte, len(oid))
			copy(newSha, oid)
		} else {
			if newSha, err = r.odb.WriteCommit(rewrittenCommit); err != nil {
				return err
			}
		}
		// Cache that commit so that we can reassign children of this
		// commit.
		r.cacheCommit(oid, newSha)
		b.Add(1)
	}
	b.Done()
	return nil
}

func (r *Replayer) Drop(m Matcher, confirm bool, prune bool) error {
	if !confirm {
		if !git.IsBareRepository(r.ctx, r.repoPath) {
			// core.bare
			if err := tui.AskConfirm(&confirm, "%s", tr.W("Repository not bare repository, continue to rewrite")); err != nil {
				return err
			}
			if !confirm {
				return nil
			}
		}
	}
	if err := r.rewriteCommits(m); err != nil {
		return err
	}
	if !confirm {
		if err := tui.AskConfirm(&confirm, "%s", tr.W("Do you want to rewrite local branches and tags")); err != nil {
			return err
		}
		if !confirm {
			return nil
		}
	}
	refs, err := r.referencesToRewrite()
	if err != nil {
		return errors.New("could not find refs to update")
	}

	updater := &refUpdater{
		CacheFn:    r.uncacheCommit,
		References: refs,
		RepoPath:   r.repoPath,
		odb:        r.odb,
	}
	b := hud.NewBar(tr.W("rewrite references"), len(refs), r.stepCurrent, r.stepEnd, r.verbose)
	r.stepCurrent++
	if err := updater.UpdateRefs(r.ctx, b); err != nil {
		return errors.New("could not update refs")
	}
	b.Done()
	return r.cleanup(prune)
}


================================================
FILE: cmd/hot/pkg/replay/graft.go
================================================
// Copyright ©️ Ant Group. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package replay

import (
	"encoding/hex"
	"errors"
	"fmt"
	"os"

	"github.com/antgroup/hugescm/cmd/hot/pkg/hud"
	"github.com/antgroup/hugescm/cmd/hot/pkg/tr"
	"github.com/antgroup/hugescm/modules/git"
	"github.com/antgroup/hugescm/modules/git/gitobj"
	"github.com/antgroup/hugescm/modules/tui"
)

func (r *Replayer) resolveCommit(ref *git.Reference) ([]byte, *gitobj.Commit, error) {
	sha, err := hex.DecodeString(ref.Target)
	if err != nil {
		return nil, nil, fmt.Errorf("could not decode: %q", ref.Target)
	}
	for range 20 {
		obj, err := r.odb.Object(sha)
		if err != nil {
			return nil, nil, fmt.Errorf("open git object error: %w", err)
		}
		if obj.Type() == gitobj.CommitObjectType {
			return sha, obj.(*gitobj.Commit), nil
		}
		if obj.Type() != gitobj.TagObjectType {
			return nil, nil, fmt.Errorf("oid: %s unsupported object type: %s", hex.EncodeToString(sha), obj.Type())
		}
		tag := obj.(*gitobj.Tag)
		sha = tag.Object
	}
	return nil, nil, fmt.Errorf("ref '%s' recursion depth is not supported", ref.Name)
}

// graft HEAD
func (r *Replayer) graftHEAD() error {
	_, oldRev, err := git.RevParseCurrent(r.ctx, os.Environ(), r.repoPath)
	if err != nil {
		return err
	}
	oid, err := hex.DecodeString(oldRev)
	if err != nil {
		return err
	}
	original, err := r.odb.Commit(oid)
	if err != nil {
		return err
	}
	rewrittenParents := make([][]byte, 0, len(original.ParentIDs))
	for _, originalParent := range original.ParentIDs {
		rewrittenParent, ok := r.uncacheCommit(originalParent)
		if !ok {
			// If we haven't seen the parent before, this
			// means that we're doing a partial migration
			// and the parent that we're looking for isn't
			// included.
			//
			// Use the original parent to properly link
			// history across the migration boundary.
			rewrittenParent = originalParent
		}

		rewrittenParents = append(rewrittenParents, rewrittenParent)
	}
	// Construct a new commit using the original header information,
	// but the rewritten set of parents as well as root tree.
	rewrittenCommit := &gitobj.Commit{
		Author:       original.Author,
		Committer:    original.Committer,
		ExtraHeaders: original.ExtraHeaders,
		Message:      original.Message,

		ParentIDs: rewrittenParents,
		TreeID:    original.TreeID,
	}

	var newSha []byte

	if original.Equal(rewrittenCommit) {
		newSha = make([]byte, len(oid))
		copy(newSha, oid)
	} else {
		newSha, err = r.odb.WriteCommit(rewrittenCommit)
		if err != nil {
			return err
		}
	}
	// Cache that commit so that we can reassign children of this
	// commit.
	r.cacheCommit(oid, newSha)
	return nil
}

func (r *Replayer) graftCommits(refs []*git.Reference, headOnly bool) error {
	if headOnly {
		b := hud.NewBar(tr.W("graft commits"), 1, r.stepCurrent, r.stepEnd, r.verbose)
		r.stepCurrent++
		if err := r.graftHEAD(); err != nil {
			return err
		}
		b.Done()
		return nil
	}
	b := hud.NewBar(tr.W("graft commits"), len(refs), r.stepCurrent, r.stepEnd, r.verbose)
	r.stepCurrent++
	for _, ref := range refs {
		oid, original, err := r.resolveCommit(ref)
		if err != nil {
			return err
		}

		rewrittenParents := make([][]byte, 0, len(original.ParentIDs))
		for _, originalParent := range original.ParentIDs {
			rewrittenParent, ok := r.uncacheCommit(originalParent)
			if !ok {
				// If we haven't seen the parent before, this
				// means that we're doing a partial migration
				// and the parent that we're looking for isn't
				// included.
				//
				// Use the original parent to properly link
				// history across the migration boundary.
				rewrittenParent = originalParent
			}

			rewrittenParents = append(rewrittenParents, rewrittenParent)
		}
		// Construct a new commit using the original header information,
		// but the rewritten set of parents as well as root tree.
		rewrittenCommit := &gitobj.Commit{
			Author:       original.Author,
			Committer:    original.Committer,
			ExtraHeaders: original.ExtraHeaders,
			Message:      original.Message,

			ParentIDs: rewrittenParents,
			TreeID:    original.TreeID,
		}

		var newSha []byte

		if original.Equal(rewrittenCommit) {
			newSha = make([]by
Download .txt
gitextract_x8awn04j/

├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       └── ci.yml
├── .gitignore
├── .golangci.yml
├── CHANGELOG.md
├── LEGAL.md
├── LICENSE
├── Makefile
├── README.md
├── README.zh-CN.md
├── VERSION
├── bali.toml
├── cmd/
│   ├── README.md
│   ├── hot/
│   │   ├── command/
│   │   │   ├── command.go
│   │   │   ├── command_az.go
│   │   │   ├── command_cat.go
│   │   │   ├── command_co.go
│   │   │   ├── command_diff.go
│   │   │   ├── command_expire_refs.go
│   │   │   ├── command_graft.go
│   │   │   ├── command_mc.go
│   │   │   ├── command_prune_refs.go
│   │   │   ├── command_remove.go
│   │   │   ├── command_scan_refs.go
│   │   │   ├── command_show.go
│   │   │   ├── command_size.go
│   │   │   ├── command_smart.go
│   │   │   ├── command_snapshot.go
│   │   │   ├── command_stat.go
│   │   │   ├── command_unbranch.go
│   │   │   ├── misc.go
│   │   │   └── pager.go
│   │   ├── crate.toml
│   │   ├── hot.go
│   │   ├── pkg/
│   │   │   ├── README.md
│   │   │   ├── co/
│   │   │   │   ├── co.go
│   │   │   │   ├── misc.go
│   │   │   │   └── misc_test.go
│   │   │   ├── diff/
│   │   │   │   ├── diff.go
│   │   │   │   └── parser_test.go
│   │   │   ├── hud/
│   │   │   │   ├── bar.go
│   │   │   │   └── display.go
│   │   │   ├── mc/
│   │   │   │   └── migrate.go
│   │   │   ├── refs/
│   │   │   │   └── refs.go
│   │   │   ├── replay/
│   │   │   │   ├── cache.go
│   │   │   │   ├── cleanup.go
│   │   │   │   ├── drop.go
│   │   │   │   ├── graft.go
│   │   │   │   ├── misc.go
│   │   │   │   ├── replay.go
│   │   │   │   ├── unbranch.go
│   │   │   │   └── update.go
│   │   │   ├── stat/
│   │   │   │   ├── az.go
│   │   │   │   ├── color.go
│   │   │   │   ├── draw.go
│   │   │   │   ├── size.go
│   │   │   │   ├── stat.go
│   │   │   │   ├── stat_test.go
│   │   │   │   └── table.go
│   │   │   └── tr/
│   │   │       ├── README.md
│   │   │       ├── languages/
│   │   │       │   └── zh-CN.toml
│   │   │       ├── tr.go
│   │   │       └── tr_test.go
│   │   └── winres.toml
│   ├── zeta/
│   │   ├── crate.toml
│   │   ├── main.go
│   │   └── winres.toml
│   ├── zeta-mc/
│   │   ├── crate.toml
│   │   ├── main.go
│   │   ├── migrate.go
│   │   ├── msic.go
│   │   └── winres.toml
│   └── zeta-serve/
│       ├── command_encrypt.go
│       ├── command_httpd.go
│       ├── command_keygen.go
│       ├── command_sshd.go
│       ├── global.go
│       ├── main.go
│       ├── shutdown.go
│       ├── shutdown_other.go
│       └── shutdown_windows.go
├── docs/
│   ├── README.md
│   ├── cdc.md
│   ├── config.md
│   ├── design.md
│   ├── hot.md
│   ├── object-format.md
│   ├── pack-format.md
│   ├── protocol.md
│   ├── pull-strategy.md
│   ├── sparse-checkout.md
│   ├── stash.md
│   ├── switch.md
│   ├── version-negotiation.md
│   ├── zeta.toml
│   └── zeta.toml.example
├── go.mod
├── go.sum
├── modules/
│   ├── README.md
│   ├── base58/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── alphabet.go
│   │   ├── base58.go
│   │   ├── base58_test.go
│   │   ├── base58bench_test.go
│   │   ├── base58check.go
│   │   ├── base58check_test.go
│   │   ├── cov_report.sh
│   │   ├── doc.go
│   │   ├── example_test.go
│   │   └── genalphabet.go
│   ├── binary/
│   │   ├── read.go
│   │   └── write.go
│   ├── bitmap/
│   │   ├── LICENSE
│   │   ├── bitmap.go
│   │   └── bitmap_test.go
│   ├── chardet/
│   │   ├── 2022.go
│   │   ├── LICENSE
│   │   ├── VERSION
│   │   ├── detector.go
│   │   ├── encoding.go
│   │   ├── icu-license.html
│   │   ├── multi_byte.go
│   │   ├── recognizer.go
│   │   ├── single_byte.go
│   │   ├── unicode.go
│   │   └── utf8.go
│   ├── command/
│   │   ├── command.go
│   │   ├── shepherd.go
│   │   ├── shepherd_linux.go
│   │   ├── shepherd_test.go
│   │   ├── shepherd_unix.go
│   │   ├── shepherd_win.go
│   │   └── util.go
│   ├── crc/
│   │   └── reader.go
│   ├── deflect/
│   │   ├── az.go
│   │   ├── deflect.go
│   │   ├── deflect_test.go
│   │   ├── du.go
│   │   ├── pack.go
│   │   └── struct.go
│   ├── diferenco/
│   │   ├── MERGE_PARALLEL.md
│   │   ├── README.md
│   │   ├── algorithms_bench_test.go
│   │   ├── color/
│   │   │   └── color.go
│   │   ├── diferenco.go
│   │   ├── diferenco_test.go
│   │   ├── gen_unicode.go
│   │   ├── histogram.go
│   │   ├── histogram_test.go
│   │   ├── lcs/
│   │   │   ├── LICENSE
│   │   │   ├── common.go
│   │   │   ├── common_test.go
│   │   │   ├── doc.go
│   │   │   ├── git.sh
│   │   │   ├── labels.go
│   │   │   ├── old.go
│   │   │   ├── old_test.go
│   │   │   └── sequence.go
│   │   ├── merge.go
│   │   ├── merge_parallel.go
│   │   ├── merge_parallel_bench_test.go
│   │   ├── merge_parallel_test.go
│   │   ├── merge_test.go
│   │   ├── minimal.go
│   │   ├── minimal_test.go
│   │   ├── myers.go
│   │   ├── myers_bench_test.go
│   │   ├── myers_test.go
│   │   ├── onp.go
│   │   ├── onp_test.go
│   │   ├── patience.go
│   │   ├── patience_bench_test.go
│   │   ├── patience_test.go
│   │   ├── regression_test.go
│   │   ├── sink.go
│   │   ├── sink_test.go
│   │   ├── suffixarray.go
│   │   ├── suffixarray_test.go
│   │   ├── testdata/
│   │   │   ├── a.txt
│   │   │   ├── b.txt
│   │   │   ├── css_1.css
│   │   │   ├── css_2.css
│   │   │   ├── simple_1.scss
│   │   │   └── simple_2.scss
│   │   ├── text.go
│   │   ├── unicode.go
│   │   ├── unicode_data.go
│   │   ├── unicode_test.go
│   │   ├── unified.go
│   │   └── unified_encoder.go
│   ├── env/
│   │   ├── broker.go
│   │   ├── builder.go
│   │   ├── constant.go
│   │   ├── env.go
│   │   ├── env_test.go
│   │   ├── env_unix.go
│   │   ├── env_windows.go
│   │   └── env_windows_test.go
│   ├── fnmatch/
│   │   ├── LICENSE
│   │   ├── VERSION
│   │   ├── fnmatch.go
│   │   └── fnmatch_test.go
│   ├── gcfg/
│   │   ├── LICENSE
│   │   ├── Makefile
│   │   ├── VERSION
│   │   ├── doc.go
│   │   ├── errors.go
│   │   ├── errors_test.go
│   │   ├── example_test.go
│   │   ├── issues_test.go
│   │   ├── read.go
│   │   ├── read_test.go
│   │   ├── scanner/
│   │   │   ├── errors.go
│   │   │   ├── example_test.go
│   │   │   ├── scanner.go
│   │   │   └── scanner_test.go
│   │   ├── set.go
│   │   ├── token/
│   │   │   ├── position.go
│   │   │   ├── position_test.go
│   │   │   ├── serialize.go
│   │   │   ├── serialize_test.go
│   │   │   └── token.go
│   │   └── types/
│   │       ├── bool.go
│   │       ├── doc.go
│   │       ├── enum.go
│   │       ├── enum_test.go
│   │       ├── int.go
│   │       ├── int_test.go
│   │       ├── scan.go
│   │       └── scan_test.go
│   ├── git/
│   │   ├── branch.go
│   │   ├── command.go
│   │   ├── commit.go
│   │   ├── commit_test.go
│   │   ├── config/
│   │   │   ├── config.go
│   │   │   ├── decoder.go
│   │   │   ├── option.go
│   │   │   └── section.go
│   │   ├── constant.go
│   │   ├── decode.go
│   │   ├── error.go
│   │   ├── filemode.go
│   │   ├── gitobj/
│   │   │   ├── LICENSE.md
│   │   │   ├── README.md
│   │   │   ├── SECURITY.md
│   │   │   ├── VERSION
│   │   │   ├── backend.go
│   │   │   ├── backend_nix.go
│   │   │   ├── backend_test.go
│   │   │   ├── backend_windows.go
│   │   │   ├── blob.go
│   │   │   ├── blob_test.go
│   │   │   ├── commit.go
│   │   │   ├── commit_test.go
│   │   │   ├── errors/
│   │   │   │   ├── errors.go
│   │   │   │   └── errors_test.go
│   │   │   ├── errors.go
│   │   │   ├── errors_test.go
│   │   │   ├── file_storer.go
│   │   │   ├── memory_storer.go
│   │   │   ├── memory_storer_test.go
│   │   │   ├── object.go
│   │   │   ├── object_db.go
│   │   │   ├── object_db_test.go
│   │   │   ├── object_reader.go
│   │   │   ├── object_reader_test.go
│   │   │   ├── object_type.go
│   │   │   ├── object_type_test.go
│   │   │   ├── object_writer.go
│   │   │   ├── object_writer_test.go
│   │   │   ├── pack/
│   │   │   │   ├── bounds.go
│   │   │   │   ├── bounds_test.go
│   │   │   │   ├── chain.go
│   │   │   │   ├── chain_base.go
│   │   │   │   ├── chain_base_test.go
│   │   │   │   ├── chain_delta.go
│   │   │   │   ├── chain_delta_test.go
│   │   │   │   ├── chain_test.go
│   │   │   │   ├── delayed_object.go
│   │   │   │   ├── errors.go
│   │   │   │   ├── errors_test.go
│   │   │   │   ├── index.go
│   │   │   │   ├── index_decode.go
│   │   │   │   ├── index_decode_test.go
│   │   │   │   ├── index_entry.go
│   │   │   │   ├── index_test.go
│   │   │   │   ├── index_v1.go
│   │   │   │   ├── index_v1_test.go
│   │   │   │   ├── index_v2.go
│   │   │   │   ├── index_v2_test.go
│   │   │   │   ├── index_version.go
│   │   │   │   ├── io.go
│   │   │   │   ├── io_test.go
│   │   │   │   ├── object.go
│   │   │   │   ├── object_test.go
│   │   │   │   ├── packfile.go
│   │   │   │   ├── packfile_decode.go
│   │   │   │   ├── packfile_decode_test.go
│   │   │   │   ├── packfile_test.go
│   │   │   │   ├── set.go
│   │   │   │   ├── set_test.go
│   │   │   │   ├── storage.go
│   │   │   │   ├── type.go
│   │   │   │   └── type_test.go
│   │   │   ├── storage/
│   │   │   │   ├── backend.go
│   │   │   │   ├── decompressing_readcloser.go
│   │   │   │   ├── multi_storage.go
│   │   │   │   └── storage.go
│   │   │   ├── storer.go
│   │   │   ├── tag.go
│   │   │   ├── tag_test.go
│   │   │   ├── tree.go
│   │   │   └── tree_test.go
│   │   ├── hash.go
│   │   ├── hash_test.go
│   │   ├── object.go
│   │   ├── odb.go
│   │   ├── reference.go
│   │   ├── reftable/
│   │   │   └── reftable.go
│   │   ├── remote.go
│   │   ├── repo.go
│   │   ├── repo_test.go
│   │   ├── signature.go
│   │   ├── stats/
│   │   │   ├── commit-graph.go
│   │   │   └── status.go
│   │   ├── tag.go
│   │   ├── tree.go
│   │   ├── updateref.go
│   │   ├── util.go
│   │   ├── version.go
│   │   └── version_test.go
│   ├── hexview/
│   │   ├── format.go
│   │   └── format_test.go
│   ├── keyring/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── VERSION
│   │   ├── keyring.go
│   │   ├── keyring_darwin.go
│   │   ├── keyring_darwin_security.go
│   │   ├── keyring_darwin_security_test.go
│   │   ├── keyring_darwin_test.go
│   │   ├── keyring_file.go
│   │   ├── keyring_file_test.go
│   │   ├── keyring_test.go
│   │   ├── keyring_unix.go
│   │   ├── keyring_windows.go
│   │   └── secret_service/
│   │       └── secret_service.go
│   ├── lfs/
│   │   ├── LICENSE
│   │   ├── error.go
│   │   ├── pointer.go
│   │   └── pointer_test.go
│   ├── locale/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── error.go
│   │   ├── locale.go
│   │   ├── locale_darwin.go
│   │   ├── locale_js.go
│   │   ├── locale_posix.go
│   │   ├── locale_shared.go
│   │   └── locale_windows.go
│   ├── merkletrie/
│   │   ├── LICENSE
│   │   ├── change.go
│   │   ├── difftree.go
│   │   ├── doc.go
│   │   ├── doubleiter.go
│   │   ├── filesystem/
│   │   │   ├── node.go
│   │   │   └── node_test.go
│   │   ├── index/
│   │   │   └── node.go
│   │   ├── internal/
│   │   │   ├── frame/
│   │   │   │   └── frame.go
│   │   │   └── fsnoder/
│   │   │       ├── dir.go
│   │   │       ├── doc.go
│   │   │       ├── file.go
│   │   │       └── new.go
│   │   ├── iter.go
│   │   └── noder/
│   │       ├── noder.go
│   │       ├── path.go
│   │       ├── sparse.go
│   │       └── sparse_test.go
│   ├── mime/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── VERSION
│   │   ├── internal/
│   │   │   ├── charset/
│   │   │   │   ├── charset.go
│   │   │   │   └── charset_test.go
│   │   │   ├── csv/
│   │   │   │   ├── parser.go
│   │   │   │   └── parser_test.go
│   │   │   ├── json/
│   │   │   │   ├── parser.go
│   │   │   │   └── parser_test.go
│   │   │   ├── magic/
│   │   │   │   ├── archive.go
│   │   │   │   ├── archive_test.go
│   │   │   │   ├── audio.go
│   │   │   │   ├── binary.go
│   │   │   │   ├── database.go
│   │   │   │   ├── document.go
│   │   │   │   ├── font.go
│   │   │   │   ├── ftyp.go
│   │   │   │   ├── geo.go
│   │   │   │   ├── image.go
│   │   │   │   ├── magic.go
│   │   │   │   ├── magic_test.go
│   │   │   │   ├── meteo.go
│   │   │   │   ├── ms_office.go
│   │   │   │   ├── netpbm.go
│   │   │   │   ├── ogg.go
│   │   │   │   ├── text.go
│   │   │   │   ├── text_csv.go
│   │   │   │   ├── text_test.go
│   │   │   │   ├── video.go
│   │   │   │   ├── zip.go
│   │   │   │   └── zip_test.go
│   │   │   ├── markup/
│   │   │   │   ├── markup.go
│   │   │   │   └── markup_test.go
│   │   │   └── scan/
│   │   │       ├── bytes.go
│   │   │       └── bytes_test.go
│   │   ├── mime.go
│   │   ├── mime_test.go
│   │   ├── mimetsx
│   │   ├── mimetype.go
│   │   ├── sanitize.go
│   │   └── tree.go
│   ├── oss/
│   │   ├── bucket.go
│   │   ├── delete.go
│   │   ├── error.go
│   │   ├── gcs.example
│   │   ├── list.go
│   │   ├── misc.go
│   │   ├── misc_test.go
│   │   ├── multipart.go
│   │   ├── oss.go
│   │   ├── s3.example
│   │   ├── signature.go
│   │   └── upload.go
│   ├── patchview/
│   │   ├── highlight.go
│   │   ├── highlight_test.go
│   │   ├── renderer.go
│   │   ├── status_bar.go
│   │   ├── styles.go
│   │   └── view.go
│   ├── plumbing/
│   │   ├── LICENSE
│   │   ├── error.go
│   │   ├── filemode/
│   │   │   ├── filemode.go
│   │   │   └── filemode_test.go
│   │   ├── format/
│   │   │   ├── ignore/
│   │   │   │   ├── dir.go
│   │   │   │   ├── doc.go
│   │   │   │   ├── ignore_test.go
│   │   │   │   ├── matcher.go
│   │   │   │   └── pattern.go
│   │   │   ├── index/
│   │   │   │   ├── decoder.go
│   │   │   │   ├── decoder_test.go
│   │   │   │   ├── doc.go
│   │   │   │   ├── encoder.go
│   │   │   │   ├── encoder_test.go
│   │   │   │   ├── index.go
│   │   │   │   └── match.go
│   │   │   ├── pktline/
│   │   │   │   ├── encoder.go
│   │   │   │   ├── encoder_test.go
│   │   │   │   ├── scanner.go
│   │   │   │   └── scanner_test.go
│   │   │   └── readme.md
│   │   ├── hash.go
│   │   ├── reference.go
│   │   └── validate.go
│   ├── progressbar/
│   │   ├── LICENSE
│   │   ├── VERSION
│   │   ├── colorstring/
│   │   │   ├── LICENSE
│   │   │   └── colorstring.go
│   │   ├── progressbar.go
│   │   └── spinners.go
│   ├── securejoin/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── join.go
│   │   └── vfs.go
│   ├── shlex/
│   │   ├── LICENSE
│   │   └── shlex.go
│   ├── streamio/
│   │   ├── bytes.go
│   │   ├── io.go
│   │   ├── io_test.go
│   │   ├── sync.go
│   │   ├── zlib.go
│   │   ├── zlib_test.go
│   │   ├── zstd.go
│   │   └── zstd_test.go
│   ├── strengthen/
│   │   ├── du.go
│   │   ├── du_test.go
│   │   ├── du_windows.go
│   │   ├── duration.go
│   │   ├── duration_test.go
│   │   ├── formatsize.go
│   │   ├── fs_unix.go
│   │   ├── fs_windows.go
│   │   ├── limitwriter.go
│   │   ├── measure.go
│   │   ├── net.go
│   │   ├── os_unix.go
│   │   ├── os_windows.go
│   │   ├── path.go
│   │   ├── path_test.go
│   │   ├── rid.go
│   │   ├── rid_test.go
│   │   ├── statfs.go
│   │   ├── statfs_linux.go
│   │   ├── statfs_openbsd.go
│   │   ├── statfs_test.go
│   │   ├── statfs_unix.go
│   │   ├── statfs_windows.go
│   │   └── strings.go
│   ├── symlink/
│   │   ├── LICENSE
│   │   ├── LICENSE.APACHE
│   │   ├── LICENSE.BSD
│   │   ├── doc.go
│   │   ├── fs.go
│   │   ├── fs_unix.go
│   │   └── fs_windows.go
│   ├── systemproxy/
│   │   ├── dialer.go
│   │   ├── env.go
│   │   ├── http.go
│   │   ├── http_test.go
│   │   ├── internal/
│   │   │   ├── readme.md
│   │   │   └── socks/
│   │   │       ├── client.go
│   │   │       └── socks.go
│   │   ├── pre_host.go
│   │   ├── pre_host_test.go
│   │   ├── proxy.go
│   │   ├── proxy_darwin.go
│   │   ├── proxy_darwin_test.go
│   │   ├── proxy_others.go
│   │   ├── proxy_test.go
│   │   ├── proxy_windows.go
│   │   ├── socks5.go
│   │   ├── url.go
│   │   └── url_test.go
│   ├── term/
│   │   ├── color.go
│   │   ├── fmt.go
│   │   ├── fmt_test.go
│   │   ├── sanitized.go
│   │   ├── terminal.go
│   │   ├── terminal_others.go
│   │   └── terminal_windows.go
│   ├── trace/
│   │   ├── error.go
│   │   ├── trace.go
│   │   └── trace_test.go
│   ├── tui/
│   │   ├── color.go
│   │   ├── confirm.go
│   │   ├── input.go
│   │   └── pager.go
│   ├── vfs/
│   │   ├── LICENSE
│   │   ├── bound.go
│   │   ├── bound_test.go
│   │   ├── glob.go
│   │   └── vfs.go
│   ├── viewport/
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── configuration.go
│   │   ├── content_manager.go
│   │   ├── display_manager.go
│   │   ├── filterableviewport/
│   │   │   ├── filterableviewport.go
│   │   │   ├── filterableviewport_filterlineposition_test.go
│   │   │   ├── filterableviewport_filterlineprefix_test.go
│   │   │   ├── filterableviewport_saving_test.go
│   │   │   ├── filterableviewport_searchhistory_test.go
│   │   │   ├── filterableviewport_test.go
│   │   │   ├── filtermode.go
│   │   │   ├── keymap.go
│   │   │   └── styles.go
│   │   ├── highlight.go
│   │   ├── internal/
│   │   │   ├── fuzzy/
│   │   │   │   ├── fuzzy.go
│   │   │   │   └── fuzzy_test.go
│   │   │   └── test_util.go
│   │   ├── item/
│   │   │   ├── ansi.go
│   │   │   ├── ansi_test.go
│   │   │   ├── concat.go
│   │   │   ├── concat_test.go
│   │   │   ├── item.go
│   │   │   ├── item_bench_test.go
│   │   │   ├── model.go
│   │   │   ├── multiline.go
│   │   │   ├── multiline_test.go
│   │   │   ├── safecast.go
│   │   │   ├── safecast_test.go
│   │   │   ├── single.go
│   │   │   ├── single_test.go
│   │   │   ├── string.go
│   │   │   └── string_test.go
│   │   ├── keymap.go
│   │   ├── navigation_manager.go
│   │   ├── object.go
│   │   ├── styles.go
│   │   ├── viewport.go
│   │   ├── viewport_multiline_test.go
│   │   ├── viewport_no_selection_no_wrap_test.go
│   │   ├── viewport_no_selection_wrap_test.go
│   │   ├── viewport_postheader_test.go
│   │   ├── viewport_prefooter_test.go
│   │   ├── viewport_progressbar_test.go
│   │   ├── viewport_saving_test.go
│   │   ├── viewport_selection_no_wrap_test.go
│   │   ├── viewport_selection_wrap_test.go
│   │   └── viewport_test_util_test.go
│   ├── wildmatch/
│   │   ├── LICENSE.md
│   │   ├── package.go
│   │   ├── wildmatch.go
│   │   ├── wildmatch_casefold.go
│   │   ├── wildmatch_nocasefold.go
│   │   └── wildmatch_test.go
│   └── zeta/
│       ├── backend/
│       │   ├── decode.go
│       │   ├── encode.go
│       │   ├── errors.go
│       │   ├── file_storer.go
│       │   ├── odb.go
│       │   ├── odb_test.go
│       │   ├── pack/
│       │   │   ├── bounds.go
│       │   │   ├── encode.go
│       │   │   ├── errors.go
│       │   │   ├── index.go
│       │   │   ├── index_version.go
│       │   │   ├── pack_test.go
│       │   │   ├── packfile.go
│       │   │   ├── reader.go
│       │   │   ├── set.go
│       │   │   └── storage.go
│       │   ├── pack-objects.go
│       │   ├── pack-objects_test.go
│       │   ├── prune.go
│       │   ├── storage/
│       │   │   └── storage.go
│       │   └── unpack.go
│       ├── config/
│       │   ├── boolean_test.go
│       │   ├── codec_toml.go
│       │   ├── codec_toml_test.go
│       │   ├── compat_test.go
│       │   ├── config.go
│       │   ├── config_test.toml
│       │   ├── config_test_bad.toml
│       │   ├── decode.go
│       │   ├── decode_test.go
│       │   ├── display.go
│       │   ├── document.go
│       │   ├── document_test.go
│       │   ├── encode.go
│       │   ├── encode_test.go
│       │   ├── type.go
│       │   ├── type_test.go
│       │   ├── validate.go
│       │   ├── value.go
│       │   └── value_test.go
│       ├── error.go
│       ├── object/
│       │   ├── blob.go
│       │   ├── change.go
│       │   ├── change_adaptor.go
│       │   ├── commit.go
│       │   ├── commit_test.go
│       │   ├── commit_walker.go
│       │   ├── commit_walker_atime.go
│       │   ├── commit_walker_bfs.go
│       │   ├── commit_walker_bfs_filtered.go
│       │   ├── commit_walker_ctime.go
│       │   ├── commit_walker_limit.go
│       │   ├── commit_walker_path.go
│       │   ├── commit_walker_test.go
│       │   ├── commit_walker_topo_order.go
│       │   ├── difftree.go
│       │   ├── file.go
│       │   ├── fragments.go
│       │   ├── merge_base.go
│       │   ├── object.go
│       │   ├── patch.go
│       │   ├── patch_test.go
│       │   ├── rename.go
│       │   ├── storage.go
│       │   ├── tag.go
│       │   ├── tree.go
│       │   ├── tree_test.go
│       │   └── treenode.go
│       ├── reflog/
│       │   ├── reflog.go
│       │   └── reflog_test.go
│       └── refs/
│           ├── backend.go
│           ├── error.go
│           ├── filesystem.go
│           ├── filesystem_test.go
│           ├── references.go
│           ├── rules.go
│           └── rules_test.go
├── pkg/
│   ├── command/
│   │   ├── README.md
│   │   ├── command.go
│   │   ├── command_add.go
│   │   ├── command_branch.go
│   │   ├── command_cat.go
│   │   ├── command_check_ignore.go
│   │   ├── command_checkout.go
│   │   ├── command_cherry_pick.go
│   │   ├── command_clean.go
│   │   ├── command_commit.go
│   │   ├── command_config.go
│   │   ├── command_diff.go
│   │   ├── command_fetch.go
│   │   ├── command_for_each_ref.go
│   │   ├── command_gc.go
│   │   ├── command_hash_object.go
│   │   ├── command_init.go
│   │   ├── command_log.go
│   │   ├── command_ls_files.go
│   │   ├── command_ls_tree.go
│   │   ├── command_merge.go
│   │   ├── command_merge_base.go
│   │   ├── command_merge_file.go
│   │   ├── command_merge_tree.go
│   │   ├── command_pull.go
│   │   ├── command_push.go
│   │   ├── command_rebase.go
│   │   ├── command_remote.go
│   │   ├── command_rename.go
│   │   ├── command_reset.go
│   │   ├── command_restore.go
│   │   ├── command_rev_parse.go
│   │   ├── command_revert.go
│   │   ├── command_rm.go
│   │   ├── command_show.go
│   │   ├── command_stash.go
│   │   ├── command_status.go
│   │   ├── command_switch.go
│   │   ├── command_tag.go
│   │   ├── command_version.go
│   │   └── msic.go
│   ├── kong/
│   │   ├── COPYING
│   │   ├── FORK.md
│   │   ├── README.md
│   │   ├── build.go
│   │   ├── callbacks.go
│   │   ├── camelcase.go
│   │   ├── context.go
│   │   ├── defaults.go
│   │   ├── doc.go
│   │   ├── error.go
│   │   ├── exit.go
│   │   ├── global.go
│   │   ├── guesswidth.go
│   │   ├── help.go
│   │   ├── hooks.go
│   │   ├── interpolate.go
│   │   ├── kong.go
│   │   ├── levenshtein.go
│   │   ├── mapper.go
│   │   ├── model.go
│   │   ├── negatable.go
│   │   ├── options.go
│   │   ├── resolver.go
│   │   ├── scanner.go
│   │   ├── tag.go
│   │   ├── util.go
│   │   └── visit.go
│   ├── migrate/
│   │   ├── migrate.go
│   │   └── progressbar.go
│   ├── progress/
│   │   ├── indicators.go
│   │   ├── multibar.go
│   │   ├── progressbar.go
│   │   └── progressbar_test.go
│   ├── serve/
│   │   ├── argon2id/
│   │   │   ├── LICENSE
│   │   │   ├── VERSION
│   │   │   ├── argon2id.go
│   │   │   └── argon2id_test.go
│   │   ├── config.go
│   │   ├── database/
│   │   │   ├── access_level.go
│   │   │   ├── branches.go
│   │   │   ├── database.go
│   │   │   ├── error.go
│   │   │   ├── keys.go
│   │   │   ├── member.go
│   │   │   ├── namespaces.go
│   │   │   ├── reference.go
│   │   │   ├── repositories.go
│   │   │   ├── tags.go
│   │   │   ├── types.go
│   │   │   ├── update.go
│   │   │   ├── user.go
│   │   │   ├── user_test.go
│   │   │   └── zeta.sql
│   │   ├── encrypt.go
│   │   ├── encrypt_test.go
│   │   ├── httpserver/
│   │   │   ├── auth.go
│   │   │   ├── bearer.go
│   │   │   ├── config.go
│   │   │   ├── management.go
│   │   │   ├── metadata.go
│   │   │   ├── request.go
│   │   │   ├── response.go
│   │   │   ├── server.go
│   │   │   └── transfer.go
│   │   ├── languages/
│   │   │   └── zh-CN.toml
│   │   ├── languages.go
│   │   ├── languages_test.go
│   │   ├── odb/
│   │   │   ├── cache.go
│   │   │   ├── database.go
│   │   │   ├── decode.go
│   │   │   ├── encode.go
│   │   │   ├── odb.go
│   │   │   ├── oss.go
│   │   │   ├── quarantine.go
│   │   │   └── unpack.go
│   │   ├── protocol/
│   │   │   ├── input.go
│   │   │   ├── pack.go
│   │   │   ├── protocol.go
│   │   │   └── range.go
│   │   ├── repo/
│   │   │   ├── push.go
│   │   │   ├── repositories.go
│   │   │   ├── resources/
│   │   │   │   ├── README.md
│   │   │   │   └── zetaignore
│   │   │   └── revision.go
│   │   └── sshserver/
│   │       ├── auth.go
│   │       ├── command.go
│   │       ├── command_ls-remote.go
│   │       ├── command_metadata.go
│   │       ├── command_objects.go
│   │       ├── command_push.go
│   │       ├── command_test.go
│   │       ├── config.go
│   │       ├── parseargv.go
│   │       ├── rainbow/
│   │       │   ├── art.go
│   │       │   ├── art_test.go
│   │       │   └── rainbow.go
│   │       ├── server.go
│   │       └── session.go
│   ├── tr/
│   │   ├── README.md
│   │   ├── languages/
│   │   │   └── zh-CN.toml
│   │   ├── translate.go
│   │   └── translate_test.go
│   ├── transport/
│   │   ├── client/
│   │   │   └── client.go
│   │   ├── endpoint.go
│   │   ├── http/
│   │   │   ├── auth.go
│   │   │   ├── base.go
│   │   │   ├── base_test.go
│   │   │   ├── blob.go
│   │   │   ├── external.go
│   │   │   ├── external_test.go
│   │   │   ├── metadata.go
│   │   │   ├── netrc.go
│   │   │   ├── netrc_test.go
│   │   │   ├── push.go
│   │   │   ├── reference.go
│   │   │   └── trace.go
│   │   ├── ssh/
│   │   │   ├── auth.go
│   │   │   ├── base.go
│   │   │   ├── command.go
│   │   │   ├── command_test.go
│   │   │   ├── config/
│   │   │   │   ├── AUTHORS.txt
│   │   │   │   ├── CHANGELOG.md
│   │   │   │   ├── LICENSE
│   │   │   │   ├── Makefile
│   │   │   │   ├── README.md
│   │   │   │   ├── config.go
│   │   │   │   ├── config_test.go
│   │   │   │   ├── config_unix.go
│   │   │   │   ├── config_windows.go
│   │   │   │   ├── lexer.go
│   │   │   │   ├── parser.go
│   │   │   │   ├── parser_test.go
│   │   │   │   ├── position.go
│   │   │   │   ├── testdata/
│   │   │   │   │   ├── anotherfile
│   │   │   │   │   ├── config-no-ending-newline
│   │   │   │   │   ├── config1
│   │   │   │   │   ├── config1-with-match-directive
│   │   │   │   │   ├── config2
│   │   │   │   │   ├── config3
│   │   │   │   │   ├── config4
│   │   │   │   │   ├── dos-lines
│   │   │   │   │   ├── eol-comments
│   │   │   │   │   ├── eqsign
│   │   │   │   │   ├── extraspace
│   │   │   │   │   ├── fuzz/
│   │   │   │   │   │   └── FuzzDecode/
│   │   │   │   │   │       ├── 3cfc035ae4867ca13fa7bfaf2793731f05fd4d59c3af8761ea365c7485c752fd
│   │   │   │   │   │       └── 4f8b378d89916e9b4fd796f74f5b12efb5cd85faaba9fea8fbe419d6af63add8
│   │   │   │   │   ├── identities
│   │   │   │   │   ├── include
│   │   │   │   │   ├── include-recursive
│   │   │   │   │   ├── invalid-port
│   │   │   │   │   ├── match-directive
│   │   │   │   │   ├── negated
│   │   │   │   │   └── system-include
│   │   │   │   ├── token.go
│   │   │   │   ├── validators.go
│   │   │   │   └── validators_test.go
│   │   │   ├── knownhosts/
│   │   │   │   ├── LICENSE
│   │   │   │   ├── knownhosts.go
│   │   │   │   └── knownhosts_test.go
│   │   │   ├── metadata.go
│   │   │   ├── objects.go
│   │   │   └── push.go
│   │   ├── struct.go
│   │   ├── struct_test.go
│   │   ├── transport.go
│   │   └── util.go
│   ├── version/
│   │   ├── uname.go
│   │   ├── uname_linux.go
│   │   ├── uname_test.go
│   │   ├── uname_unix.go
│   │   ├── uname_windows.go
│   │   ├── verison.go
│   │   └── version_test.go
│   └── zeta/
│       ├── aria2.go
│       ├── blame.go
│       ├── blame_test.go
│       ├── branch.go
│       ├── cat.go
│       ├── cdc.go
│       ├── config.go
│       ├── display.go
│       ├── dragonfly.go
│       ├── editor.go
│       ├── fetch.go
│       ├── gc.go
│       ├── log.go
│       ├── log_test.go
│       ├── lstree.go
│       ├── merge_file.go
│       ├── merge_tree.go
│       ├── misc.go
│       ├── misc_test.go
│       ├── objects.go
│       ├── odb/
│       │   ├── commit.go
│       │   ├── counting-objects.go
│       │   ├── decode.go
│       │   ├── index.go
│       │   ├── merge.go
│       │   ├── merge_driver.go
│       │   ├── merge_test.go
│       │   ├── merge_text.go
│       │   ├── odb.go
│       │   ├── pack.go
│       │   ├── references.go
│       │   ├── transfer.go
│       │   ├── tree.go
│       │   ├── unpack.go
│       │   ├── unpack_test.go
│       │   └── util.go
│       ├── options.go
│       ├── pager.go
│       ├── promisor.go
│       ├── push.go
│       ├── references.go
│       ├── references_test.go
│       ├── repository.go
│       ├── revision.go
│       ├── revision_test.go
│       ├── safetensors.go
│       ├── safetensors_test.go
│       ├── show.go
│       ├── showdiff.go
│       ├── status.go
│       ├── switch.go
│       ├── switch_test.go
│       ├── tag.go
│       ├── transfer.go
│       ├── tree.go
│       ├── update.go
│       ├── worktree.go
│       ├── worktree_bsd.go
│       ├── worktree_checkout.go
│       ├── worktree_co-extra.go
│       ├── worktree_commit.go
│       ├── worktree_diff.go
│       ├── worktree_drawin.go
│       ├── worktree_linux.go
│       ├── worktree_ls_files.go
│       ├── worktree_merge.go
│       ├── worktree_pull.go
│       ├── worktree_rebase.go
│       ├── worktree_rename.go
│       ├── worktree_replay.go
│       ├── worktree_restore.go
│       ├── worktree_stash.go
│       ├── worktree_status.go
│       ├── worktree_test.go
│       ├── worktree_tree.go
│       ├── worktree_unix_other.go
│       └── worktree_windows.go
├── script/
│   ├── inno.sh
│   ├── release.bat
│   ├── release.ps1
│   ├── release.sh
│   └── zeta.iss
├── share/
│   ├── zeta-serve-httpd.toml
│   └── zeta-serve-sshd.toml
└── utils/
    ├── auth/
    │   └── auth.go
    ├── bar2/
    │   └── main.go
    ├── cli/
    │   └── command_test.go
    ├── darwinproxy/
    │   └── darwinproxy_test.go
    ├── diffbug/
    │   ├── a.txt
    │   ├── b.txt
    │   ├── c.txt
    │   └── difffix_test.go
    ├── fs_warning/
    │   └── main.go
    ├── keyring/
    │   └── main.go
    ├── lcs/
    │   └── lcs.go
    ├── match/
    │   └── match_test.go
    ├── mimex/
    │   ├── a.txt
    │   ├── a16.txt
    │   ├── a8.txt
    │   ├── b.txt
    │   ├── b16.txt
    │   ├── conflict-16-8-16.txt
    │   ├── conflict-16.txt
    │   ├── conflict.txt
    │   ├── mime_test.go
    │   ├── o16.txt
    │   └── origin.txt
    ├── rename/
    │   ├── rename_test.go
    │   └── rename_windows.go
    ├── setv/
    │   └── main.go
    └── term/
        └── detect.go
Download .txt
Showing preview only (741K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (8556 symbols across 836 files)

FILE: cmd/hot/command/command.go
  type Globals (line 25) | type Globals struct
    method RunEx (line 55) | func (g *Globals) RunEx(ctx context.Context, repoPath string, cmdArg0 ...
  type VersionFlag (line 30) | type VersionFlag
    method Decode (line 32) | func (v VersionFlag) Decode(ctx *kong.DecodeContext) error { return nil }
    method IsBool (line 33) | func (v VersionFlag) IsBool() bool                         { return tr...
    method BeforeApply (line 34) | func (v VersionFlag) BeforeApply(app *kong.Kong, vars kong.Vars) error {
  function pickURI (line 40) | func pickURI(rawURL string) (string, error) {

FILE: cmd/hot/command/command_az.go
  type Az (line 14) | type Az struct
    method Run (line 20) | func (c *Az) Run(g *Globals) error {
    method azOnce (line 30) | func (c *Az) azOnce(p string) error {

FILE: cmd/hot/command/command_cat.go
  constant MAX_SHOW_BINARY_BLOB (line 29) | MAX_SHOW_BINARY_BLOB = 10<<20 - 8
  type Cat (line 32) | type Cat struct
    method Run (line 44) | func (c *Cat) Run(g *Globals) error {
    method Println (line 64) | func (c *Cat) Println(a ...any) error {
    method NewFD (line 74) | func (c *Cat) NewFD() (io.WriteCloser, term.Level, error) {
    method showObject (line 90) | func (c *Cat) showObject(a any) error {
    method isMarkdown (line 133) | func (c *Cat) isMarkdown() bool {
    method getLexer (line 150) | func (c *Cat) getLexer() chroma.Lexer {
    method markdownOut (line 168) | func (c *Cat) markdownOut(w io.Writer, input io.Reader) error {
    method syntaxHighlightOut (line 202) | func (c *Cat) syntaxHighlightOut(w io.Writer, input io.Reader, termLev...
    method formatObject (line 251) | func (c *Cat) formatObject(o *git.Object) error {
  constant binaryTruncated (line 83) | binaryTruncated = "*** Binary truncated ***"
  type sizer (line 86) | type sizer interface

FILE: cmd/hot/command/command_co.go
  type Co (line 17) | type Co struct
    method concatDestination (line 29) | func (c *Co) concatDestination(baseName string) (string, error) {
    method decodeRemote (line 57) | func (c *Co) decodeRemote() (remote string, uri string, err error) {
    method Run (line 73) | func (c *Co) Run(g *Globals) error {

FILE: cmd/hot/command/command_diff.go
  type Diff (line 20) | type Diff struct
    method Run (line 28) | func (c *Diff) Run(g *Globals) error {

FILE: cmd/hot/command/command_expire_refs.go
  type ExpireRefs (line 17) | type ExpireRefs struct
    method fixup (line 25) | func (c *ExpireRefs) fixup() {
    method Match (line 33) | func (c *ExpireRefs) Match(name string) bool {
    method Expire (line 45) | func (c *ExpireRefs) Expire(ref *refs.Reference) bool {
    method Run (line 59) | func (c *ExpireRefs) Run(g *Globals) error {

FILE: cmd/hot/command/command_graft.go
  type Graft (line 17) | type Graft struct
    method Run (line 27) | func (c *Graft) Run(g *Globals) error {
    method doOnce (line 36) | func (c *Graft) doOnce(g *Globals, p string) error {

FILE: cmd/hot/command/command_mc.go
  type Mc (line 20) | type Mc struct
    method concatDestination (line 28) | func (c *Mc) concatDestination(baseName string) (string, error) {
    method cloneAndMigrate (line 59) | func (c *Mc) cloneAndMigrate(g *Globals, uri string) error {
    method Run (line 77) | func (c *Mc) Run(g *Globals) error {
    method migrateFrom (line 102) | func (c *Mc) migrateFrom(g *Globals, from, to string) error {

FILE: cmd/hot/command/command_prune_refs.go
  constant pruneTargetPrefix (line 24) | pruneTargetPrefix = "refs/pull/"
  type Reference (line 65) | type Reference struct
  function parseReferenceLine (line 73) | func parseReferenceLine(referenceLine string) (*Reference, error) {
  function GetReferences (line 87) | func GetReferences(ctx context.Context, repoPath string, m func(*Referen...
  function isDirtyReference (line 108) | func isDirtyReference(name string) bool {
  function prefixesMatch (line 114) | func prefixesMatch(name string, prefixes []string) bool {
  type PruneRefs (line 120) | type PruneRefs struct
    method preparePrefixes (line 129) | func (c *PruneRefs) preparePrefixes() (prefixes []string) {
    method record (line 147) | func (c *PruneRefs) record(repoPath string, refs []*Reference) error {
    method pruneRefs (line 166) | func (c *PruneRefs) pruneRefs(ctx context.Context, repoPath string, re...
    method Run (line 200) | func (c *PruneRefs) Run(g *Globals) error {

FILE: cmd/hot/command/command_remove.go
  type Remove (line 15) | type Remove struct
    method Run (line 24) | func (c *Remove) Run(g *Globals) error {

FILE: cmd/hot/command/command_scan_refs.go
  function newModel (line 24) | func newModel(references *refs.References) model {
  type model (line 38) | type model struct
    method Init (line 45) | func (m model) Init() tea.Cmd {
    method Update (line 49) | func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
    method buildTable (line 86) | func (m model) buildTable() table.Model {
    method View (line 167) | func (m model) View() tea.View {
  function getTerminalWidth (line 186) | func getTerminalWidth() int {
  type ScanRefs (line 193) | type ScanRefs struct
    method fixup (line 199) | func (c *ScanRefs) fixup() {
    method Match (line 207) | func (c *ScanRefs) Match(name string) bool {
    method Run (line 219) | func (c *ScanRefs) Run(g *Globals) error {

FILE: cmd/hot/command/command_show.go
  type Show (line 20) | type Show struct
    method Run (line 26) | func (c *Show) Run(g *Globals) error {

FILE: cmd/hot/command/command_size.go
  type Size (line 15) | type Size struct
    method Run (line 22) | func (c *Size) Run(g *Globals) error {
    method sizeOnce (line 32) | func (c *Size) sizeOnce(p string) error {

FILE: cmd/hot/command/command_smart.go
  type Smart (line 18) | type Smart struct
    method Run (line 27) | func (c *Smart) Run(g *Globals) error {
    method doOnce (line 80) | func (c *Smart) doOnce(g *Globals, p string) error {
  function multiSelect (line 36) | func multiSelect(i int, totalBatches int, input []string) ([]string, err...
  function newMatcher (line 50) | func newMatcher(sz *stat.SizeExecutor, matchAll bool) replay.Matcher {

FILE: cmd/hot/command/command_snapshot.go
  constant snapshotSummaryFormat (line 21) | snapshotSummaryFormat = `%shot snapshot [<options>]
  type Snapshot (line 27) | type Snapshot struct
    method Summary (line 40) | func (c *Snapshot) Summary() string {
    method Passthrough (line 45) | func (c *Snapshot) Passthrough(paths []string) {
    method genMessage (line 116) | func (c *Snapshot) genMessage() (message string, err error) {
    method snapshotWriteIndex (line 138) | func (c *Snapshot) snapshotWriteIndex(ctx context.Context, snapshotEnv...
    method addALL (line 158) | func (c *Snapshot) addALL(ctx context.Context, snapshotEnv []string) e...
    method writeTree (line 168) | func (c *Snapshot) writeTree(ctx context.Context, snapshotEnv []string...
    method doSnapshot (line 182) | func (c *Snapshot) doSnapshot(ctx context.Context, basePoint string) (...
    method Run (line 240) | func (c *Snapshot) Run(g *Globals) error {
  function messageReadFrom (line 49) | func messageReadFrom(r io.Reader) (string, error) {
  function messageReadFromPath (line 80) | func messageReadFromPath(p string) (string, error) {
  function genMessage (line 89) | func genMessage(message []string) string {

FILE: cmd/hot/command/command_stat.go
  type Stat (line 11) | type Stat struct
    method Run (line 16) | func (c *Stat) Run(g *Globals) error {

FILE: cmd/hot/command/command_unbranch.go
  type Unbranch (line 17) | type Unbranch struct
    method Run (line 26) | func (c *Unbranch) Run(g *Globals) error {

FILE: cmd/hot/command/misc.go
  constant Byte (line 27) | Byte int64 = 1 << (iota * 10)
  constant KiByte (line 28) | KiByte
  constant MiByte (line 29) | MiByte
  constant GiByte (line 30) | GiByte
  constant TiByte (line 31) | TiByte
  constant PiByte (line 32) | PiByte
  constant EiByte (line 33) | EiByte
  function decodeSize (line 48) | func decodeSize(text string) (int64, error) {
  function SizeDecoder (line 62) | func SizeDecoder() kong.MapperFunc {
  function parseTime (line 97) | func parseTime(str string) (int64, error) {
  function ExpireDecoder (line 123) | func ExpireDecoder() kong.MapperFunc {
  type NopWriteCloser (line 152) | type NopWriteCloser struct
    method Close (line 156) | func (NopWriteCloser) Close() error {
  function W (line 160) | func W(a string) string {
  function die (line 164) | func die(format string, a ...any) {

FILE: cmd/hot/command/pager.go
  type Printer (line 14) | type Printer interface
  type WrapPrinter (line 20) | type WrapPrinter struct
    method ColorMode (line 24) | func (WrapPrinter) ColorMode() term.Level {
    method EnableColor (line 28) | func (WrapPrinter) EnableColor() bool {
  function lookupPager (line 33) | func lookupPager() (string, bool) {
  type printer (line 41) | type printer struct
    method EnableColor (line 47) | func (p *printer) EnableColor() bool {
    method ColorMode (line 51) | func (p *printer) ColorMode() term.Level {
    method Write (line 55) | func (p *printer) Write(b []byte) (n int, err error) {
    method Close (line 59) | func (p *printer) Close() error {
  function NewPrinter (line 66) | func NewPrinter(ctx context.Context) *printer {

FILE: cmd/hot/hot.go
  type App (line 17) | type App struct
  function main (line 38) | func main() {

FILE: cmd/hot/pkg/co/co.go
  type CoOptions (line 18) | type CoOptions struct
  function run (line 38) | func run(ctx context.Context, repoPath string, cmdArg0 string, args ...s...
  function fetch (line 56) | func fetch(ctx context.Context, o *CoOptions) error {
  function Co (line 118) | func Co(ctx context.Context, o *CoOptions) error {
  function sparseCheckout (line 125) | func sparseCheckout(ctx context.Context, o *CoOptions) error {
  function clone (line 163) | func clone(ctx context.Context, o *CoOptions) error {

FILE: cmd/hot/pkg/co/misc.go
  function NewUserAgent (line 10) | func NewUserAgent() (string, bool) {

FILE: cmd/hot/pkg/co/misc_test.go
  function TestNewUserAgent (line 9) | func TestNewUserAgent(t *testing.T) {

FILE: cmd/hot/pkg/diff/diff.go
  type Patch (line 22) | type Patch struct
    method Reset (line 38) | func (p *Patch) Reset() {
    method ClearPatch (line 43) | func (p *Patch) ClearPatch() {
  type Parser (line 50) | type Parser struct
    method Parse (line 125) | func (parser *Parser) Parse() bool {
    method Patch (line 197) | func (parser *Parser) Patch() *Patch {
    method Err (line 202) | func (parser *Parser) Err() error {
    method currentPatchFromPath (line 206) | func (parser *Parser) currentPatchFromPath() []byte {
    method cacheRawLines (line 216) | func (parser *Parser) cacheRawLines(reader *bufio.Reader) {
    method nextRawLine (line 246) | func (parser *Parser) nextRawLine() []byte {
    method initializeCurrentPatch (line 255) | func (parser *Parser) initializeCurrentPatch() error {
    method readDiffHeaderFromPath (line 276) | func (parser *Parser) readDiffHeaderFromPath() ([]byte, error) {
    method handleTypeChangeDiff (line 440) | func (parser *Parser) handleTypeChangeDiff() {
    method prunePatch (line 641) | func (parser *Parser) prunePatch() {
    method isOverSafeLimits (line 653) | func (parser *Parser) isOverSafeLimits() bool {
    method maxPatchBytesForCurrentFile (line 659) | func (parser *Parser) maxPatchBytesForCurrentFile() int {
  type Limits (line 67) | type Limits struct
    method enforceUpperBound (line 631) | func (limit *Limits) enforceUpperBound() {
  constant maxFilesUpperBound (line 95) | maxFilesUpperBound      = 5000
  constant maxLinesUpperBound (line 96) | maxLinesUpperBound      = 250000
  constant maxBytesUpperBound (line 97) | maxBytesUpperBound      = 5000 * 5120
  constant safeMaxFilesUpperBound (line 98) | safeMaxFilesUpperBound  = 500
  constant safeMaxLinesUpperBound (line 99) | safeMaxLinesUpperBound  = 25000
  constant safeMaxBytesUpperBound (line 100) | safeMaxBytesUpperBound  = 500 * 5120
  constant maxPatchBytesUpperBound (line 101) | maxPatchBytesUpperBound = 512000
  function NewParser (line 110) | func NewParser(hashFormat git.HashFormat, src io.Reader, limits Limits) ...
  function parseDiffHeaderPath (line 333) | func parseDiffHeaderPath(line []byte) ([]byte, error) {
  function parseTwoPaths (line 371) | func parseTwoPaths(line []byte) ([][]byte, error) {
  function parseQuotedPath (line 406) | func parseQuotedPath(line []byte) ([]byte, []byte, error) {
  function parseUnquotedPath (line 432) | func parseUnquotedPath(line []byte) ([]byte, []byte) {
  function parseRawLine (line 462) | func parseRawLine(hashFormat git.HashFormat, line []byte, patch *Patch) ...
  function readNextDiff (line 526) | func readNextDiff(reader *bufio.Reader, patch *Patch, skipPatch bool) er...
  function consumeChunkLine (line 588) | func consumeChunkLine(reader *bufio.Reader, patch *Patch, skipPatch, upd...
  function discardLine (line 623) | func discardLine(reader *bufio.Reader) error {
  function exceeded (line 649) | func exceeded(current, limit int) bool {
  function unescape (line 683) | func unescape(s []byte) []byte {
  function isOctalDigit (line 734) | func isOctalDigit(b byte) bool {
  function unquoteBytes (line 739) | func unquoteBytes(s []byte) []byte {
  function parseHunks (line 747) | func parseHunks(lines []string) ([]*diferenco.Hunk, error) {
  function parseHunkHeader (line 812) | func parseHunkHeader(header string) (fromLine, fromCount, toLine, toCoun...
  function parseRange (line 851) | func parseRange(s string, prefix byte) (start, count int, err error) {

FILE: cmd/hot/pkg/diff/parser_test.go
  function rawLine (line 13) | func rawLine(oldMode, newMode int, oldOID, newOID, status, path string) ...
  function rawLineRename (line 18) | func rawLineRename(oldMode, newMode int, oldOID, newOID, status, fromPat...
  function TestParserBasic (line 24) | func TestParserBasic(t *testing.T) {
  function TestParserModify (line 54) | func TestParserModify(t *testing.T) {
  function TestParserAdd (line 91) | func TestParserAdd(t *testing.T) {
  function TestParserDelete (line 123) | func TestParserDelete(t *testing.T) {
  function TestParserBinary (line 155) | func TestParserBinary(t *testing.T) {
  function TestParserLimits (line 179) | func TestParserLimits(t *testing.T) {
  function TestParseHunks (line 211) | func TestParseHunks(t *testing.T) {
  function TestParseHunksWithSection (line 266) | func TestParseHunksWithSection(t *testing.T) {
  function TestParseHunksWithEmptySection (line 297) | func TestParseHunksWithEmptySection(t *testing.T) {
  function TestUnescape (line 320) | func TestUnescape(t *testing.T) {
  function TestLimitsEnforceUpperBound (line 343) | func TestLimitsEnforceUpperBound(t *testing.T) {
  function TestParserConsecutiveEmptyPatches (line 361) | func TestParserConsecutiveEmptyPatches(t *testing.T) {
  function TestParserQuotedPaths (line 397) | func TestParserQuotedPaths(t *testing.T) {
  function TestParserQuotedPathsWithEscapes (line 435) | func TestParserQuotedPathsWithEscapes(t *testing.T) {
  function TestParserRenameWithPatch (line 507) | func TestParserRenameWithPatch(t *testing.T) {
  function TestParserCopyWithPatch (line 541) | func TestParserCopyWithPatch(t *testing.T) {
  function TestParserNoNewlineAtEOF (line 574) | func TestParserNoNewlineAtEOF(t *testing.T) {
  function TestParserTypeChange (line 625) | func TestParserTypeChange(t *testing.T) {
  function TestParserEnforceLimitsZeroMeansUnlimited (line 662) | func TestParserEnforceLimitsZeroMeansUnlimited(t *testing.T) {
  function TestParserPatchObjectIsReused (line 694) | func TestParserPatchObjectIsReused(t *testing.T) {
  function BenchmarkParser (line 733) | func BenchmarkParser(b *testing.B) {

FILE: cmd/hot/pkg/hud/bar.go
  type ProgressBar (line 13) | type ProgressBar struct
    method Add (line 39) | func (b *ProgressBar) Add(n int) {
    method Done (line 45) | func (b *ProgressBar) Done() {
  function NewBar (line 20) | func NewBar(description string, total int, stepCurrent, stepEnd int, ver...

FILE: cmd/hot/pkg/hud/display.go
  function typePadding (line 13) | func typePadding(e *git.TreeEntry, padding int) string {
  function encodeEntry (line 21) | func encodeEntry(w io.Writer, e *git.TreeEntry, t string, v term.Level) ...
  constant commitTypeName (line 52) | commitTypeName = "commit"
  function encodeTree (line 55) | func encodeTree(w io.Writer, t *git.Tree, v term.Level) error {
  function encodeTag (line 68) | func encodeTag(w io.Writer, t *git.Tag, v term.Level) error {
  function encodeCommit (line 79) | func encodeCommit(w io.Writer, c *git.Commit, v term.Level) (err error) {
  function Display (line 112) | func Display(w io.Writer, a any, v term.Level) error {

FILE: cmd/hot/pkg/mc/migrate.go
  type Migrator (line 26) | type Migrator struct
    method uncache (line 42) | func (m *Migrator) uncache(from []byte) ([]byte, bool) {
    method cache (line 49) | func (m *Migrator) cache(from, to []byte) {
    method Close (line 106) | func (m *Migrator) Close() error {
    method getAllCommits (line 117) | func (m *Migrator) getAllCommits(ctx context.Context) ([][]byte, error) {
    method hashObject (line 136) | func (m *Migrator) hashObject(oid []byte) ([]byte, error) {
    method hashObjects (line 173) | func (m *Migrator) hashObjects(ctx context.Context) error {
    method rewriteTree (line 218) | func (m *Migrator) rewriteTree(commitOID []byte, treeOID []byte) ([]by...
    method rewriteCommits (line 258) | func (m *Migrator) rewriteCommits(ctx context.Context) error {
    method getReferences (line 332) | func (m *Migrator) getReferences(ctx context.Context) ([]*git.Referenc...
    method encodeTag (line 348) | func (m *Migrator) encodeTag(tag *gitobj.Tag, newObj []byte) ([]byte, ...
    method rewriteTag (line 364) | func (m *Migrator) rewriteTag(oid []byte) ([]byte, error) {
    method rewriteOneRef (line 385) | func (m *Migrator) rewriteOneRef(ref *git.Reference) ([]byte, error) {
    method reconstruct (line 400) | func (m *Migrator) reconstruct(ctx context.Context) error {
    method Execute (line 445) | func (m *Migrator) Execute(ctx context.Context) error {
    method reset (line 458) | func (m *Migrator) reset(ctx context.Context) error {
    method cleanup (line 475) | func (m *Migrator) cleanup(ctx context.Context) error {
  type MigrateOptions (line 55) | type MigrateOptions struct
  function NewMigrator (line 64) | func NewMigrator(ctx context.Context, opts *MigrateOptions) (*Migrator, ...
  function countObjects (line 148) | func countObjects(ctx context.Context, repoPath string) int {

FILE: cmd/hot/pkg/refs/refs.go
  type CommitGPGSignature (line 18) | type CommitGPGSignature struct
  type Reference (line 23) | type Reference struct
    method Merged (line 38) | func (r *Reference) Merged() bool {
    method IsBranch (line 42) | func (r *Reference) IsBranch() bool {
    method IsTag (line 46) | func (r *Reference) IsTag() bool {
  type Matcher (line 50) | type Matcher interface
  type References (line 54) | type References struct
    method resolveRefCommit (line 60) | func (r *References) resolveRefCommit(odb *git.ODB, ref *git.Reference...
    method resolve (line 82) | func (r *References) resolve(ctx context.Context, repoPath string, odb...
  function ScanReferences (line 110) | func ScanReferences(ctx context.Context, repoPath string, m Matcher, ord...
  function RemoveBrokenRef (line 140) | func RemoveBrokenRef(repoPath string, refName string) error {

FILE: cmd/hot/pkg/replay/cache.go
  method cacheEntry (line 15) | func (r *Replayer) cacheEntry(path string, from, to *gitobj.TreeEntry) *...
  method uncacheEntry (line 27) | func (r *Replayer) uncacheEntry(path string, from *gitobj.TreeEntry) *gi...
  method entryKey (line 35) | func (r *Replayer) entryKey(path string, e *gitobj.TreeEntry) string {
  method cacheCommit (line 41) | func (r *Replayer) cacheCommit(from, to []byte) {
  method uncacheCommit (line 52) | func (r *Replayer) uncacheCommit(from []byte) ([]byte, bool) {
  function copyEntry (line 60) | func copyEntry(e *gitobj.TreeEntry) *gitobj.TreeEntry {
  function copyEntryMode (line 75) | func copyEntryMode(e *gitobj.TreeEntry, mode int32) *gitobj.TreeEntry {

FILE: cmd/hot/pkg/replay/cleanup.go
  method cleanup (line 16) | func (r *Replayer) cleanup(prune bool) error {

FILE: cmd/hot/pkg/replay/drop.go
  method rewriteTree (line 18) | func (r *Replayer) rewriteTree(m Matcher, commitOID []byte, treeOID []by...
  method rewriteCommits (line 72) | func (r *Replayer) rewriteCommits(m Matcher) error {
  method Drop (line 146) | func (r *Replayer) Drop(m Matcher, confirm bool, prune bool) error {

FILE: cmd/hot/pkg/replay/graft.go
  method resolveCommit (line 18) | func (r *Replayer) resolveCommit(ref *git.Reference) ([]byte, *gitobj.Co...
  method graftHEAD (line 41) | func (r *Replayer) graftHEAD() error {
  method graftCommits (line 99) | func (r *Replayer) graftCommits(refs []*git.Reference, headOnly bool) er...
  method Graft (line 165) | func (r *Replayer) Graft(m Matcher, confirm bool, prune bool, headOnly b...

FILE: cmd/hot/pkg/replay/misc.go
  type Matcher (line 15) | type Matcher interface
  type equaler (line 19) | type equaler struct
    method Match (line 33) | func (e *equaler) Match(entry *gitobj.TreeEntry, absPath string) bool {
  function NewEqualer (line 23) | func NewEqualer(paths []string) Matcher {
  function systemCaseEqual (line 55) | func systemCaseEqual(a, b string) bool {
  type matcher (line 62) | type matcher struct
    method Match (line 87) | func (m *matcher) Match(entry *gitobj.TreeEntry, absPath string) bool {
  function NewMatcher (line 67) | func NewMatcher(patterns []string) Matcher {

FILE: cmd/hot/pkg/replay/replay.go
  type Replayer (line 17) | type Replayer struct
    method Close (line 56) | func (r *Replayer) Close() error {
    method referencesToRewrite (line 63) | func (r *Replayer) referencesToRewrite() ([]*git.Reference, error) {
    method commitsToRewrite (line 80) | func (r *Replayer) commitsToRewrite() ([][]byte, error) {
  function NewReplayer (line 37) | func NewReplayer(ctx context.Context, repoPath string, stepEnd int, verb...

FILE: cmd/hot/pkg/replay/unbranch.go
  constant maxSizeForSquashedCommitMessage (line 24) | maxSizeForSquashedCommitMessage = 4 << 20
  method makeSquashMessage0 (line 26) | func (r *Replayer) makeSquashMessage0(commits []string, message string) ...
  method makeSquashMessage (line 54) | func (r *Replayer) makeSquashMessage(cc *gitobj.Commit) (string, error) {
  method commitsToLinear (line 68) | func (r *Replayer) commitsToLinear(revision string) ([][]byte, error) {
  method unbranch (line 93) | func (r *Replayer) unbranch(revision string, keep int) ([]byte, error) {
  type UnbranchOptions (line 156) | type UnbranchOptions struct
  method Unbranch (line 164) | func (r *Replayer) Unbranch(o *UnbranchOptions) error {
  method unbranchOne (line 201) | func (r *Replayer) unbranchOne(o *UnbranchOptions, top []byte) error {

FILE: cmd/hot/pkg/replay/update.go
  type refUpdater (line 22) | type refUpdater struct
    method UpdateRefs (line 44) | func (r *refUpdater) UpdateRefs(ctx context.Context, b *hud.ProgressBa...
    method updateOneTag (line 79) | func (r *refUpdater) updateOneTag(tag *gitobj.Tag, toObj []byte) ([]by...
    method rewriteTag (line 95) | func (r *refUpdater) rewriteTag(oid []byte) ([]byte, error) {
    method updateOneRef (line 116) | func (r *refUpdater) updateOneRef(u *git.RefUpdater, maxNameLen int, s...

FILE: cmd/hot/pkg/stat/az.go
  function showHugeObjects (line 14) | func showHugeObjects(ctx context.Context, repoPath string, objects map[s...
  function Az (line 27) | func Az(ctx context.Context, repoPath string, limit int64, fullPath bool...

FILE: cmd/hot/pkg/stat/color.go
  function red (line 10) | func red(s string) string {
  function yellow (line 20) | func yellow(s string) string {
  function green (line 31) | func green(s string) string {
  function colorE (line 42) | func colorE(s string) string {
  function blue (line 53) | func blue(s string) string {
  function green2 (line 64) | func green2(s string) string {
  function colorSize (line 75) | func colorSize(i int64) string {
  function colorSizeU (line 79) | func colorSizeU(i uint64) string {
  function colorInt (line 83) | func colorInt[I int | uint64 | int64](i I) string {

FILE: cmd/hot/pkg/stat/draw.go
  type Item (line 16) | type Item struct
  type Items (line 23) | type Items
    method Len (line 26) | func (m Items) Len() int { return len(m) }
    method Less (line 29) | func (m Items) Less(i, j int) bool { return m[i].Total > m[j].Total }
    method Swap (line 32) | func (m Items) Swap(i, j int) { m[i], m[j] = m[j], m[i] }
  type sizeCounter (line 34) | type sizeCounter struct
  type summer (line 39) | type summer struct
    method add (line 50) | func (s *summer) add(file string, size int64) {
    method printName (line 63) | func (s *summer) printName(name, oid string, size int64) {
    method resolveName (line 75) | func (s *summer) resolveName(ctx context.Context, repoPath string, see...
  function newSummer (line 46) | func newSummer(fullPath bool) *summer {
  type Printer (line 61) | type Printer

FILE: cmd/hot/pkg/stat/size.go
  type SizeExecutor (line 24) | type SizeExecutor struct
    method Match (line 36) | func (e *SizeExecutor) Match(entry *gitobj.TreeEntry, absPath string) ...
    method Paths (line 43) | func (e *SizeExecutor) Paths() []string {
    method Run (line 48) | func (e *SizeExecutor) Run(ctx context.Context, repoPath string, extra...
    method currentCheck (line 111) | func (e *SizeExecutor) currentCheck(ctx context.Context, repoPath stri...
  function NewSizeExecutor (line 31) | func NewSizeExecutor(size int64, fullPath bool) *SizeExecutor {

FILE: cmd/hot/pkg/stat/stat.go
  type StatOptions (line 25) | type StatOptions struct
  type Values (line 30) | type Values
  function listConfig (line 32) | func listConfig(ctx context.Context, repoPath string) (Values, error) {
  function scanIdentity (line 70) | func scanIdentity(vs Values) {
  function safePassword (line 88) | func safePassword(s string) string {
  function checkRemote (line 95) | func checkRemote(vs Values) {
  function partialClone (line 121) | func partialClone(vs Values) (sparse bool, partial bool) {
  function parseShallowCommit (line 133) | func parseShallowCommit(repoPath string) string {
  function Stat (line 142) | func Stat(ctx context.Context, o *StatOptions) error {

FILE: cmd/hot/pkg/stat/stat_test.go
  function TestCheckEmail (line 9) | func TestCheckEmail(t *testing.T) {
  function TestSafePassword (line 37) | func TestSafePassword(t *testing.T) {
  function TestListConfig (line 46) | func TestListConfig(t *testing.T) {
  function TestTruncateName (line 57) | func TestTruncateName(t *testing.T) {

FILE: cmd/hot/pkg/stat/table.go
  method drawInteractive (line 19) | func (s *summer) drawInteractive(title string) error {
  function getTerminalWidth (line 114) | func getTerminalWidth() int {
  function truncatePath (line 123) | func truncatePath(path string, maxWidth int) string {

FILE: cmd/hot/pkg/tr/tr.go
  function parseLocale (line 21) | func parseLocale() string {
  function DelayInitializeLocale (line 35) | func DelayInitializeLocale() error {
  function DefaultLocaleName (line 47) | func DefaultLocaleName() string {
  function W (line 51) | func W(k string) string {
  function Fprintf (line 60) | func Fprintf(w io.Writer, format string, a ...any) (n int, err error) {

FILE: cmd/hot/pkg/tr/tr_test.go
  function TestFS (line 10) | func TestFS(t *testing.T) {
  function TestLANG (line 18) | func TestLANG(t *testing.T) {

FILE: cmd/zeta-mc/main.go
  function main (line 17) | func main() {

FILE: cmd/zeta-mc/migrate.go
  type App (line 22) | type App struct
    method concatDestination (line 41) | func (c *App) concatDestination(baseName string) (string, error) {
    method cloneAndMigrate (line 69) | func (c *App) cloneAndMigrate(g *Globals, uri string) error {
    method Run (line 87) | func (c *App) Run(g *Globals) error {
    method migrateFrom (line 112) | func (c *App) migrateFrom(g *Globals, from, to string) error {
  function die_error (line 33) | func die_error(format string, a ...any) {

FILE: cmd/zeta-mc/msic.go
  type Globals (line 21) | type Globals struct
    method RunEx (line 56) | func (g *Globals) RunEx(repoPath string, cmdArg0 string, args ...strin...
  type VersionFlag (line 26) | type VersionFlag
    method Decode (line 28) | func (v VersionFlag) Decode(ctx *kong.DecodeContext) error { return nil }
    method IsBool (line 29) | func (v VersionFlag) IsBool() bool                         { return tr...
    method BeforeApply (line 30) | func (v VersionFlag) BeforeApply(app *kong.Kong, vars kong.Vars) error {
  function pickURI (line 41) | func pickURI(rawURL string) (string, error) {

FILE: cmd/zeta-serve/command_encrypt.go
  type pseudoConfig (line 17) | type pseudoConfig struct
    method Decode (line 21) | func (pc *pseudoConfig) Decode(cfg string, expandEnv bool) error {
  type Encrypt (line 33) | type Encrypt struct
    method Run (line 41) | func (c *Encrypt) Run(globals *Globals) error {

FILE: cmd/zeta-serve/command_httpd.go
  type HTTPD (line 15) | type HTTPD struct
    method Run (line 19) | func (c *HTTPD) Run(globals *Globals) error {

FILE: cmd/zeta-serve/command_keygen.go
  type Keygen (line 23) | type Keygen struct
    method genRAS (line 28) | func (c *Keygen) genRAS() error {
    method genED25519 (line 50) | func (c *Keygen) genED25519() error {
    method genECDSA (line 65) | func (c *Keygen) genECDSA() error {
    method genX25519 (line 80) | func (c *Keygen) genX25519() error {
    method Run (line 96) | func (c *Keygen) Run(g *Globals) error {

FILE: cmd/zeta-serve/command_sshd.go
  type SSHD (line 15) | type SSHD struct
    method Run (line 19) | func (c *SSHD) Run(globals *Globals) error {

FILE: cmd/zeta-serve/global.go
  type Globals (line 13) | type Globals struct
  type VersionFlag (line 19) | type VersionFlag
    method Decode (line 21) | func (v VersionFlag) Decode(ctx *kong.DecodeContext) error { return nil }
    method IsBool (line 22) | func (v VersionFlag) IsBool() bool                         { return tr...
    method BeforeApply (line 23) | func (v VersionFlag) BeforeApply(app *kong.Kong, vars kong.Vars) error {

FILE: cmd/zeta-serve/main.go
  type App (line 15) | type App struct
  function main (line 23) | func main() {

FILE: cmd/zeta-serve/shutdown.go
  type Shutdowner (line 10) | type Shutdowner interface
  type closer (line 14) | type closer struct
  function newCloser (line 18) | func newCloser() *closer {

FILE: cmd/zeta-serve/shutdown_other.go
  method listenSignal (line 18) | func (c *closer) listenSignal(ctx context.Context, srv Shutdowner) {

FILE: cmd/zeta-serve/shutdown_windows.go
  method listenSignal (line 18) | func (c *closer) listenSignal(ctx context.Context, srv Shutdowner) {

FILE: cmd/zeta/main.go
  type App (line 21) | type App struct
  function main (line 64) | func main() {

FILE: modules/base58/alphabet.go
  constant alphabet (line 11) | alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
  constant alphabetIdx0 (line 13) | alphabetIdx0 = '1'

FILE: modules/base58/base58.go
  function countNumZeros (line 29) | func countNumZeros(s string) int {
  function Decode (line 39) | func Decode(b string) []byte {
  function Encode (line 92) | func Encode(b []byte) string {

FILE: modules/base58/base58_test.go
  function TestBase58 (line 70) | func TestBase58(t *testing.T) {

FILE: modules/base58/base58bench_test.go
  function BenchmarkBase58Encode_5K (line 21) | func BenchmarkBase58Encode_5K(b *testing.B) {
  function BenchmarkBase58Encode_100K (line 28) | func BenchmarkBase58Encode_100K(b *testing.B) {
  function BenchmarkBase58Decode_5K (line 35) | func BenchmarkBase58Decode_5K(b *testing.B) {
  function BenchmarkBase58Decode_100K (line 42) | func BenchmarkBase58Decode_100K(b *testing.B) {

FILE: modules/base58/base58check.go
  function checksum (line 20) | func checksum(input []byte) (cksum [4]byte) {
  function CheckEncode (line 28) | func CheckEncode(input []byte, version byte) string {
  function CheckDecode (line 38) | func CheckDecode(input string) (result []byte, version byte, err error) {

FILE: modules/base58/base58check_test.go
  function TestBase58Check (line 33) | func TestBase58Check(t *testing.T) {

FILE: modules/base58/example_test.go
  function ExampleDecode (line 14) | func ExampleDecode() {
  function ExampleEncode (line 28) | func ExampleEncode() {
  function ExampleCheckDecode (line 41) | func ExampleCheckDecode() {
  function ExampleCheckEncode (line 61) | func ExampleCheckEncode() {

FILE: modules/base58/genalphabet.go
  function write (line 45) | func write(w io.Writer, b []byte) {
  function main (line 52) | func main() {

FILE: modules/binary/read.go
  function Read (line 16) | func Read(r io.Reader, data ...any) error {
  function ReadUntil (line 27) | func ReadUntil(r io.Reader, delim byte) ([]byte, error) {
  function ReadUntilFromBufioReader (line 53) | func ReadUntilFromBufioReader(r *bufio.Reader, delim byte) ([]byte, erro...
  function ReadVariableWidthInt (line 86) | func ReadVariableWidthInt(r io.Reader) (int64, error) {
  constant maskContinue (line 106) | maskContinue = uint8(128)
  constant maskLength (line 107) | maskLength   = uint8(127)
  constant lengthBits (line 108) | lengthBits   = uint8(7)
  function ReadUint64 (line 112) | func ReadUint64(r io.Reader) (uint64, error) {
  function ReadUint32 (line 122) | func ReadUint32(r io.Reader) (uint32, error) {
  function ReadUint16 (line 132) | func ReadUint16(r io.Reader) (uint16, error) {
  function ReadHash (line 142) | func ReadHash(r io.Reader) (plumbing.Hash, error) {
  constant sniffLen (line 151) | sniffLen = 8000
  function IsBinary (line 155) | func IsBinary(r io.Reader) (bool, error) {

FILE: modules/binary/write.go
  function Swap16 (line 8) | func Swap16(v uint16) []byte {
  function Swap32 (line 14) | func Swap32(v uint32) []byte {
  function Swap64 (line 20) | func Swap64(v uint64) []byte {
  function Write (line 28) | func Write(w io.Writer, data ...any) error {
  function WriteVariableWidthInt (line 38) | func WriteVariableWidthInt(w io.Writer, n int64) error {
  function WriteUint64 (line 54) | func WriteUint64(w io.Writer, value uint64) error {
  function WriteUint32 (line 60) | func WriteUint32(w io.Writer, value uint32) error {
  function WriteUint16 (line 66) | func WriteUint16(w io.Writer, value uint16) error {

FILE: modules/bitmap/bitmap.go
  type Bitmap (line 14) | type Bitmap struct
    method Write (line 73) | func (b *Bitmap) Write(w io.Writer, order binary.ByteOrder) (n int64, ...
    method Set (line 155) | func (b *Bitmap) Set(pos int64) error {
    method Get (line 219) | func (b *Bitmap) Get(pos int64) bool {
    method Bits (line 267) | func (b *Bitmap) Bits() uint32 {
    method size (line 274) | func (b *Bitmap) size() int64 {
    method Bytes (line 283) | func (b *Bitmap) Bytes() int64 {
    method Reset (line 288) | func (b *Bitmap) Reset() {
  function New (line 30) | func New() *Bitmap {
  function FromReader (line 35) | func FromReader(r io.Reader, order binary.ByteOrder) (*Bitmap, error) {
  function FromBytes (line 67) | func FromBytes(b []byte, order binary.ByteOrder) (*Bitmap, error) {
  function writeUint32 (line 95) | func writeUint32(w io.Writer, bo binary.ByteOrder, num uint32) error {
  function writeUint64 (line 110) | func writeUint64(w io.Writer, bo binary.ByteOrder, num uint64) error {
  function readUint32 (line 125) | func readUint32(r io.Reader, bo binary.ByteOrder) (uint32, error) {
  function readUint64 (line 135) | func readUint64(r io.Reader, bo binary.ByteOrder) (uint64, error) {
  constant allones (line 149) | allones = ^uint64(0)
  constant maxUint31 (line 150) | maxUint31 = ^uint32(0) >> 1
  function setbit (line 295) | func setbit(word *uint64, idx uint64) {
  type rlw (line 303) | type rlw
    method b (line 324) | func (r rlw) b() bool {
    method k (line 329) | func (r rlw) k() uint32 {
    method l (line 334) | func (r rlw) l() uint32 {
    method setk (line 339) | func (r *rlw) setk(k uint32) {
    method setl (line 344) | func (r *rlw) setl(l uint32) {
  constant bmask (line 306) | bmask = uint64(1) << 63
  constant kmask (line 309) | kmask = ^uint64(0) >> 32 << 31
  constant lmask (line 312) | lmask = ^uint64(0) >> 33
  function newRlw (line 315) | func newRlw(b bool, k, l uint32) rlw {

FILE: modules/bitmap/bitmap_test.go
  function TestBitmapReadWrite (line 18) | func TestBitmapReadWrite(t *testing.T) {
  function TestBitmapGet (line 36) | func TestBitmapGet(t *testing.T) {
  function TestBitmapSet (line 107) | func TestBitmapSet(t *testing.T) {
  function TestBitmapSetOverflowL (line 145) | func TestBitmapSetOverflowL(t *testing.T) {
  function TestBitmapSetOverflowK (line 182) | func TestBitmapSetOverflowK(t *testing.T) {
  function TestBitmapSetOverflowKAllOnes (line 209) | func TestBitmapSetOverflowKAllOnes(t *testing.T) {
  function TestBitmapSetAllOnesPrevRlw (line 236) | func TestBitmapSetAllOnesPrevRlw(t *testing.T) {
  function TestRlwSetl (line 260) | func TestRlwSetl(t *testing.T) {
  function TestRlwSetk (line 272) | func TestRlwSetk(t *testing.T) {
  function TestSetBit (line 284) | func TestSetBit(t *testing.T) {
  function TestBug1 (line 295) | func TestBug1(t *testing.T) {
  function BenchmarkBitmapGet (line 309) | func BenchmarkBitmapGet(b *testing.B) {
  function BenchmarkBitmapGetSequential (line 316) | func BenchmarkBitmapGetSequential(b *testing.B) {
  function BenchmarkBitmapGetNotSequential (line 328) | func BenchmarkBitmapGetNotSequential(b *testing.B) {
  function BenchmarkBitmapWrite (line 340) | func BenchmarkBitmapWrite(b *testing.B) {
  function BenchmarkBitmapRead (line 350) | func BenchmarkBitmapRead(b *testing.B) {
  function BenchmarkBitmapSet (line 368) | func BenchmarkBitmapSet(b *testing.B) {
  function newBitmap (line 375) | func newBitmap() *Bitmap {
  function newBigBitmap (line 390) | func newBigBitmap() (*Bitmap, error) {

FILE: modules/chardet/2022.go
  type recognizer2022 (line 7) | type recognizer2022 struct
    method Match (line 12) | func (r *recognizer2022) Match(input *recognizerInput) (output recogni...
    method matchConfidence (line 19) | func (r *recognizer2022) matchConfidence(input []byte) int {
  function newRecognizer_2022JP (line 83) | func newRecognizer_2022JP() *recognizer2022 {
  function newRecognizer_2022KR (line 90) | func newRecognizer_2022KR() *recognizer2022 {
  function newRecognizer_2022CN (line 97) | func newRecognizer_2022CN() *recognizer2022 {

FILE: modules/chardet/detector.go
  type Result (line 10) | type Result struct
  type Detector (line 20) | type Detector struct
    method DetectBest (line 87) | func (d *Detector) DetectBest(b []byte) (r *Result, err error) {
    method DetectAll (line 107) | func (d *Detector) DetectAll(b []byte) ([]Result, error) {
  function NewTextDetector (line 73) | func NewTextDetector() *Detector {
  function NewHtmlDetector (line 78) | func NewHtmlDetector() *Detector {
  function matchHelper (line 139) | func matchHelper(r recognizer, input *recognizerInput, outputChan chan<-...
  type recognizerOutputs (line 143) | type recognizerOutputs
    method Len (line 145) | func (r recognizerOutputs) Len() int           { return len(r) }
    method Less (line 146) | func (r recognizerOutputs) Less(i, j int) bool { return r[i].Confidenc...
    method Swap (line 147) | func (r recognizerOutputs) Swap(i, j int)      { r[i], r[j] = r[j], r[...

FILE: modules/chardet/encoding.go
  function NewReader (line 55) | func NewReader(r io.Reader, charset string) io.Reader {
  function NewWriter (line 63) | func NewWriter(w io.Writer, charset string) io.Writer {
  function DecodeFromCharset (line 71) | func DecodeFromCharset(input []byte, charset string) ([]byte, error) {
  function EncodeToCharset (line 79) | func EncodeToCharset(input []byte, charset string) ([]byte, error) {

FILE: modules/chardet/multi_byte.go
  type recognizerMultiByte (line 8) | type recognizerMultiByte struct
    method Match (line 19) | func (r *recognizerMultiByte) Match(input *recognizerInput) (output re...
    method matchConfidence (line 27) | func (r *recognizerMultiByte) matchConfidence(input *recognizerInput) ...
  type charDecoder (line 15) | type charDecoder interface
  function binarySearch (line 70) | func binarySearch(l []uint16, c uint16) bool {
  type charDecoder_sjis (line 91) | type charDecoder_sjis struct
    method DecodeOneChar (line 94) | func (charDecoder_sjis) DecodeOneChar(input []byte) (c uint16, remain ...
  function newRecognizer_sjis (line 126) | func newRecognizer_sjis() *recognizerMultiByte {
  type charDecoder_euc (line 135) | type charDecoder_euc struct
    method DecodeOneChar (line 138) | func (charDecoder_euc) DecodeOneChar(input []byte) (c uint16, remain [...
  function newRecognizer_euc_jp (line 206) | func newRecognizer_euc_jp() *recognizerMultiByte {
  function newRecognizer_euc_kr (line 215) | func newRecognizer_euc_kr() *recognizerMultiByte {
  type charDecoder_big5 (line 224) | type charDecoder_big5 struct
    method DecodeOneChar (line 227) | func (charDecoder_big5) DecodeOneChar(input []byte) (c uint16, remain ...
  function newRecognizer_big5 (line 262) | func newRecognizer_big5() *recognizerMultiByte {
  type charDecoder_gb_18030 (line 271) | type charDecoder_gb_18030 struct
    method DecodeOneChar (line 274) | func (charDecoder_gb_18030) DecodeOneChar(input []byte) (c uint16, rem...
  function newRecognizer_gb_18030 (line 331) | func newRecognizer_gb_18030() *recognizerMultiByte {

FILE: modules/chardet/recognizer.go
  type recognizer (line 3) | type recognizer interface
  type recognizerOutput (line 7) | type recognizerOutput
  type recognizerInput (line 9) | type recognizerInput struct
  function newRecognizerInput (line 17) | func newRecognizerInput(raw []byte, stripTag bool) *recognizerInput {
  function mayStripInput (line 29) | func mayStripInput(raw []byte, stripTag bool) (out []byte, stripped bool) {
  function computeByteStats (line 65) | func computeByteStats(input []byte) []int {
  function computeHasC1Bytes (line 73) | func computeHasC1Bytes(byteStats []int) bool {

FILE: modules/chardet/single_byte.go
  type recognizerSingleByte (line 4) | type recognizerSingleByte struct
    method Match (line 12) | func (r *recognizerSingleByte) Match(input *recognizerInput) recognize...
    method parseNgram (line 90) | func (r *recognizerSingleByte) parseNgram(input []byte) int {
  type ngramState (line 24) | type ngramState struct
    method AddByte (line 41) | func (s *ngramState) AddByte(b byte) {
    method HitRate (line 54) | func (s *ngramState) HitRate() float32 {
    method lookup (line 61) | func (s *ngramState) lookup() bool {
  function newNgramState (line 31) | func newNgramState(table *[64]uint32) *ngramState {
  function newRecognizer_8859_1 (line 211) | func newRecognizer_8859_1(language string, ngram *[64]uint32) *recognize...
  function newRecognizer_8859_1_en (line 221) | func newRecognizer_8859_1_en() *recognizerSingleByte {
  function newRecognizer_8859_1_da (line 224) | func newRecognizer_8859_1_da() *recognizerSingleByte {
  function newRecognizer_8859_1_de (line 227) | func newRecognizer_8859_1_de() *recognizerSingleByte {
  function newRecognizer_8859_1_es (line 230) | func newRecognizer_8859_1_es() *recognizerSingleByte {
  function newRecognizer_8859_1_fr (line 233) | func newRecognizer_8859_1_fr() *recognizerSingleByte {
  function newRecognizer_8859_1_it (line 236) | func newRecognizer_8859_1_it() *recognizerSingleByte {
  function newRecognizer_8859_1_nl (line 239) | func newRecognizer_8859_1_nl() *recognizerSingleByte {
  function newRecognizer_8859_1_no (line 242) | func newRecognizer_8859_1_no() *recognizerSingleByte {
  function newRecognizer_8859_1_pt (line 245) | func newRecognizer_8859_1_pt() *recognizerSingleByte {
  function newRecognizer_8859_1_sv (line 248) | func newRecognizer_8859_1_sv() *recognizerSingleByte {
  function newRecognizer_8859_2 (line 315) | func newRecognizer_8859_2(language string, ngram *[64]uint32) *recognize...
  function newRecognizer_8859_2_cs (line 325) | func newRecognizer_8859_2_cs() *recognizerSingleByte {
  function newRecognizer_8859_2_hu (line 328) | func newRecognizer_8859_2_hu() *recognizerSingleByte {
  function newRecognizer_8859_2_pl (line 331) | func newRecognizer_8859_2_pl() *recognizerSingleByte {
  function newRecognizer_8859_2_ro (line 334) | func newRecognizer_8859_2_ro() *recognizerSingleByte {
  function newRecognizer_8859_5 (line 380) | func newRecognizer_8859_5(language string, ngram *[64]uint32) *recognize...
  function newRecognizer_8859_5_ru (line 389) | func newRecognizer_8859_5_ru() *recognizerSingleByte {
  function newRecognizer_8859_6 (line 435) | func newRecognizer_8859_6(language string, ngram *[64]uint32) *recognize...
  function newRecognizer_8859_6_ar (line 444) | func newRecognizer_8859_6_ar() *recognizerSingleByte {
  function newRecognizer_8859_7 (line 490) | func newRecognizer_8859_7(language string, ngram *[64]uint32) *recognize...
  function newRecognizer_8859_7_el (line 500) | func newRecognizer_8859_7_el() *recognizerSingleByte {
  function newRecognizer_8859_8 (line 553) | func newRecognizer_8859_8(language string, ngram *[64]uint32) *recognize...
  function newRecognizer_8859_8_I_he (line 563) | func newRecognizer_8859_8_I_he() *recognizerSingleByte {
  function newRecognizer_8859_8_he (line 569) | func newRecognizer_8859_8_he() *recognizerSingleByte {
  function newRecognizer_8859_9 (line 615) | func newRecognizer_8859_9(language string, ngram *[64]uint32) *recognize...
  function newRecognizer_8859_9_tr (line 625) | func newRecognizer_8859_9_tr() *recognizerSingleByte {
  function newRecognizer_windows_1256 (line 671) | func newRecognizer_windows_1256() *recognizerSingleByte {
  function newRecognizer_windows_1251 (line 722) | func newRecognizer_windows_1251() *recognizerSingleByte {
  function newRecognizer_KOI8_R (line 773) | func newRecognizer_KOI8_R() *recognizerSingleByte {
  function newRecognizer_IBM424_he (line 816) | func newRecognizer_IBM424_he(charset string, ngram *[64]uint32) *recogni...
  function newRecognizer_IBM424_he_rtl (line 825) | func newRecognizer_IBM424_he_rtl() *recognizerSingleByte {
  function newRecognizer_IBM424_he_ltr (line 829) | func newRecognizer_IBM424_he_ltr() *recognizerSingleByte {
  function newRecognizer_IBM420_ar (line 867) | func newRecognizer_IBM420_ar(charset string, ngram *[64]uint32) *recogni...
  function newRecognizer_IBM420_ar_rtl (line 876) | func newRecognizer_IBM420_ar_rtl() *recognizerSingleByte {
  function newRecognizer_IBM420_ar_ltr (line 880) | func newRecognizer_IBM420_ar_ltr() *recognizerSingleByte {

FILE: modules/chardet/unicode.go
  type recognizerUtf16be (line 14) | type recognizerUtf16be struct
    method Match (line 21) | func (*recognizerUtf16be) Match(input *recognizerInput) (output recogn...
  function newRecognizer_utf16be (line 17) | func newRecognizer_utf16be() *recognizerUtf16be {
  type recognizerUtf16le (line 31) | type recognizerUtf16le struct
    method Match (line 38) | func (*recognizerUtf16le) Match(input *recognizerInput) (output recogn...
  function newRecognizer_utf16le (line 34) | func newRecognizer_utf16le() *recognizerUtf16le {
  type recognizerUtf32 (line 48) | type recognizerUtf32 struct
    method Match (line 78) | func (r *recognizerUtf32) Match(input *recognizerInput) (output recogn...
  function decodeUtf32be (line 54) | func decodeUtf32be(input []byte) uint32 {
  function decodeUtf32le (line 58) | func decodeUtf32le(input []byte) uint32 {
  function newRecognizer_utf32be (line 62) | func newRecognizer_utf32be() *recognizerUtf32 {
  function newRecognizer_utf32le (line 70) | func newRecognizer_utf32le() *recognizerUtf32 {

FILE: modules/chardet/utf8.go
  type recognizerUtf8 (line 9) | type recognizerUtf8 struct
    method Match (line 16) | func (*recognizerUtf8) Match(input *recognizerInput) (output recognize...
  function newRecognizer_utf8 (line 12) | func newRecognizer_utf8() *recognizerUtf8 {

FILE: modules/command/command.go
  constant STDERR_BUFFER_LIMIT (line 17) | STDERR_BUFFER_LIMIT = 8 * 1024
  constant STDERR_BUFFER_GROUP (line 18) | STDERR_BUFFER_GROUP = 512
  type LimitStderr (line 21) | type LimitStderr struct
    method Bytes (line 32) | func (w *LimitStderr) Bytes() []byte {
    method Write (line 36) | func (w *LimitStderr) Write(p []byte) (int, error) {
  function NewStderr (line 26) | func NewStderr() *LimitStderr {
  type Command (line 49) | type Command struct
    method Start (line 59) | func (c *Command) Start() error {
    method wait (line 71) | func (c *Command) wait() {
    method Wait (line 79) | func (c *Command) Wait() error {
    method UseTime (line 90) | func (c *Command) UseTime() time.Duration {
    method Run (line 94) | func (c *Command) Run() error {
    method Environ (line 178) | func (c *Command) Environ() []string {
    method StdoutPipe (line 182) | func (c *Command) StdoutPipe() (io.ReadCloser, error) {
    method StderrPipe (line 186) | func (c *Command) StderrPipe() (io.ReadCloser, error) {
    method StdinPipe (line 190) | func (c *Command) StdinPipe() (io.WriteCloser, error) {
    method Output (line 194) | func (c *Command) Output() ([]byte, error) {
    method OneLine (line 215) | func (c *Command) OneLine() (string, error) {
    method RunEx (line 223) | func (c *Command) RunEx() error {
    method String (line 238) | func (c *Command) String() string {
    method Exit (line 251) | func (c *Command) Exit() error {
  type prefixSuffixSaver (line 104) | type prefixSuffixSaver struct
    method Write (line 118) | func (w *prefixSuffixSaver) Write(p []byte) (n int, err error) {
    method fill (line 144) | func (w *prefixSuffixSaver) fill(dst *[]byte, p []byte) (pRemain []byt...
    method Bytes (line 153) | func (w *prefixSuffixSaver) Bytes() []byte {
  function minInt (line 171) | func minInt(a, b int) int {

FILE: modules/command/shepherd.go
  type RunOpts (line 12) | type RunOpts struct
  type Shepherd (line 23) | type Shepherd interface
  type shepherd (line 32) | type shepherd struct
    method inc (line 37) | func (s *shepherd) inc() int32 {
    method dec (line 41) | func (s *shepherd) dec() int32 {
    method ProcessesCount (line 45) | func (s *shepherd) ProcessesCount() int32 {
    method New (line 54) | func (s *shepherd) New(ctx context.Context, repoPath string, name stri...
    method NewFromOptions (line 58) | func (s *shepherd) NewFromOptions(ctx context.Context, opt *RunOpts, n...
  function NewShepherd (line 49) | func NewShepherd(b env.Builder) Shepherd {
  function NewFromOptions (line 84) | func NewFromOptions(ctx context.Context, opt *RunOpts, name string, arg ...
  function New (line 89) | func New(ctx context.Context, repoPath string, name string, arg ...strin...
  function ProcessesCount (line 94) | func ProcessesCount() int32 {

FILE: modules/command/shepherd_linux.go
  function setSysProcAttribute (line 10) | func setSysProcAttribute(c *exec.Cmd, detached bool) {
  function cleanExit (line 19) | func cleanExit(c *exec.Cmd, detached bool) {

FILE: modules/command/shepherd_test.go
  function TestNewCommand (line 12) | func TestNewCommand(t *testing.T) {
  function TestNewCommand2 (line 22) | func TestNewCommand2(t *testing.T) {
  function TestNewCommand3 (line 37) | func TestNewCommand3(t *testing.T) {
  function TestNewCommand4 (line 47) | func TestNewCommand4(t *testing.T) {
  function TestWaitTimeout (line 57) | func TestWaitTimeout(t *testing.T) {
  function TestChildProcess (line 71) | func TestChildProcess(t *testing.T) {

FILE: modules/command/shepherd_unix.go
  function setSysProcAttribute (line 10) | func setSysProcAttribute(c *exec.Cmd, _ bool) {
  function cleanExit (line 14) | func cleanExit(c *exec.Cmd, detached bool) {

FILE: modules/command/shepherd_win.go
  function setSysProcAttribute (line 7) | func setSysProcAttribute(c *exec.Cmd, detached bool) {
  function cleanExit (line 11) | func cleanExit(c *exec.Cmd, _ bool) {

FILE: modules/command/util.go
  constant NoDir (line 11) | NoDir = ""
  function FromError (line 14) | func FromError(err error) string {
  function FromErrorCode (line 27) | func FromErrorCode(err error) int {

FILE: modules/crc/reader.go
  type Crc64Writer (line 14) | type Crc64Writer struct
    method Finish (line 33) | func (cw *Crc64Writer) Finish() (string, error) {
  type Finisher (line 20) | type Finisher interface
  function NewCrc64Writer (line 24) | func NewCrc64Writer(w io.Writer) *Crc64Writer {
  type Crc64Reader (line 44) | type Crc64Reader struct
    method Read (line 49) | func (cr *Crc64Reader) Read(p []byte) (n int, err error) {
    method Verify (line 61) | func (cr *Crc64Reader) Verify() error {
  function NewCrc64Reader (line 57) | func NewCrc64Reader(r io.Reader) *Crc64Reader {

FILE: modules/deflect/az.go
  constant MaxLooseObjects (line 12) | MaxLooseObjects = 1000
  constant MaxPacks (line 14) | MaxPacks = 3
  constant MinPackSize (line 16) | MinPackSize = 4 * strengthen.GiByte
  type Pack (line 20) | type Pack struct
  type Result (line 26) | type Result struct
    method IsUntidy (line 38) | func (r *Result) IsUntidy() bool {
  function HousekeepingScan (line 51) | func HousekeepingScan(repoPath string) (*Result, error) {

FILE: modules/deflect/deflect.go
  constant DefaultFileSizeLimit (line 24) | DefaultFileSizeLimit = strengthen.MiByte * 50
  constant hugeSizeLimit (line 26) | hugeSizeLimit = strengthen.MiByte * 15
  type Option (line 30) | type Option struct
  type pack (line 42) | type pack struct
  type Auditor (line 48) | type Auditor struct
    method HashLen (line 88) | func (a *Auditor) HashLen() int64 {
    method Counts (line 93) | func (a *Auditor) Counts() uint32 {
    method Size (line 98) | func (a *Auditor) Size() int64 {
    method Delta (line 103) | func (a *Auditor) Delta() int64 {
    method HugeSUM (line 108) | func (a *Auditor) HugeSUM() int64 {
    method Execute (line 116) | func (a *Auditor) Execute() error {
    method onOversized (line 129) | func (a *Auditor) onOversized(oid string, size int64) error {
  function NewAuditor (line 65) | func NewAuditor(repoPath string, shaFormat git.HashFormat, opts *Option)...
  function Du (line 139) | func Du(repoPath string) (int64, error) {

FILE: modules/deflect/deflect_test.go
  function TestDeflectFilter (line 15) | func TestDeflectFilter(t *testing.T) {
  function TestDeflectFilter2 (line 49) | func TestDeflectFilter2(t *testing.T) {
  function TestRepoSize (line 69) | func TestRepoSize(t *testing.T) {
  function TestHousekeepingScan (line 83) | func TestHousekeepingScan(t *testing.T) {
  function TestOnOversizedCallback (line 97) | func TestOnOversizedCallback(t *testing.T) {
  function TestDuWithLooseObjects (line 131) | func TestDuWithLooseObjects(t *testing.T) {
  function TestFilterAccessors (line 162) | func TestFilterAccessors(t *testing.T) {
  function TestOnOversizedCallbackNil (line 198) | func TestOnOversizedCallbackNil(t *testing.T) {

FILE: modules/deflect/du.go
  constant ENV_GIT_QUARANTINE_PATH (line 11) | ENV_GIT_QUARANTINE_PATH = "GIT_QUARANTINE_PATH"
  function ReadDir (line 16) | func ReadDir(name string) ([]os.DirEntry, error) {
  method duObject (line 38) | func (a *Auditor) duObject(p, name string, hugeReject, deltaSUM bool) er...
  method duPacks (line 70) | func (a *Auditor) duPacks(packdir string, hugeReject, deltaSUM bool) err...
  method duInternal (line 124) | func (a *Auditor) duInternal(objectsDir string, hugeReject, deltaSUM boo...
  method Du (line 152) | func (a *Auditor) Du() error {

FILE: modules/deflect/pack.go
  constant fanout (line 27) | fanout = 256
  constant VersionSupported (line 30) | VersionSupported uint32 = 2
  constant isO64Mask (line 32) | isO64Mask = uint64(1) << 31
  constant offsetMask (line 34) | offsetMask = int(0x7fffffff)
  function validateHeader (line 43) | func validateHeader(r io.Reader) error {
  method hashFromIndex (line 62) | func (a *Auditor) hashFromIndex(rs io.ReadSeeker, i int64) (string, erro...
  method analyzePack (line 82) | func (a *Auditor) analyzePack(p *pack) error {
  method analyzePack32 (line 134) | func (a *Auditor) analyzePack32(rs io.ReadSeeker, nr uint32, packsz int6...
  method analyzePack64 (line 174) | func (a *Auditor) analyzePack64(rs io.ReadSeeker, nr uint32, packsz int6...

FILE: modules/deflect/struct.go
  type object32 (line 5) | type object32 struct
  type object64 (line 12) | type object64 struct
  type object32s (line 22) | type object32s
    method Len (line 25) | func (o object32s) Len() int { return len(o) }
    method Less (line 29) | func (o object32s) Less(i, j int) bool { return o[i].offset > o[j].off...
    method Swap (line 32) | func (o object32s) Swap(i, j int) { o[i], o[j] = o[j], o[i] }
  type object64s (line 34) | type object64s
    method Len (line 37) | func (o object64s) Len() int { return len(o) }
    method Less (line 41) | func (o object64s) Less(i, j int) bool { return o[i].offset > o[j].off...
    method Swap (line 44) | func (o object64s) Swap(i, j int) { o[i], o[j] = o[j], o[i] }

FILE: modules/diferenco/algorithms_bench_test.go
  function generateSequence (line 13) | func generateSequence(size int, changeRate float64) []string {
  function generateModifiedSequence (line 25) | func generateModifiedSequence(base []string, changeRate float64) []string {
  function BenchmarkMyersAlgorithm (line 38) | func BenchmarkMyersAlgorithm(b *testing.B) {
  function BenchmarkHistogramAlgorithm (line 71) | func BenchmarkHistogramAlgorithm(b *testing.B) {
  function BenchmarkONPAlgorithm (line 104) | func BenchmarkONPAlgorithm(b *testing.B) {
  function BenchmarkPatienceAlgorithm (line 137) | func BenchmarkPatienceAlgorithm(b *testing.B) {
  function BenchmarkMinimalAlgorithm (line 170) | func BenchmarkMinimalAlgorithm(b *testing.B) {
  function BenchmarkSuffixArrayAlgorithm (line 203) | func BenchmarkSuffixArrayAlgorithm(b *testing.B) {
  function BenchmarkAlgorithmComparison (line 236) | func BenchmarkAlgorithmComparison(b *testing.B) {
  function BenchmarkSpecialCases (line 287) | func BenchmarkSpecialCases(b *testing.B) {
  function BenchmarkDiffRunes (line 336) | func BenchmarkDiffRunes(b *testing.B) {
  function BenchmarkDiffWords (line 366) | func BenchmarkDiffWords(b *testing.B) {
  function BenchmarkHelperFunctions (line 396) | func BenchmarkHelperFunctions(b *testing.B) {
  function BenchmarkWithRealWorldData (line 421) | func BenchmarkWithRealWorldData(b *testing.B) {
  function BenchmarkMemoryAllocation (line 517) | func BenchmarkMemoryAllocation(b *testing.B) {
  function BenchmarkParallel (line 541) | func BenchmarkParallel(b *testing.B) {
  function splitLines (line 557) | func splitLines(text string) []string {

FILE: modules/diferenco/color/color.go
  constant Normal (line 10) | Normal       = ""
  constant Reset (line 11) | Reset        = "\033[0m"
  constant Bold (line 12) | Bold         = "\033[1m"
  constant Black (line 13) | Black        = "\033[30m"
  constant Red (line 14) | Red          = "\033[31m"
  constant Green (line 15) | Green        = "\033[32m"
  constant Yellow (line 16) | Yellow       = "\033[33m"
  constant Blue (line 17) | Blue         = "\033[34m"
  constant Magenta (line 18) | Magenta      = "\033[35m"
  constant Cyan (line 19) | Cyan         = "\033[36m"
  constant White (line 20) | White        = "\033[37m"
  constant Default (line 21) | Default      = "\033[39m"
  constant BoldBlack (line 22) | BoldBlack    = "\033[1;30m"
  constant BoldRed (line 23) | BoldRed      = "\033[1;31m"
  constant BoldGreen (line 24) | BoldGreen    = "\033[1;32m"
  constant BoldYellow (line 25) | BoldYellow   = "\033[1;33m"
  constant BoldBlue (line 26) | BoldBlue     = "\033[1;34m"
  constant BoldMagenta (line 27) | BoldMagenta  = "\033[1;35m"
  constant BoldCyan (line 28) | BoldCyan     = "\033[1;36m"
  constant BoldWhite (line 29) | BoldWhite    = "\033[1;37m"
  constant BoldDefault (line 30) | BoldDefault  = "\033[1;39m"
  constant FaintBlack (line 31) | FaintBlack   = "\033[2;30m"
  constant FaintRed (line 32) | FaintRed     = "\033[2;31m"
  constant FaintGreen (line 33) | FaintGreen   = "\033[2;32m"
  constant FaintYellow (line 34) | FaintYellow  = "\033[2;33m"
  constant FaintBlue (line 35) | FaintBlue    = "\033[2;34m"
  constant FaintMagenta (line 36) | FaintMagenta = "\033[2;35m"
  constant FaintCyan (line 37) | FaintCyan    = "\033[2;36m"
  constant FaintWhite (line 38) | FaintWhite   = "\033[2;37m"
  constant FaintDefault (line 39) | FaintDefault = "\033[2;39m"
  constant BgBlack (line 40) | BgBlack      = "\033[40m"
  constant BgRed (line 41) | BgRed        = "\033[41m"
  constant BgGreen (line 42) | BgGreen      = "\033[42m"
  constant BgYellow (line 43) | BgYellow     = "\033[43m"
  constant BgBlue (line 44) | BgBlue       = "\033[44m"
  constant BgMagenta (line 45) | BgMagenta    = "\033[45m"
  constant BgCyan (line 46) | BgCyan       = "\033[46m"
  constant BgWhite (line 47) | BgWhite      = "\033[47m"
  constant BgDefault (line 48) | BgDefault    = "\033[49m"
  constant Faint (line 49) | Faint        = "\033[2m"
  constant FaintItalic (line 50) | FaintItalic  = "\033[2;3m"
  constant Reverse (line 51) | Reverse      = "\033[7m"
  type ColorKey (line 57) | type ColorKey
  constant Context (line 61) | Context                   ColorKey = "context"
  constant Meta (line 62) | Meta                      ColorKey = "meta"
  constant Frag (line 63) | Frag                      ColorKey = "frag"
  constant Old (line 64) | Old                       ColorKey = "old"
  constant New (line 65) | New                       ColorKey = "new"
  constant Commit (line 66) | Commit                    ColorKey = "commit"
  constant Whitespace (line 67) | Whitespace                ColorKey = "whitespace"
  constant Func (line 68) | Func                      ColorKey = "func"
  constant OldMoved (line 69) | OldMoved                  ColorKey = "oldMoved"
  constant OldMovedAlternative (line 70) | OldMovedAlternative       ColorKey = "oldMovedAlternative"
  constant OldMovedDimmed (line 71) | OldMovedDimmed            ColorKey = "oldMovedDimmed"
  constant OldMovedAlternativeDimmed (line 72) | OldMovedAlternativeDimmed ColorKey = "oldMovedAlternativeDimmed"
  constant NewMoved (line 73) | NewMoved                  ColorKey = "newMoved"
  constant NewMovedAlternative (line 74) | NewMovedAlternative       ColorKey = "newMovedAlternative"
  constant NewMovedDimmed (line 75) | NewMovedDimmed            ColorKey = "newMovedDimmed"
  constant NewMovedAlternativeDimmed (line 76) | NewMovedAlternativeDimmed ColorKey = "newMovedAlternativeDimmed"
  constant ContextDimmed (line 77) | ContextDimmed             ColorKey = "contextDimmed"
  constant OldDimmed (line 78) | OldDimmed                 ColorKey = "oldDimmed"
  constant NewDimmed (line 79) | NewDimmed                 ColorKey = "newDimmed"
  constant ContextBold (line 80) | ContextBold               ColorKey = "contextBold"
  constant OldBold (line 81) | OldBold                   ColorKey = "oldBold"
  constant NewBold (line 82) | NewBold                   ColorKey = "newBold"
  type ColorConfig (line 87) | type ColorConfig
    method Reset (line 139) | func (cc ColorConfig) Reset(key ColorKey) string {
  type ColorConfigOption (line 90) | type ColorConfigOption
  function WithColor (line 93) | func WithColor(key ColorKey, color string) ColorConfigOption {
  function NewColorConfig (line 127) | func NewColorConfig(options ...ColorConfigOption) ColorConfig {

FILE: modules/diferenco/diferenco.go
  type Operation (line 19) | type Operation
  constant Delete (line 23) | Delete Operation = -1
  constant Insert (line 25) | Insert Operation = 1
  constant Equal (line 27) | Equal Operation = 0
  type Algorithm (line 30) | type Algorithm
    method String (line 67) | func (a Algorithm) String() string {
  constant Unspecified (line 33) | Unspecified Algorithm = iota
  constant Histogram (line 34) | Histogram
  constant ONP (line 35) | ONP
  constant Myers (line 36) | Myers
  constant Minimal (line 37) | Minimal
  constant Patience (line 38) | Patience
  constant SuffixArray (line 39) | SuffixArray
  function AlgorithmFromName (line 75) | func AlgorithmFromName(s string) (Algorithm, error) {
  function commonPrefixLength (line 92) | func commonPrefixLength[E comparable](a, b []E) int {
  function commonSuffixLength (line 102) | func commonSuffixLength[E comparable](a, b []E) int {
  type Change (line 112) | type Change struct
  type StringDiff (line 120) | type StringDiff struct
  type FileStat (line 125) | type FileStat struct
  type Options (line 130) | type Options struct
    method Name (line 138) | func (o *Options) Name() string {
  function DiffSlices (line 151) | func DiffSlices[E comparable](ctx context.Context, L1, L2 []E, algo Algo...
  function Stat (line 184) | func Stat(ctx context.Context, opts *Options) (*FileStat, error) {
  function DiffRunes (line 211) | func DiffRunes(ctx context.Context, a, b string, algo Algorithm) ([]Stri...
  function DiffWords (line 238) | func DiffWords(ctx context.Context, a, b string, algo Algorithm, splitFu...

FILE: modules/diferenco/diferenco_test.go
  function TestDiff (line 14) | func TestDiff(t *testing.T) {
  function TestPatchFD (line 49) | func TestPatchFD(t *testing.T) {
  function TestPatch (line 85) | func TestPatch(t *testing.T) {
  function TestPatchNew (line 121) | func TestPatchNew(t *testing.T) {
  function TestPatchDelete (line 147) | func TestPatchDelete(t *testing.T) {
  function TestDiff2 (line 173) | func TestDiff2(t *testing.T) {
  function TestPatchScss (line 202) | func TestPatchScss(t *testing.T) {
  function TestPatchCss (line 238) | func TestPatchCss(t *testing.T) {
  function TestShowPatch (line 274) | func TestShowPatch(t *testing.T) {
  function TestDiffRunes (line 297) | func TestDiffRunes(t *testing.T) {
  function TestDiffWords (line 318) | func TestDiffWords(t *testing.T) {
  function TestDiffWords2 (line 340) | func TestDiffWords2(t *testing.T) {

FILE: modules/diferenco/gen_unicode.go
  constant eastAsianWidthURL (line 18) | eastAsianWidthURL = "https://unicode.org/Public/UNIDATA/EastAsianWidth.txt"
  constant emojiDataURL (line 19) | emojiDataURL      = "https://unicode.org/Public/UNIDATA/emoji/emoji-data...
  constant outputFile (line 20) | outputFile        = "unicode_data.go"
  constant outputPackage (line 21) | outputPackage     = "diferenco"
  type interval (line 24) | type interval struct
  function main (line 29) | func main() {
  function run (line 36) | func run() error {
  function fetchRanges (line 62) | func fetchRanges(url string, wantProperty func(string) bool) ([]interval...
  function stripComment (line 107) | func stripComment(s string) string {
  function parseInterval (line 112) | func parseInterval(s string) (interval, error) {
  function parseHexRune (line 135) | func parseHexRune(s string) (rune, error) {
  function mergeIntervals (line 143) | func mergeIntervals(ranges []interval) []interval {
  function writeHeader (line 174) | func writeHeader(w io.Writer) {
  function writeIntervals (line 180) | func writeIntervals(w io.Writer, name string, ranges []interval) {
  function writeFileAtomically (line 189) | func writeFileAtomically(name string, data []byte, perm os.FileMode) err...

FILE: modules/diferenco/histogram.go
  constant MaxChainLen (line 9) | MaxChainLen = 63
  type histogramIndex (line 11) | type histogramIndex struct
  method populate (line 15) | func (h *histogramIndex[E]) populate(a []E) {
  method numTokenOccurrences (line 25) | func (h *histogramIndex[E]) numTokenOccurrences(e E) int {
  method clear (line 32) | func (h *histogramIndex[E]) clear() {
  type lcsMatch (line 38) | type lcsMatch struct
  type lcsFinder (line 44) | type lcsFinder struct
  method run (line 50) | func (s *lcsFinder[E]) run(before, after []E, h *histogramIndex[E]) {
  method updateLcs (line 66) | func (s *lcsFinder[E]) updateLcs(before, after []E, afterPos int, token ...
  method ok (line 123) | func (s *lcsFinder[E]) ok() bool {
  function findLcs (line 127) | func findLcs[E comparable](before, after []E, index *histogramIndex[E]) ...
  type changesOut (line 138) | type changesOut struct
  method run (line 142) | func (h *histogramIndex[E]) run(ctx context.Context, before []E, beforeP...
  function histogram (line 186) | func histogram[E comparable](ctx context.Context, L1, L2 []E) ([]Change,...

FILE: modules/diferenco/histogram_test.go
  function TestHistogram (line 13) | func TestHistogram(t *testing.T) {
  function TestHistogramGit (line 39) | func TestHistogramGit(t *testing.T) {
  function TestHistogram2 (line 65) | func TestHistogram2(t *testing.T) {
  function TestHistogram3 (line 95) | func TestHistogram3(t *testing.T) {
  function TestHistogram4 (line 119) | func TestHistogram4(t *testing.T) {
  function TestHistogramHeuristic (line 152) | func TestHistogramHeuristic(t *testing.T) {

FILE: modules/diferenco/lcs/common.go
  type lcs (line 13) | type lcs
    method sort (line 23) | func (l lcs) sort() lcs {
    method valid (line 36) | func (l lcs) valid() bool {
    method fix (line 50) | func (l lcs) fix() lcs {
    method prepend (line 144) | func (lcs lcs) prepend(x, y int) lcs {
    method append (line 163) | func (lcs lcs) append(x, y int) lcs {
  type diag (line 17) | type diag struct
  type direction (line 81) | type direction
  constant empty (line 84) | empty    direction = iota
  constant leftdown (line 85) | leftdown
  constant rightup (line 86) | rightup
  constant bad (line 87) | bad
  function overlap (line 92) | func overlap(exist, prop diag) (direction, diag) {
  function ok (line 177) | func ok(d, k int) bool {

FILE: modules/diferenco/lcs/common_test.go
  type Btest (line 15) | type Btest struct
  function init (line 62) | func init() {
  function check (line 66) | func check(t *testing.T, str string, lcs lcs, want []string) {
  function checkDiffs (line 82) | func checkDiffs(t *testing.T, before string, diffs []Diff, after string) {
  function lcslen (line 99) | func lcslen(l lcs) int {
  function randstr (line 108) | func randstr(s string, n int) string {
  function TestLcsFix (line 117) | func TestLcsFix(t *testing.T) {

FILE: modules/diferenco/lcs/labels.go
  type label (line 13) | type label struct
    method set (line 29) | func (t *label) set(D, k, x int) {
    method get (line 42) | func (t *label) get(d, k int) int {
  constant debug (line 18) | debug = false
  function checkDK (line 22) | func checkDK(D, k int) {
  function newtriang (line 49) | func newtriang(limit int) label {

FILE: modules/diferenco/lcs/old.go
  type Diff (line 14) | type Diff struct
  function DiffStrings (line 21) | func DiffStrings(a, b string) []Diff { return diff(stringSeqs{a, b}) }
  function DiffBytes (line 25) | func DiffBytes(a, b []byte) []Diff { return diff(bytesSeqs{a, b}) }
  function DiffRunes (line 28) | func DiffRunes(a, b []rune) []Diff { return diff(runesSeqs{a, b}) }
  function diff (line 30) | func diff(seqs sequences) []Diff {
  function DiffSlices (line 37) | func DiffSlices[E comparable](a, b []E) []Diff {
  function compute (line 44) | func compute(seqs sequences, algo func(*editGraph) lcs, limit int) ([]Di...
  type editGraph (line 64) | type editGraph struct
    method fdone (line 95) | func (e *editGraph) fdone(D, k int) (bool, lcs) {
    method forwardlcs (line 151) | func (e *editGraph) forwardlcs(D, k int) lcs {
    method lookForward (line 173) | func (e *editGraph) lookForward(k, relx int) int {
    method setForward (line 182) | func (e *editGraph) setForward(d, k, relx int) {
    method getForward (line 187) | func (e *editGraph) getForward(d, k int) int {
    method bdone (line 195) | func (e *editGraph) bdone(D, k int) (bool, lcs) {
    method backwardlcs (line 256) | func (e *editGraph) backwardlcs(D, k int) lcs {
    method lookBackward (line 276) | func (e *editGraph) lookBackward(k, relx int) int {
    method setBackward (line 286) | func (e *editGraph) setBackward(d, k, relx int) {
    method getBackward (line 291) | func (e *editGraph) getBackward(d, k int) int {
    method twoDone (line 380) | func (e *editGraph) twoDone(df, db int) (int, bool) {
    method twolcs (line 406) | func (e *editGraph) twolcs(df, db, kf int) lcs {
  method toDiffs (line 75) | func (lcs lcs) toDiffs(alen, blen int) []Diff {
  function forward (line 106) | func forward(e *editGraph) lcs {
  function backward (line 207) | func backward(e *editGraph) lcs {
  function twosided (line 298) | func twosided(e *editGraph) lcs {

FILE: modules/diferenco/lcs/old_test.go
  function TestAlgosOld (line 16) | func TestAlgosOld(t *testing.T) {
  function TestIntOld (line 34) | func TestIntOld(t *testing.T) {
  function TestSpecialOld (line 62) | func TestSpecialOld(t *testing.T) { // exercises lcs.fix
  function TestRegressionOld001 (line 71) | func TestRegressionOld001(t *testing.T) {
  function TestRegressionOld002 (line 84) | func TestRegressionOld002(t *testing.T) {
  function TestRegressionOld003 (line 96) | func TestRegressionOld003(t *testing.T) {
  function TestRandOld (line 108) | func TestRandOld(t *testing.T) {
  function TestDiffAPI (line 132) | func TestDiffAPI(t *testing.T) {
  function BenchmarkTwoOld (line 159) | func BenchmarkTwoOld(b *testing.B) {
  function BenchmarkForwOld (line 171) | func BenchmarkForwOld(b *testing.B) {
  function genBench (line 183) | func genBench(set string, n int) []struct{ before, after string } {
  function BenchmarkLargeFileSmallDiff (line 218) | func BenchmarkLargeFileSmallDiff(b *testing.B) {

FILE: modules/diferenco/lcs/sequence.go
  type sequences (line 10) | type sequences interface
  type stringSeqs (line 16) | type stringSeqs struct
    method lengths (line 18) | func (s stringSeqs) lengths() (int, int) { return len(s.a), len(s.b) }
    method commonPrefixLen (line 19) | func (s stringSeqs) commonPrefixLen(ai, aj, bi, bj int) int {
    method commonSuffixLen (line 22) | func (s stringSeqs) commonSuffixLen(ai, aj, bi, bj int) int {
  type bytesSeqs (line 28) | type bytesSeqs struct
    method lengths (line 30) | func (s bytesSeqs) lengths() (int, int) { return len(s.a), len(s.b) }
    method commonPrefixLen (line 31) | func (s bytesSeqs) commonPrefixLen(ai, aj, bi, bj int) int {
    method commonSuffixLen (line 34) | func (s bytesSeqs) commonSuffixLen(ai, aj, bi, bj int) int {
  type runesSeqs (line 38) | type runesSeqs struct
    method lengths (line 40) | func (s runesSeqs) lengths() (int, int) { return len(s.a), len(s.b) }
    method commonPrefixLen (line 41) | func (s runesSeqs) commonPrefixLen(ai, aj, bi, bj int) int {
    method commonSuffixLen (line 44) | func (s runesSeqs) commonSuffixLen(ai, aj, bi, bj int) int {
  function commonPrefixLenBytes (line 56) | func commonPrefixLenBytes(a, b []byte) int {
  function commonPrefixLenRunes (line 64) | func commonPrefixLenRunes(a, b []rune) int {
  function commonPrefixLenString (line 72) | func commonPrefixLenString(a, b string) int {
  function commonSuffixLenBytes (line 82) | func commonSuffixLenBytes(a, b []byte) int {
  function commonSuffixLenRunes (line 90) | func commonSuffixLenRunes(a, b []rune) int {
  function commonSuffixLenString (line 98) | func commonSuffixLenString(a, b string) int {
  type comparableSeqs (line 107) | type comparableSeqs struct
  function commonPrefixLength (line 110) | func commonPrefixLength[E comparable](a, b []E) int {
  function commonSuffixLength (line 120) | func commonSuffixLength[E comparable](a, b []E) int {
  method lengths (line 130) | func (s comparableSeqs[E]) lengths() (int, int) { return len(s.a), len(s...
  method commonPrefixLen (line 131) | func (s comparableSeqs[E]) commonPrefixLen(ai, aj, bi, bj int) int {
  method commonSuffixLen (line 134) | func (s comparableSeqs[E]) commonSuffixLen(ai, aj, bi, bj int) int {

FILE: modules/diferenco/merge.go
  constant Sep1 (line 68) | Sep1 = "<<<<<<<"
  constant Sep2 (line 70) | Sep2 = "======="
  constant Sep3 (line 72) | Sep3 = ">>>>>>>"
  constant SepO (line 74) | SepO = "|||||||"
  type hunk (line 77) | type hunk
  function diff3MergeIndices (line 90) | func diff3MergeIndices[E comparable](ctx context.Context, o, a, b []E, a...
  type conflict (line 180) | type conflict struct
  type Diff3MergeResult (line 190) | type Diff3MergeResult struct
  function Diff3Merge (line 198) | func Diff3Merge[E comparable](ctx context.Context, o, a, b []E, algo Alg...
  constant STYLE_DEFAULT (line 272) | STYLE_DEFAULT = iota
  constant STYLE_DIFF3 (line 289) | STYLE_DIFF3
  constant STYLE_ZEALOUS_DIFF3 (line 304) | STYLE_ZEALOUS_DIFF3
  function ParseConflictStyle (line 315) | func ParseConflictStyle(s string) int {
  type MergeOptions (line 322) | type MergeOptions struct
    method ValidateOptions (line 330) | func (opts *MergeOptions) ValidateOptions() error {
  method writeConflict (line 349) | func (s *Sink) writeConflict(out io.Writer, opts *MergeOptions, conflict...
  function Merge (line 389) | func Merge(ctx context.Context, opts *MergeOptions) (string, bool, error) {
  function DefaultMerge (line 432) | func DefaultMerge(ctx context.Context, o, a, b string, labelO, labelA, l...
  function HasConflict (line 436) | func HasConflict(ctx context.Context, textO, textA, textB string) (bool,...

FILE: modules/diferenco/merge_parallel.go
  function HasConflictParallel (line 28) | func HasConflictParallel(ctx context.Context, textO, textA, textB string...
  function MergeParallel (line 67) | func MergeParallel(ctx context.Context, opts *MergeOptions) (string, boo...
  type newMergeResult (line 96) | type newMergeResult struct
  function newMergeInternal (line 101) | func newMergeInternal(
  type mergeRegion (line 154) | type mergeRegion struct
  function findMergeRegions (line 167) | func findMergeRegions(changesA, changesB []Change) []mergeRegion {
  function finalizeRegion (line 269) | func finalizeRegion(region mergeRegion, changesA, changesB []Change, aId...
  function isFalseConflict (line 282) | func isFalseConflict(region mergeRegion, changesA, changesB []Change, aI...
  function writeOriginLines (line 313) | func writeOriginLines(sink *Sink, out io.Writer, oIdx []int, start, end ...
  function writeNonConflictRegion (line 318) | func writeNonConflictRegion(sink *Sink, out io.Writer, aIdx, bIdx []int,...
  function writeConflictRegion (line 340) | func writeConflictRegion(
  function calculateRangeByIndices (line 369) | func calculateRangeByIndices(changes []Change, indices []int, lineIndex ...
  function parallelDiff (line 422) | func parallelDiff[E comparable](ctx context.Context, o, a, b []E, algo A...

FILE: modules/diferenco/merge_parallel_bench_test.go
  function generateText (line 12) | func generateText(lines int, prefix string) string {
  function generateModifiedText (line 23) | func generateModifiedText(lines int, prefix string, changes int) string {
  function generateConflictText (line 44) | func generateConflictText(lines int, prefix string, conflictRate int) (o...
  function BenchmarkMergeParallel (line 102) | func BenchmarkMergeParallel(b *testing.B) {
  function BenchmarkMergeParallelAlgorithms (line 168) | func BenchmarkMergeParallelAlgorithms(b *testing.B) {
  function BenchmarkMergeParallelConflictScenarios (line 214) | func BenchmarkMergeParallelConflictScenarios(b *testing.B) {
  function BenchmarkMergeParallelConflictStyles (line 263) | func BenchmarkMergeParallelConflictStyles(b *testing.B) {
  function BenchmarkHasConflictComparison (line 308) | func BenchmarkHasConflictComparison(b *testing.B) {
  function BenchmarkMergeParallelMemory (line 344) | func BenchmarkMergeParallelMemory(b *testing.B) {
  function BenchmarkMergeParallelComponents (line 383) | func BenchmarkMergeParallelComponents(b *testing.B) {

FILE: modules/diferenco/merge_parallel_test.go
  function TestMergeParallelBasic (line 19) | func TestMergeParallelBasic(t *testing.T) {
  function TestMergeParallelVsMerge (line 139) | func TestMergeParallelVsMerge(t *testing.T) {
  function TestMergeParallelLabels (line 236) | func TestMergeParallelLabels(t *testing.T) {
  function TestMergeParallelMultiLine (line 293) | func TestMergeParallelMultiLine(t *testing.T) {
  function TestMergeParallelContext (line 352) | func TestMergeParallelContext(t *testing.T) {
  function TestMergeParallelValidateOptions (line 375) | func TestMergeParallelValidateOptions(t *testing.T) {
  function TestMergeParallelAlgorithms (line 413) | func TestMergeParallelAlgorithms(t *testing.T) {
  function TestMergeParallelComplexConflicts (line 454) | func TestMergeParallelComplexConflicts(t *testing.T) {
  function TestMergeParallelEmptyRegion (line 520) | func TestMergeParallelEmptyRegion(t *testing.T) {
  function TestMergeParallelEdgeCases (line 579) | func TestMergeParallelEdgeCases(t *testing.T) {
  function TestHasConflictParallel (line 997) | func TestHasConflictParallel(t *testing.T) {
  function TestHasConflictParallelVsMerge (line 1163) | func TestHasConflictParallelVsMerge(t *testing.T) {
  function TestHasConflictParallelContextCancellation (line 1229) | func TestHasConflictParallelContextCancellation(t *testing.T) {

FILE: modules/diferenco/merge_test.go
  function TestMerge (line 10) | func TestMerge(t *testing.T) {
  function TestMerge2 (line 57) | func TestMerge2(t *testing.T) {
  function TestMerge3 (line 82) | func TestMerge3(t *testing.T) {
  function TestMergeConflicts (line 135) | func TestMergeConflicts(t *testing.T) {
  function TestWriteConflictSuffix (line 173) | func TestWriteConflictSuffix(t *testing.T) {
  function TestConflictSuffixDirectly (line 372) | func TestConflictSuffixDirectly(t *testing.T) {
  function TestDiff3MergeIndicesConflictBounds (line 456) | func TestDiff3MergeIndicesConflictBounds(t *testing.T) {
  function TestWriteConflictSuffixNeverHappens (line 529) | func TestWriteConflictSuffixNeverHappens(t *testing.T) {
  function TestMergeParallelSuffixBehavior (line 580) | func TestMergeParallelSuffixBehavior(t *testing.T) {
  function TestMergeParallelConflictSuffixDirectly (line 660) | func TestMergeParallelConflictSuffixDirectly(t *testing.T) {

FILE: modules/diferenco/minimal.go
  function minimal (line 10) | func minimal[E comparable](ctx context.Context, L1 []E, L2 []E) ([]Chang...

FILE: modules/diferenco/minimal_test.go
  function TestMinimalDiff (line 13) | func TestMinimalDiff(t *testing.T) {

FILE: modules/diferenco/myers.go
  function myers (line 15) | func myers[E comparable](ctx context.Context, L1 []E, L2 []E) ([]Change,...
  function myersCompute (line 25) | func myersCompute[E comparable](ctx context.Context, seq1 []E, P1 int, s...
  type snakePath (line 129) | type snakePath struct
  function newSnakePath (line 134) | func newSnakePath(pre *snakePath, x, y, length int) *snakePath {
  type fastIntArray (line 143) | type fastIntArray struct
    method get (line 155) | func (t *fastIntArray) get(i int) int {
    method set (line 163) | func (t *fastIntArray) set(i int, v int) {
  function newFastIntArray (line 148) | func newFastIntArray() *fastIntArray {
  type fastArrayWithNegIndex (line 183) | type fastArrayWithNegIndex struct
    method get (line 195) | func (t *fastArrayWithNegIndex) get(i int) *snakePath {
    method set (line 209) | func (t *fastArrayWithNegIndex) set(i int, v *snakePath) {
  function newFastPathArray (line 188) | func newFastPathArray() *fastArrayWithNegIndex {

FILE: modules/diferenco/myers_bench_test.go
  function myersFast (line 10) | func myersFast[E comparable](ctx context.Context, a []E, P1 int, b []E, ...
  function buildScriptFast (line 70) | func buildScriptFast[E comparable](trace [][]int, a, b []E, P1, P2 int) ...
  function mergeChangesFast (line 127) | func mergeChangesFast(ch []Change) []Change {
  function generateTestLines (line 151) | func generateTestLines(n int) []string {
  function randStringBench (line 159) | func randStringBench(n int) string {
  function BenchmarkMyersOriginal (line 168) | func BenchmarkMyersOriginal(b *testing.B) {
  function BenchmarkMyersFast (line 184) | func BenchmarkMyersFast(b *testing.B) {
  function BenchmarkMyersOriginalLarge (line 200) | func BenchmarkMyersOriginalLarge(b *testing.B) {
  function BenchmarkMyersFastLarge (line 215) | func BenchmarkMyersFastLarge(b *testing.B) {

FILE: modules/diferenco/myers_test.go
  function TestMyersDiff (line 11) | func TestMyersDiff(t *testing.T) {
  function TestMyersDiff2 (line 51) | func TestMyersDiff2(t *testing.T) {
  function TestMyersDiff3 (line 76) | func TestMyersDiff3(t *testing.T) {

FILE: modules/diferenco/onp.go
  function onpCompute (line 14) | func onpCompute[E comparable](ctx context.Context, L1 []E, P1 int, L2 []...
  type onpCtx (line 29) | type onpCtx struct
  method compare (line 38) | func (c *onpCtx[E]) compare(ctx context.Context) ([]Change, error) {
  method snake (line 84) | func (c *onpCtx[E]) snake(k int) {
  method reverse (line 130) | func (c *onpCtx[E]) reverse(curr *onpLcs) (next *onpLcs, n int) {
  type point (line 137) | type point struct
  type onpLcs (line 142) | type onpLcs struct
  function onp (line 150) | func onp[E comparable](ctx context.Context, L1, L2 []E) ([]Change, error) {

FILE: modules/diferenco/onp_test.go
  function TestONP (line 11) | func TestONP(t *testing.T) {

FILE: modules/diferenco/patience.go
  function uniqueElements (line 32) | func uniqueElements[E comparable](a []E) ([]E, []int) {
  function patienceLCS (line 51) | func patienceLCS[E comparable](a, b []E) [][2]int {
  function patienceCompute (line 126) | func patienceCompute[E comparable](ctx context.Context, L1 []E, P1 int, ...
  function patience (line 195) | func patience[E comparable](ctx context.Context, L1 []E, L2 []E) ([]Chan...

FILE: modules/diferenco/patience_bench_test.go
  function patienceLCSLegacy (line 11) | func patienceLCSLegacy[E comparable](a, b []E) [][2]int {
  function generateUniqueLinesPatience (line 49) | func generateUniqueLinesPatience(n int) []string {
  function randStringPatience (line 62) | func randStringPatience(n int) string {
  function BenchmarkPatienceLCSLegacy_Small (line 71) | func BenchmarkPatienceLCSLegacy_Small(b *testing.B) {
  function BenchmarkPatienceLCS_Small (line 86) | func BenchmarkPatienceLCS_Small(b *testing.B) {
  function BenchmarkPatienceLCSLegacy_Medium (line 101) | func BenchmarkPatienceLCSLegacy_Medium(b *testing.B) {
  function BenchmarkPatienceLCS_Medium (line 116) | func BenchmarkPatienceLCS_Medium(b *testing.B) {
  function BenchmarkPatienceLCSLegacy_Large (line 131) | func BenchmarkPatienceLCSLegacy_Large(b *testing.B) {
  function BenchmarkPatienceLCS_Large (line 146) | func BenchmarkPatienceLCS_Large(b *testing.B) {
  function TestPatienceLCSCorrectness (line 162) | func TestPatienceLCSCorrectness(t *testing.T) {
  function patienceComputeLegacy (line 188) | func patienceComputeLegacy[E comparable](ctx context.Context, L1 []E, P1...
  function DiffSlicesLegacy (line 251) | func DiffSlicesLegacy[E comparable](ctx context.Context, L1, L2 []E) ([]...
  function BenchmarkDiffSlicesLegacy (line 262) | func BenchmarkDiffSlicesLegacy(b *testing.B) {
  function BenchmarkPatienceDiff (line 278) | func BenchmarkPatienceDiff(b *testing.B) {
  function TestPatienceDiffEquivalence (line 295) | func TestPatienceDiffEquivalence(t *testing.T) {

FILE: modules/diferenco/patience_test.go
  function TestPatienceDiff (line 11) | func TestPatienceDiff(t *testing.T) {

FILE: modules/diferenco/regression_test.go
  function TestPatchNameHandlesNilSides (line 5) | func TestPatchNameHandlesNilSides(t *testing.T) {
  function TestValidateOptionsIdempotent (line 49) | func TestValidateOptionsIdempotent(t *testing.T) {

FILE: modules/diferenco/sink.go
  constant NEWLINE_RAW (line 13) | NEWLINE_RAW = iota
  constant NEWLINE_LF (line 14) | NEWLINE_LF
  constant NEWLINE_CRLF (line 15) | NEWLINE_CRLF
  type Sink (line 25) | type Sink struct
    method addLine (line 40) | func (s *Sink) addLine(line string) int {
    method ScanRawLines (line 50) | func (s *Sink) ScanRawLines(r io.Reader) ([]int, error) {
    method ScanLines (line 67) | func (s *Sink) ScanLines(r io.Reader) ([]int, error) {
    method SplitRawLines (line 79) | func (s *Sink) SplitRawLines(text string) []int {
    method SplitLines (line 94) | func (s *Sink) SplitLines(text string) []int {
    method parseLines (line 112) | func (s *Sink) parseLines(r io.Reader, text string) ([]int, error) {
    method WriteLine (line 119) | func (s *Sink) WriteLine(w io.Writer, E ...int) {
    method addEqualLines (line 137) | func (s *Sink) addEqualLines(h *Hunk, index []int, start, end int) int {
    method ToPatch (line 152) | func (s *Sink) ToPatch(from, to *File, changes []Change, linesA, lines...
  function NewSink (line 31) | func NewSink(newLineMode int) *Sink {
  function SplitWords (line 211) | func SplitWords(s string) []string {
  constant modePunct (line 255) | modePunct = iota
  constant modeWord (line 256) | modeWord
  constant modeSpace (line 257) | modeSpace
  constant modeSingle (line 258) | modeSingle
  function classify (line 292) | func classify(r rune) int {

FILE: modules/diferenco/sink_test.go
  function TestProcessLine (line 10) | func TestProcessLine(t *testing.T) {
  function TestProcessLineNewLine (line 24) | func TestProcessLineNewLine(t *testing.T) {
  function TestReadLines (line 40) | func TestReadLines(t *testing.T) {
  function TestReadLinesNoNewLine (line 59) | func TestReadLinesNoNewLine(t *testing.T) {
  function TestReadLinesLF (line 77) | func TestReadLinesLF(t *testing.T) {
  function TestProcessLineLF (line 96) | func TestProcessLineLF(t *testing.T) {
  function TestProcessLineNewLineLF (line 112) | func TestProcessLineNewLineLF(t *testing.T) {
  function TestSplitWord (line 128) | func TestSplitWord(t *testing.T) {
  function TestSplitWordsCases (line 149) | func TestSplitWordsCases(t *testing.T) {
  function TestSplitWordsASCIIFastPath (line 216) | func TestSplitWordsASCIIFastPath(t *testing.T) {
  function TestSplitWordsBoundary (line 234) | func TestSplitWordsBoundary(t *testing.T) {
  function equalStringSlices (line 256) | func equalStringSlices(a, b []string) bool {
  function BenchmarkSplitWords (line 268) | func BenchmarkSplitWords(b *testing.B) {

FILE: modules/diferenco/suffixarray.go
  type match (line 12) | type match struct
  function buildSuffixArray (line 19) | func buildSuffixArray[E cmp.Ordered](data []E) []int {
  function compareSuffixes (line 41) | func compareSuffixes[E cmp.Ordered](data []E, i, j int) int {
  function findLongestCommonSubstring (line 55) | func findLongestCommonSubstring[E cmp.Ordered](data1, data2 []E, sa []in...
  function binarySearchMatch (line 80) | func binarySearchMatch[E cmp.Ordered](data1, data2 []E, sa []int, start2...
  function findSuffixPosition (line 120) | func findSuffixPosition[E cmp.Ordered](data1, data2 []E, sa []int, start...
  function suffixArrayComputeOrdered (line 145) | func suffixArrayComputeOrdered[E cmp.Ordered](ctx context.Context, L1 []...
  function suffixArray (line 215) | func suffixArray[E comparable](ctx context.Context, L1, L2 []E) ([]Chang...
  function trySuffixArrayDiff (line 247) | func trySuffixArrayDiff[E comparable](ctx context.Context, L1, L2 []E, p...

FILE: modules/diferenco/suffixarray_test.go
  function TestSuffixArrayDiff (line 12) | func TestSuffixArrayDiff(t *testing.T) {
  function TestSuffixArrayDiffBasic (line 52) | func TestSuffixArrayDiffBasic(t *testing.T) {
  function TestSuffixArrayDiffRune (line 138) | func TestSuffixArrayDiffRune(t *testing.T) {
  function TestSuffixArrayDiffConsistency (line 201) | func TestSuffixArrayDiffConsistency(t *testing.T) {
  function TestBuildSuffixArray (line 252) | func TestBuildSuffixArray(t *testing.T) {
  function TestSuffixArrayDiffAlgorithm (line 317) | func TestSuffixArrayDiffAlgorithm(t *testing.T) {
  function TestSuffixArrayDiffContext (line 333) | func TestSuffixArrayDiffContext(t *testing.T) {
  function TestSuffixArrayDiffBinary (line 347) | func TestSuffixArrayDiffBinary(t *testing.T) {
  function reconstructFromChanges (line 390) | func reconstructFromChanges[E comparable](a []E, changes []Change, b []E...
  function equalSlices (line 422) | func equalSlices[E comparable](a, b []E) bool {

FILE: modules/diferenco/text.go
  constant MAX_DIFF_SIZE (line 24) | MAX_DIFF_SIZE = 100 << 20
  constant BINARY (line 25) | BINARY        = "binary"
  constant UTF8 (line 26) | UTF8          = "UTF-8"
  constant sniffLen (line 27) | sniffLen      = 8000
  function checkCharset (line 35) | func checkCharset(s string) string {
  function detectCharset (line 42) | func detectCharset(payload []byte) string {
  function readUnifiedText (line 52) | func readUnifiedText(r io.Reader) (string, string, error) {
  function readRawText (line 96) | func readRawText(r io.Reader, size int) (string, error) {
  function ReadUnifiedText (line 121) | func ReadUnifiedText(r io.Reader, size int64, textconv bool) (content st...
  function NewUnifiedReaderEx (line 139) | func NewUnifiedReaderEx(r io.Reader, textconv bool) (io.Reader, string, ...
  function NewUnifiedReader (line 159) | func NewUnifiedReader(r io.Reader) (io.Reader, error) {
  function NewTextReader (line 173) | func NewTextReader(r io.Reader) (io.Reader, error) {

FILE: modules/diferenco/unicode.go
  type interval (line 9) | type interval struct
  function isCJK (line 15) | func isCJK(r rune) bool {
  function isEmoji (line 20) | func isEmoji(r rune) bool {
  function inRange (line 25) | func inRange(ranges []interval, r rune) bool {

FILE: modules/diferenco/unicode_test.go
  function TestIsCJK (line 8) | func TestIsCJK(t *testing.T) {
  function TestIsEmoji (line 61) | func TestIsEmoji(t *testing.T) {
  function TestInRangeBinarySearch (line 103) | func TestInRangeBinarySearch(t *testing.T) {
  function TestCJKVsUnicodeLibrary (line 123) | func TestCJKVsUnicodeLibrary(t *testing.T) {

FILE: modules/diferenco/unified.go
  constant DefaultContextLines (line 15) | DefaultContextLines = 3
  type File (line 17) | type File struct
  type Patch (line 24) | type Patch struct
    method Name (line 39) | func (p Patch) Name() string {
    method Stat (line 49) | func (p Patch) Stat() FileStat {
    method Format (line 59) | func (p Patch) Format() ([]byte, int) {
    method String (line 134) | func (p Patch) String() string {
  type Hunk (line 203) | type Hunk struct
    method Stat (line 216) | func (h Hunk) Stat() (int, int) {
  type Line (line 229) | type Line struct
  function Unified (line 234) | func Unified(ctx context.Context, opts *Options) (*Patch, error) {

FILE: modules/diferenco/unified_encoder.go
  constant ZERO_OID_MAX (line 13) | ZERO_OID_MAX = "00000000000000000000000000000000000000000000000000000000...
  type UnifiedEncoder (line 32) | type UnifiedEncoder struct
    method Encode (line 98) | func (e *UnifiedEncoder) Encode(patches []*Patch) error {
    method appendPathLines (line 107) | func (e *UnifiedEncoder) appendPathLines(lines []string, fromPath, toP...
    method writeFilePatchHeader (line 124) | func (e *UnifiedEncoder) writeFilePatchHeader(p *Patch, b *strings.Bui...
    method writePatchHunk (line 188) | func (e *UnifiedEncoder) writePatchHunk(b *strings.Builder, hunk *Hunk) {
    method writeLine (line 239) | func (e *UnifiedEncoder) writeLine(b *strings.Builder, o *Line) {
    method writePatch (line 254) | func (e *UnifiedEncoder) writePatch(p *Patch) error {
  type EncoderOption (line 45) | type EncoderOption
  function WithVCS (line 48) | func WithVCS(vcs string) EncoderOption {
  function WithColor (line 57) | func WithColor(cc color.ColorConfig) EncoderOption {
  function WithSrcPrefix (line 64) | func WithSrcPrefix(prefix string) EncoderOption {
  function WithDstPrefix (line 71) | func WithDstPrefix(prefix string) EncoderOption {
  function WithNoRename (line 78) | func WithNoRename() EncoderOption {
  function NewUnifiedEncoder (line 85) | func NewUnifiedEncoder(w io.Writer, opts ...EncoderOption) *UnifiedEncod...

FILE: modules/env/broker.go
  type Broker (line 15) | type Broker interface
  type broker (line 25) | type broker struct
    method ExpandEnv (line 28) | func (b *broker) ExpandEnv(s string) string {
    method LookupEnv (line 32) | func (b *broker) LookupEnv(key string) (string, bool) {
    method Getenv (line 36) | func (b *broker) Getenv(key string) string {
    method Setenv (line 40) | func (b *broker) Setenv(key, value string) error {
    method Unsetenv (line 44) | func (b *broker) Unsetenv(key string) error {
    method Clearenv (line 48) | func (b *broker) Clearenv() {
    method Environ (line 52) | func (b *broker) Environ() []string {
  type sanitizer (line 56) | type sanitizer struct
    method ExpandEnv (line 77) | func (b *sanitizer) ExpandEnv(s string) string {
    method LookupEnv (line 81) | func (b *sanitizer) LookupEnv(key string) (string, bool) {
    method Getenv (line 100) | func (b *sanitizer) Getenv(key string) string {
    method Setenv (line 105) | func (b *sanitizer) Setenv(key, value string) error {
    method Unsetenv (line 128) | func (b *sanitizer) Unsetenv(key string) error {
    method Clearenv (line 139) | func (b *sanitizer) Clearenv() {
    method Environ (line 146) | func (b *sanitizer) Environ() []string {
    method Find (line 158) | func (b *sanitizer) Find(k K) string {
    method SimpleAtoi (line 162) | func (b *sanitizer) SimpleAtoi(k K, dv int64) int64 {
    method SimpleAtou (line 170) | func (b *sanitizer) SimpleAtou(k K, dv uint64) uint64 {
    method SimpleAtob (line 178) | func (b *sanitizer) SimpleAtob(k K, dv bool) bool {
    method Duration (line 183) | func (b *sanitizer) Duration(k K, dv time.Duration) time.Duration {
    method Strings (line 191) | func (b *sanitizer) Strings(k K) []string {
  function NewSanitizer (line 62) | func NewSanitizer() Broker {

FILE: modules/env/builder.go
  type Builder (line 3) | type Builder interface
  type builder (line 7) | type builder struct
    method Environ (line 10) | func (b *builder) Environ() []string {
  function NewBuilder (line 14) | func NewBuilder() Builder {

FILE: modules/env/constant.go
  type K (line 11) | type K
    method With (line 20) | func (k K) With(s string) string {
    method WithBool (line 24) | func (k K) WithBool(b bool) string {
    method WithInt (line 31) | func (k K) WithInt(i int64) string {
    method WithPaths (line 35) | func (k K) WithPaths(sv []string) string {
    method Withs (line 39) | func (k K) Withs(sv []string) string {
    method Find (line 43) | func (k K) Find() string {
    method Strings (line 48) | func (k K) Strings() []string {
    method StrSplit (line 54) | func (k K) StrSplit(sep string) []string {
    method SimpleAtob (line 60) | func (k K) SimpleAtob(dv bool) bool {
    method SimpleAtoi (line 68) | func (k K) SimpleAtoi(dv int64) int64 {
  constant ZETA_TERMINAL_PROMPT (line 15) | ZETA_TERMINAL_PROMPT  K      = "ZETA_TERMINAL_PROMPT"
  constant ZETA_NO_SSH_AUTH_SOCK (line 16) | ZETA_NO_SSH_AUTH_SOCK K      = "ZETA_NO_SSH_AUTH_SOCK"
  constant StandardSeparator (line 17) | StandardSeparator     string = ";"

FILE: modules/env/env.go
  function SanitizeEnv (line 11) | func SanitizeEnv(keys ...string) []string {
  function GetBool (line 32) | func GetBool(name string, fallback bool) (bool, error) {
  function GetInt (line 48) | func GetInt(name string, fallback int) (int, error) {
  function GetDuration (line 61) | func GetDuration(name string, fallback time.Duration) (time.Duration, er...
  function GetString (line 76) | func GetString(name string, fallback string) string {

FILE: modules/env/env_test.go
  function TestEnviron (line 11) | func TestEnviron(t *testing.T) {
  function TestEnvironForEach (line 18) | func TestEnvironForEach(t *testing.T) {
  function TestSanitizeEnv (line 26) | func TestSanitizeEnv(t *testing.T) {

FILE: modules/env/env_unix.go
  function DelayInitializeEnv (line 67) | func DelayInitializeEnv() error {
  function LookupPager (line 88) | func LookupPager(name string) (string, error) {

FILE: modules/env/env_windows.go
  function hasGitExe (line 62) | func hasGitExe(installDir string) bool {
  function cleanupEnv (line 70) | func cleanupEnv(pathList []string) {
  function DelayInitializeEnv (line 89) | func DelayInitializeEnv() error {
  function LookupPager (line 118) | func LookupPager(name string) (string, error) {

FILE: modules/env/env_windows_test.go
  function TestInitializeEnv (line 11) | func TestInitializeEnv(t *testing.T) {
  function TestLookupPager (line 18) | func TestLookupPager(t *testing.T) {

FILE: modules/fnmatch/fnmatch.go
  constant FNM_NOESCAPE (line 20) | FNM_NOESCAPE = (1 << iota)
  constant FNM_PATHNAME (line 21) | FNM_PATHNAME
  constant FNM_PERIOD (line 22) | FNM_PERIOD
  constant FNM_LEADING_DIR (line 24) | FNM_LEADING_DIR
  constant FNM_CASEFOLD (line 25) | FNM_CASEFOLD
  constant FNM_IGNORECASE (line 27) | FNM_IGNORECASE = FNM_CASEFOLD
  constant FNM_FILE_NAME (line 28) | FNM_FILE_NAME  = FNM_PATHNAME
  function unpackRune (line 31) | func unpackRune(str *string) rune {
  function Match (line 40) | func Match(pattern, s string, flags int) bool {
  function rangematch (line 148) | func rangematch(pattern *string, test rune, flags int) bool {

FILE: modules/fnmatch/fnmatch_test.go
  function TestMatch (line 13) | func TestMatch(t *testing.T) {
  function TestWildcard (line 35) | func TestWildcard(t *testing.T) {
  function TestWildcardSlash (line 62) | func TestWildcardSlash(t *testing.T) {
  function TestWildcardFNMPeriod (line 101) | func TestWildcardFNMPeriod(t *testing.T) {
  function TestQuestionMark (line 125) | func TestQuestionMark(t *testing.T) {
  function TestQuestionMarkExceptions (line 157) | func TestQuestionMarkExceptions(t *testing.T) {
  function TestRange (line 182) | func TestRange(t *testing.T) {
  function TestBackSlash (line 265) | func TestBackSlash(t *testing.T) {
  function TestLiteral (line 301) | func TestLiteral(t *testing.T) {
  function TestFNMLeadingDir (line 330) | func TestFNMLeadingDir(t *testing.T) {
  function TestMatchBUG (line 355) | func TestMatchBUG(t *testing.T) {

FILE: modules/gcfg/errors.go
  function FatalOnly (line 22) | func FatalOnly(err error) error {
  function newSyntaxWarning (line 34) | func newSyntaxWarning(sec, sub, variable string) error {
  function joinNonFatal (line 45) | func joinNonFatal(prev, cur error) (error, bool) {

FILE: modules/gcfg/errors_test.go
  function TestXxx (line 5) | func TestXxx(t *testing.T) {

FILE: modules/gcfg/example_test.go
  function ExampleReadStringInto (line 10) | func ExampleReadStringInto() {
  function ExampleReadStringInto_bool (line 27) | func ExampleReadStringInto_bool() {
  function ExampleReadStringInto_hyphens (line 44) | func ExampleReadStringInto_hyphens() {
  function ExampleReadStringInto_tags (line 61) | func ExampleReadStringInto_tags() {
  function ExampleReadStringInto_subsections (line 78) | func ExampleReadStringInto_subsections() {
  function ExampleReadStringInto_multivalue (line 99) | func ExampleReadStringInto_multivalue() {
  function ExampleReadStringInto_unicode (line 117) | func ExampleReadStringInto_unicode() {

FILE: modules/gcfg/issues_test.go
  type Config1 (line 10) | type Config1 struct
  function TestIssue1 (line 32) | func TestIssue1(t *testing.T) {
  type confIssue2 (line 51) | type confIssue2 struct
  function TestIssue2 (line 58) | func TestIssue2(t *testing.T) {

FILE: modules/gcfg/read.go
  function unquote (line 16) | func unquote(s string) (string, error) {
  function read (line 49) | func read(callback func(string, string, string, string, bool) error,
  function readInto (line 214) | func readInto(config any, fset *token.FileSet, file *token.File,
  function ReadWithCallback (line 246) | func ReadWithCallback(reader io.Reader, callback func(string, string, st...
  function ReadInto (line 263) | func ReadInto(config any, reader io.Reader) error {
  function ReadStringInto (line 278) | func ReadStringInto(config any, str string) error {
  function ReadFileInto (line 285) | func ReadFileInto(config any, filename string) error {

FILE: modules/gcfg/read_test.go
  constant sp64 (line 18) | sp64 = "                                                                "
  constant sp512 (line 20) | sp512 = sp64 + sp64 + sp64 + sp64 + sp64 + sp64 + sp64 + sp64
  constant sp4096 (line 22) | sp4096 = sp512 + sp512 + sp512 + sp512 + sp512 + sp512 + sp512 + sp512
  type cBasic (line 25) | type cBasic struct
  type cBasicS1 (line 32) | type cBasicS1 struct
  type cBasicS2 (line 37) | type cBasicS2 struct
  type cBasicS3 (line 40) | type cBasicS3 struct
  type nonMulti (line 44) | type nonMulti
  type unmarshalable (line 46) | type unmarshalable
    method UnmarshalText (line 48) | func (u *unmarshalable) UnmarshalText(text []byte) error {
  type cUni (line 59) | type cUni struct
  type cUniS1 (line 63) | type cUniS1 struct
  type cUniS2 (line 66) | type cUniS2 struct
  type cMulti (line 70) | type cMulti struct
  type cMultiS1 (line 75) | type cMultiS1 struct
  type cMultiS2 (line 76) | type cMultiS2 struct
  type cMultiS3 (line 77) | type cMultiS3 struct
  type cSubs (line 79) | type cSubs struct
  type cSubsS1 (line 80) | type cSubsS1 struct
  type cBool (line 82) | type cBool struct
  type cBoolS1 (line 83) | type cBoolS1 struct
  type cTxUnm (line 85) | type cTxUnm struct
  type cTxUnmS1 (line 86) | type cTxUnmS1 struct
  type cNum (line 88) | type cNum struct
  type cNumS1 (line 93) | type cNumS1 struct
  type cNumS2 (line 98) | type cNumS2 struct
  type cNumS3 (line 102) | type cNumS3 struct
  type readtest (line 103) | type readtest struct
  function newString (line 109) | func newString(s string) *string {
  function newStringSlice (line 114) | func newStringSlice(s ...string) *[]string {
  function TestReadStringInto (line 286) | func TestReadStringInto(t *testing.T) {
  function TestReadStringIntoMultiBlankPreset (line 297) | func TestReadStringIntoMultiBlankPreset(t *testing.T) {
  function testRead (line 303) | func testRead(t *testing.T, id string, tt readtest) {
  function testReadInto (line 311) | func testReadInto(t *testing.T, id string, tt readtest, res any) {
  function TestReadFileInto (line 335) | func TestReadFileInto(t *testing.T) {
  function TestReadFileIntoUnicode (line 346) | func TestReadFileIntoUnicode(t *testing.T) {
  function TestReadStringIntoSubsectDefaults (line 357) | func TestReadStringIntoSubsectDefaults(t *testing.T) {
  function TestReadStringIntoExtraData (line 378) | func TestReadStringIntoExtraData(t *testing.T) {
  function TestReadWithCallback (line 397) | func TestReadWithCallback(t *testing.T) {
  function TestReadWithCallback_WithError (line 459) | func TestReadWithCallback_WithError(t *testing.T) {

FILE: modules/gcfg/scanner/errors.go
  type Error (line 20) | type Error struct
    method Error (line 26) | func (e Error) Error() string {
  type ErrorList (line 37) | type ErrorList
    method Add (line 40) | func (p *ErrorList) Add(pos token.Position, msg string) {
    method Reset (line 45) | func (p *ErrorList) Reset() { *p = (*p)[0:0] }
    method Len (line 48) | func (p ErrorList) Len() int      { return len(p) }
    method Swap (line 49) | func (p ErrorList) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
    method Less (line 51) | func (p ErrorList) Less(i, j int) bool {
    method Sort (line 66) | func (p ErrorList) Sort() {
    method RemoveMultiples (line 71) | func (p *ErrorList) RemoveMultiples() {
    method Error (line 86) | func (p ErrorList) Error() string {
    method Err (line 98) | func (p ErrorList) Err() error {
  function PrintError (line 108) | func PrintError(w io.Writer, err error) {

FILE: modules/gcfg/scanner/example_test.go
  function ExampleScanner_Scan (line 15) | func ExampleScanner_Scan() {

FILE: modules/gcfg/scanner/scanner.go
  type ErrorHandler (line 29) | type ErrorHandler
  type Scanner (line 34) | type Scanner struct
    method next (line 55) | func (s *Scanner) next() error {
    method Init (line 115) | func (s *Scanner) Init(file *token.File, src []byte, err ErrorHandler,...
    method error (line 138) | func (s *Scanner) error(offs int, msg string) error {
    method scanComment (line 154) | func (s *Scanner) scanComment() string {
    method scanIdentifier (line 172) | func (s *Scanner) scanIdentifier() string {
    method scanEscape (line 181) | func (s *Scanner) scanEscape(val bool) error {
    method scanString (line 202) | func (s *Scanner) scanString() (string, error) {
    method scanValString (line 241) | func (s *Scanner) scanValString() (string, error) {
    method skipWhitespace (line 292) | func (s *Scanner) skipWhitespace() {
    method Scan (line 320) | func (s *Scanner) Scan() (pos token.Pos, tok token.Token, lit string, ...
  type Mode (line 94) | type Mode
  constant ScanComments (line 97) | ScanComments Mode = 1 << iota
  function isLetter (line 164) | func isLetter(ch rune) bool {
  function isDigit (line 168) | func isDigit(ch rune) bool {
  function stripCR (line 229) | func stripCR(b []byte) []byte {
  function isWhiteSpace (line 288) | func isWhiteSpace(ch rune) bool {

FILE: modules/gcfg/scanner/scanner_test.go
  constant special (line 18) | special = iota
  constant literal (line 19) | literal
  constant operator (line 20) | operator
  function tokenclass (line 23) | func tokenclass(tok token.Token) int {
  type elt (line 33) | type elt struct
  constant whitespace (line 83) | whitespace = "  \t  \n\n\n"
  function newlineCount (line 96) | func newlineCount(s string) int {
  function checkPos (line 106) | func checkPos(t *testing.T, lit string, p token.Pos, expected token.Posi...
  function TestScan (line 123) | func TestScan(t *testing.T) {
  function TestScanValStringEOF (line 260) | func TestScanValStringEOF(t *testing.T) {
  function TestInit (line 283) | func TestInit(t *testing.T) {
  function TestStdErrorHandler (line 329) | func TestStdErrorHandler(t *testing.T) {
  type errorCollector (line 374) | type errorCollector struct
  function checkError (line 380) | func checkError(t *testing.T, src string, tok token.Token, pos int, err ...
  function TestScanErrors (line 455) | func TestScanErrors(t *testing.T) {
  function BenchmarkScan (line 461) | func BenchmarkScan(b *testing.B) {

FILE: modules/gcfg/set.go
  type tag (line 26) | type tag struct
  function newTag (line 31) | func newTag(ts string) tag {
  function fieldFold (line 43) | func fieldFold(v reflect.Value, name string) (reflect.Value, tag) {
  type setter (line 67) | type setter
  function textUnmarshalerSetter (line 73) | func textUnmarshalerSetter(d any, blank bool, val string, t tag) error {
  function boolSetter (line 84) | func boolSetter(d any, blank bool, val string, t tag) error {
  function intMode (line 96) | func intMode(mode string) types.IntMode {
  function intModeDefault (line 125) | func intModeDefault(t reflect.Type) types.IntMode {
  function intSetter (line 133) | func intSetter(d any, blank bool, val string, t tag) error {
  function stringSetter (line 144) | func stringSetter(d any, blank bool, val string, t tag) error {
  function typeSetter (line 176) | func typeSetter(d any, blank bool, val string, tt tag) error {
  function kindSetter (line 185) | func kindSetter(d any, blank bool, val string, tt tag) error {
  function scanSetter (line 194) | func scanSetter(d any, blank bool, val string, tt tag) error {
  function newValue (line 201) | func newValue(sect string, vCfg reflect.Value,
  function set (line 225) | func set(cfg any, sect, sub, name string,

FILE: modules/gcfg/token/position.go
  type Position (line 29) | type Position struct
    method IsValid (line 37) | func (pos *Position) IsValid() bool { return pos.Line > 0 }
    method String (line 45) | func (pos Position) String() string {
  type Pos (line 78) | type Pos
    method IsValid (line 87) | func (p Pos) IsValid() bool {
  constant NoPos (line 84) | NoPos Pos = 0
  type File (line 96) | type File struct
    method Name (line 108) | func (f *File) Name() string {
    method Base (line 113) | func (f *File) Base() int {
    method Size (line 118) | func (f *File) Size() int {
    method LineCount (line 123) | func (f *File) LineCount() int {
    method AddLine (line 133) | func (f *File) AddLine(offset int) {
    method SetLines (line 148) | func (f *File) SetLines(lines []int) bool {
    method SetLinesForContent (line 165) | func (f *File) SetLinesForContent(content []byte) {
    method AddLineInfo (line 201) | func (f *File) AddLineInfo(offset int, filename string, line int) {
    method Pos (line 212) | func (f *File) Pos(offset int) (Pos, error) {
    method Offset (line 222) | func (f *File) Offset(p Pos) (int, error) {
    method Line (line 231) | func (f *File) Line(p Pos) (int, error) {
    method info (line 245) | func (f *File) info(offset int) (filename string, line, column int) {
    method position (line 263) | func (f *File) position(p Pos) (pos Position) {
    method Position (line 272) | func (f *File) Position(p Pos) (Position, error) {
  type lineInfo (line 187) | type lineInfo struct
  function searchLineInfos (line 240) | func searchLineInfos(a []lineInfo, x int) int {
  type FileSet (line 288) | type FileSet struct
    method Base (line 304) | func (s *FileSet) Base() int {
    method AddFile (line 326) | func (s *FileSet) AddFile(filename string, base, size int) (*File, err...
    method Iterate (line 347) | func (s *FileSet) Iterate(f func(*File) bool) {
    method file (line 365) | func (s *FileSet) file(p Pos) *File {
    method File (line 385) | func (s *FileSet) File(p Pos) (f *File) {
    method Position (line 395) | func (s *FileSet) Position(p Pos) (pos Position) {
  function NewFileSet (line 296) | func NewFileSet() *FileSet {
  function searchFiles (line 361) | func searchFiles(a []*File, x int) int {
  function searchInts (line 409) | func searchInts(a []int, x int) int {

FILE: modules/gcfg/token/position_test.go
  function checkPos (line 12) | func checkPos(t *testing.T, msg string, p, q Position) {
  function TestNoPos (line 27) | func TestNoPos(t *testing.T) {
  function linecol (line 53) | func linecol(lines []int, offs int) (int, int) {
  function verifyPositions (line 64) | func verifyPositions(t *testing.T, fset *FileSet, f *File, lines []int) {
  function makeTestSource (line 92) | func makeTestSource(size int, lines []int) []byte {
  function TestPositions (line 102) | func TestPositions(t *testing.T) {
  function TestLineInfo (line 167) | func TestLineInfo(t *testing.T) {
  function TestFiles (line 200) | func TestFiles(t *testing.T) {

FILE: modules/gcfg/token/serialize.go
  type serializedFile (line 7) | type serializedFile struct
  type serializedFileSet (line 16) | type serializedFileSet struct
  method Read (line 22) | func (s *FileSet) Read(decode func(any) error) error {
  method Write (line 43) | func (s *FileSet) Write(encode func(any) error) error {

FILE: modules/gcfg/token/serialize_test.go
  function equal (line 16) | func equal(p, q *FileSet) error {
  function checkSerialize (line 71) | func checkSerialize(t *testing.T, p *FileSet) {
  function TestSerialization (line 93) | func TestSerialization(t *testing.T) {

FILE: modules/gcfg/token/token.go
  type Token (line 15) | type Token
    method String (line 60) | func (tok Token) String() string {
    method IsLiteral (line 75) | func (tok Token) IsLiteral() bool { return literal_beg < tok && tok < ...
    method IsOperator (line 79) | func (tok Token) IsOperator() bool { return operator_beg < tok && tok ...
  constant ILLEGAL (line 20) | ILLEGAL Token = iota
  constant EOF (line 21) | EOF
  constant COMMENT (line 22) | COMMENT
  constant literal_beg (line 24) | literal_beg
  constant IDENT (line 27) | IDENT
  constant STRING (line 28) | STRING
  constant literal_end (line 29) | literal_end
  constant operator_beg (line 31) | operator_beg
  constant ASSIGN (line 33) | ASSIGN
  constant LBRACK (line 34) | LBRACK
  constant RBRACK (line 35) | RBRACK
  constant EOL (line 36) | EOL
  constant operator_end (line 37) | operator_end

FILE: modules/gcfg/types/bool.go
  function ParseBool (line 17) | func ParseBool(s string) (bool, error) {

FILE: modules/gcfg/types/enum.go
  type EnumParser (line 11) | type EnumParser struct
    method AddVals (line 19) | func (ep *EnumParser) AddVals(vals map[string]any) {
    method Parse (line 35) | func (ep EnumParser) Parse(s string) (any, error) {

FILE: modules/gcfg/types/enum_test.go
  function TestEnumParserBool (line 7) | func TestEnumParserBool(t *testing.T) {

FILE: modules/gcfg/types/int.go
  type IntMode (line 16) | type IntMode
    method String (line 26) | func (m IntMode) String() string {
  constant Dec (line 20) | Dec IntMode = 1 << iota
  constant Hex (line 21) | Hex
  constant Oct (line 22) | Oct
  function prefix0 (line 40) | func prefix0(val string) bool {
  function prefix0x (line 44) | func prefix0x(val string) bool {
  function ParseInt (line 51) | func ParseInt(intptr any, val string, mode IntMode) error {

FILE: modules/gcfg/types/int_test.go
  function elem (line 8) | func elem(p any) any {
  function TestParseInt (line 12) | func TestParseInt(t *testing.T) {

FILE: modules/gcfg/types/scan.go
  function ScanFully (line 11) | func ScanFully(ptr any, val string, verb byte) error {

FILE: modules/gcfg/types/scan_test.go
  function TestScanFully (line 8) | func TestScanFully(t *testing.T) {

FILE: modules/git/branch.go
  function JoinBranchPrefix (line 13) | func JoinBranchPrefix(b string) string {
  function JoinBranchRev (line 20) | func JoinBranchRev(r string) string {
  function RevParseCurrentName (line 35) | func RevParseCurrentName(ctx context.Context, environ []string, repoPath...
  function RevParseCurrent (line 66) | func RevParseCurrent(ctx context.Context, environ []string, repoPath str...
  function SymReferenceLink (line 86) | func SymReferenceLink(ctx context.Context, repoPath string, refname stri...
  function FindBranch (line 94) | func FindBranch(ctx context.Context, repoPath string, name string) (*Ref...
  function ParseBranchLineEx (line 115) | func ParseBranchLineEx(referenceLine string) (*ReferenceEx, error) {

FILE: modules/git/command.go
  type commandReader (line 11) | type commandReader struct
    method Read (line 16) | func (c *commandReader) Read(p []byte) (int, error) {
    method Close (line 23) | func (c *commandReader) Close() (err error) {
  function NewReader (line 31) | func NewReader(ctx context.Context, opt *command.RunOpts, arg ...string)...

FILE: modules/git/commit.go
  type ExtraHeader (line 18) | type ExtraHeader struct
  type Commit (line 27) | type Commit struct
    method Size (line 47) | func (c *Commit) Size() int64 {
    method Signature (line 51) | func (c *Commit) Signature() string {
    method ExtractCommitGPGSignature (line 66) | func (c *Commit) ExtractCommitGPGSignature() *CommitGPGSignature {
    method Decode (line 115) | func (c *Commit) Decode(hash string, reader io.Reader, size int64) err...
    method Subject (line 187) | func (c *Commit) Subject() string {
  type CommitGPGSignature (line 61) | type CommitGPGSignature struct
  function RevUniqueList (line 194) | func RevUniqueList(ctx context.Context, repoPath string, ours, theirs st...
  function RevDivergingCount (line 230) | func RevDivergingCount(ctx context.Context, repoPath string, from, to st...

FILE: modules/git/commit_test.go
  function TestCommitDecodeWithMultipleParents (line 9) | func TestCommitDecodeWithMultipleParents(t *testing.T) {
  function TestCommitDecodeWithSpecialCharacters (line 29) | func TestCommitDecodeWithSpecialCharacters(t *testing.T) {
  function TestCommitDecodeWithExtraHeaderBeforeStandard (line 63) | func TestCommitDecodeWithExtraHeaderBeforeStandard(t *testing.T) {
  function TestCommitDecodeWithComplexHeaders (line 87) | func TestCommitDecodeWithComplexHeaders(t *testing.T) {

FILE: modules/git/config/config.go
  function New (line 4) | func New() *Config {
  type Config (line 9) | type Config struct
    method Section (line 34) | func (c *Config) Section(name string) *Section {
    method HasSection (line 48) | func (c *Config) HasSection(name string) bool {
    method RemoveSection (line 58) | func (c *Config) RemoveSection(name string) *Config {
    method RemoveSubsection (line 71) | func (c *Config) RemoveSubsection(section string, subsection string) *...
    method AddOption (line 89) | func (c *Config) AddOption(section string, subsection string, key stri...
    method SetOption (line 101) | func (c *Config) SetOption(section string, subsection string, key stri...
    method HashFormat (line 111) | func (c *Config) HashFormat() string {
    method ReferencesFormat (line 120) | func (c *Config) ReferencesFormat() string {
  type Includes (line 16) | type Includes
  type Include (line 19) | type Include struct
  type Comment (line 25) | type Comment
  constant NoSubsection (line 30) | NoSubsection = ""

FILE: modules/git/config/decoder.go
  type Decoder (line 12) | type Decoder struct
    method Decode (line 23) | func (d *Decoder) Decode(config *Config) error {
  function NewDecoder (line 17) | func NewDecoder(r io.Reader) *Decoder {
  function BareDecode (line 41) | func BareDecode(repoPath string) (*Config, error) {

FILE: modules/git/config/option.go
  type Option (line 10) | type Option struct
    method IsKey (line 22) | func (o *Option) IsKey(key string) bool {
  type Options (line 18) | type Options
    method GoString (line 26) | func (opts Options) GoString() string {
    method Get (line 48) | func (opts Options) Get(key string) string {
    method Has (line 59) | func (opts Options) Has(key string) bool {
    method GetAll (line 69) | func (opts Options) GetAll(key string) []string {
    method withoutOption (line 79) | func (opts Options) withoutOption(key string) Options {
    method withAddedOption (line 89) | func (opts Options) withAddedOption(key string, value string) Options {
    method withSettedOption (line 93) | func (opts Options) withSettedOption(key string, values ...string) Opt...

FILE: modules/git/config/section.go
  type Section (line 28) | type Section struct
    method IsName (line 62) | func (s *Section) IsName(name string) bool {
    method Subsection (line 68) | func (s *Section) Subsection(name string) *Subsection {
    method HasSubsection (line 82) | func (s *Section) HasSubsection(name string) bool {
    method RemoveSubsection (line 93) | func (s *Section) RemoveSubsection(name string) *Section {
    method Option (line 107) | func (s *Section) Option(key string) string {
    method OptionAll (line 113) | func (s *Section) OptionAll(key string) []string {
    method HasOption (line 118) | func (s *Section) HasOption(key string) bool {
    method AddOption (line 123) | func (s *Section) AddOption(key string, value string) *Section {
    method SetOption (line 130) | func (s *Section) SetOption(key string, value string) *Section {
    method RemoveOption (line 136) | func (s *Section) RemoveOption(key string) *Section {
  type Subsection (line 34) | type Subsection struct
    method IsName (line 142) | func (s *Subsection) IsName(name string) bool {
    method Option (line 148) | func (s *Subsection) Option(key string) string {
    method OptionAll (line 154) | func (s *Subsection) OptionAll(key string) []string {
    method HasOption (line 159) | func (s *Subsection) HasOption(key string) bool {
    method AddOption (line 164) | func (s *Subsection) AddOption(key string, value string) *Subsection {
    method SetOption (line 171) | func (s *Subsection) SetOption(key string, value ...string) *Subsection {
    method RemoveOption (line 177) | func (s *Subsection) RemoveOption(key string) *Subsection {
  type Sections (line 39) | type Sections
    method GoString (line 41) | func (s Sections) GoString() string {
  type Subsections (line 50) | type Subsections
    method GoString (line 52) | func (s Subsections) GoString() string {

FILE: modules/git/constant.go
  constant GIT_HASH_UNKNOWN (line 11) | GIT_HASH_UNKNOWN      = 0
  constant GIT_HASH_SHA1 (line 12) | GIT_HASH_SHA1         = 1
  constant GIT_HASH_SHA256 (line 13) | GIT_HASH_SHA256       = 2
  constant GIT_SHA1_RAWSZ (line 14) | GIT_SHA1_RAWSZ        = 20
  constant GIT_SHA1_HEXSZ (line 15) | GIT_SHA1_HEXSZ        = GIT_SHA1_RAWSZ * 2
  constant GIT_SHA256_RAWSZ (line 16) | GIT_SHA256_RAWSZ      = 32
  constant GIT_SHA256_HEXSZ (line 17) | GIT_SHA256_HEXSZ      = GIT_SHA256_RAWSZ * 2
  constant GIT_MAX_RAWSZ (line 18) | GIT_MAX_RAWSZ         = GIT_SHA256_RAWSZ
  constant GIT_MAX_HEXSZ (line 19) | GIT_MAX_HEXSZ         = GIT_SHA256_HEXSZ
  constant GIT_SHA1_ZERO_HEX (line 20) | GIT_SHA1_ZERO_HEX     = "0000000000000000000000000000000000000000"
  constant GIT_SHA256_ZERO_HEX (line 21) | GIT_SHA256_ZERO_HEX   = "00000000000000000000000000000000000000000000000...
  constant GIT_SHA1_EMPTY_TREE (line 22) | GIT_SHA1_EMPTY_TREE   = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
  constant GIT_SHA1_EMPTY_BLOB (line 23) | GIT_SHA1_EMPTY_BLOB   = "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
  constant GIT_SHA256_EMPTY_TREE (line 24) | GIT_SHA256_EMPTY_TREE = "6ef19b41225c5369f1c104d45d8d85efa9b057b53b14b4b...
  constant GIT_SHA256_EMPTY_BLOB (line 25) | GIT_SHA256_EMPTY_BLOB = "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f...
  constant GIT_SHA1_NAME (line 26) | GIT_SHA1_NAME         = "sha1"
  constant GIT_SHA256_NAME (line 27) | GIT_SHA256_NAME       = "sha256"
  constant HashKey (line 28) | HashKey               = "hash-algo"
  constant ReferenceNameDefault (line 29) | ReferenceNameDefault  = "refs/heads/master"
  constant reverseHexTable (line 33) | reverseHexTable = "" +
  function ValidateHexLax (line 57) | func ValidateHexLax(hs string) bool {
  function ValidateNumber (line 70) | func ValidateNumber(s string) bool {
  function ValidateHex (line 80) | func ValidateHex(hs string) error {
  function IsValidateSHA256 (line 93) | func IsValidateSHA256(hs string) bool {
  function IsHashZero (line 106) | func IsHashZero(hexOID string) bool {
  function ConformingHashZero (line 113) | func ConformingHashZero(hexOID string) string {
  function ConformingEmptyTree (line 120) | func ConformingEmptyTree(hexOID string) string {
  function ConformingEmptyBlob (line 127) | func ConformingEmptyBlob(hexOID string) string {
  type HashFormat (line 135) | type HashFormat
    method String (line 143) | func (h HashFormat) String() string {
    method RawSize (line 154) | func (h HashFormat) RawSize() int {
    method HexSize (line 165) | func (h HashFormat) HexSize() int {
    method EmptyTreeID (line 175) | func (h HashFormat) EmptyTreeID() string {
    method EmptyBlobID (line 185) | func (h HashFormat) EmptyBlobID() string {
    method ZeroOID (line 195) | func (h HashFormat) ZeroOID() string {
    method Hasher (line 205) | func (h HashFormat) Hasher() hash.Hash {
  constant HashUNKNOWN (line 138) | HashUNKNOWN HashFormat = iota
  constant HashSHA1 (line 139) | HashSHA1
  constant HashSHA256 (line 140) | HashSHA256
  function HashFormatFromName (line 215) | func HashFormatFromName(algo string) HashFormat {
  function HashFormatFromSize (line 225) | func HashFormatFromSize(size int) HashFormat {
  function HashFormatFromBinarySize (line 235) | func HashFormatFromBinarySize(bsize int) HashFormat {

FILE: modules/git/decode.go
  constant contentsCommand (line 19) | contentsCommand = "contents"
  constant infoCommand (line 22) | infoCommand = "info"
  constant flushCommand (line 26) | flushCommand = "flush"
  type Decoder (line 29) | type Decoder struct
    method Close (line 66) | func (d *Decoder) Close() error {
    method flush (line 73) | func (d *Decoder) flush() error {
    method readObject (line 88) | func (d *Decoder) readObject(cmd, revision string) error {
    method readBatchLine (line 115) | func (d *Decoder) readBatchLine() (string, string, int64, error) {
    method Meta (line 142) | func (d *Decoder) Meta(objectKey string) (*Metadata, error) {
    method object (line 157) | func (d *Decoder) object(objectKey string) (*Object, error) {
    method ObjectReader (line 173) | func (d *Decoder) ObjectReader(objectKey string) (*Object, error) {
    method Object (line 177) | func (d *Decoder) Object(objectKey string) (any, error) {
    method Tree (line 210) | func (d *Decoder) Tree(objectKey string) (*Tree, error) {
    method Commit (line 227) | func (d *Decoder) Commit(objectKey string) (*Commit, error) {
    method Blob (line 243) | func (d *Decoder) Blob(objectKey string) (*Object, error) {
    method ReadOverflow (line 255) | func (d *Decoder) ReadOverflow(objectKey string, limit int64) (b []byt...
    method BlobEntry (line 268) | func (d *Decoder) BlobEntry(revision string, path string) (*Object, er...
    method ReadEntry (line 272) | func (d *Decoder) ReadEntry(revision string, path string) (*Object, er...
    method ParseRev (line 277) | func (d *Decoder) ParseRev(objectKey string) (*Commit, error) {
    method ExhaustiveMeta (line 305) | func (d *Decoder) ExhaustiveMeta(location string) (*Metadata, error) {
    method ExhaustiveObjectReader (line 332) | func (d *Decoder) ExhaustiveObjectReader(location string) (*Object, er...
  function NewDecoder (line 35) | func NewDecoder(ctx context.Context, repoPath string) (*Decoder, error) {
  constant missingSuffix (line 108) | missingSuffix = " missing"
  function ParseRev (line 353) | func ParseRev(ctx context.Context, repoPath string, revision string) (*C...

FILE: modules/git/error.go
  type ErrNotExist (line 10) | type ErrNotExist struct
    method Error (line 20) | func (err *ErrNotExist) Error() string {
  function IsErrNotExist (line 15) | func IsErrNotExist(err error) bool {
  function NewObjectNotFound (line 24) | func NewObjectNotFound(oid string) error {
  function NewBranchNotFound (line 28) | func NewBranchNotFound(branch string) error {
  function NewTagNotFound (line 36) | func NewTagNotFound(branch string) error {
  function NewRevisionNotFound (line 40) | func NewRevisionNotFound(branch string) error {
  type ErrUnexpectedType (line 44) | type ErrUnexpectedType struct
    method Error (line 48) | func (e *ErrUnexpectedType) Error() string {
  function IsErrUnexpectedType (line 52) | func IsErrUnexpectedType(err error) bool {
  function ErrorIsNotFound (line 67) | func ErrorIsNotFound(message string) bool {

FILE: modules/git/filemode.go
  type FileMode (line 18) | type FileMode
    method Bytes (line 122) | func (m FileMode) Bytes() []byte {
    method IsMalformed (line 131) | func (m FileMode) IsMalformed() bool {
    method String (line 145) | func (m FileMode) String() string {
    method IsRegular (line 153) | func (m FileMode) IsRegular() bool {
    method IsFile (line 160) | func (m FileMode) IsFile() bool {
    method ToOSFileMode (line 187) | func (m FileMode) ToOSFileMode() (os.FileMode, error) {
    method MarshalJSON (line 207) | func (m FileMode) MarshalJSON() ([]byte, error) {
    method UnmarshalJSON (line 211) | func (m *FileMode) UnmarshalJSON(b []byte) error {
  constant Empty (line 31) | Empty FileMode = 0
  constant Dir (line 33) | Dir FileMode = 0040000
  constant Regular (line 36) | Regular FileMode = 0100644
  constant Deprecated (line 43) | Deprecated FileMode = 0100664
  constant Executable (line 45) | Executable FileMode = 0100755
  constant Symlink (line 47) | Symlink FileMode = 0120000
  constant Submodule (line 50) | Submodule FileMode = 0160000
  function New (line 62) | func New(s string) (FileMode, error) {
  function NewFromOS (line 79) | func NewFromOS(m os.FileMode) (FileMode, error) {
  function isSetCharDevice (line 104) | func isSetCharDevice(m os.FileMode) bool {
  function isSetTemporary (line 108) | func isSetTemporary(m os.FileMode) bool {
  function isSetUserExecutable (line 112) | func isSetUserExecutable(m os.FileMode) bool {
  function isSetSymLink (line 116) | func isSetSymLink(m os.FileMode) bool {
  type ErrMalformedMode (line 167) | type ErrMalformedMode struct
    method Error (line 171) | func (e *ErrMalformedMode) Error() string {
  function IsErrMalformedMode (line 175) | func IsErrMalformedMode(err error) bool {

FILE: modules/git/gitobj/backend.go
  function NewFilesystemBackend (line 23) | func NewFilesystemBackend(root, tmp, alternates string, algo hash.Hash) ...
  function findAllBackends (line 46) | func findAllBackends(mainLoose *fileStorer, mainPacked *pack.Storage, ro...
  function addAlternateDirectory (line 75) | func addAlternateDirectory(s []storage.Storage, dir string, algo hash.Ha...
  function addAlternatesFromEnvironment (line 85) | func addAlternatesFromEnvironment(s []storage.Storage, env string, algo ...
  function splitAlternateString (line 120) | func splitAlternateString(env string, separator string) []string {
  function NewMemoryBackend (line 149) | func NewMemoryBackend(m map[string]io.ReadWriter) (storage.Backend, erro...
  type filesystemBackend (line 153) | type filesystemBackend struct
    method Storage (line 158) | func (b *filesystemBackend) Storage() (storage.Storage, storage.Writab...
  type memoryBackend (line 162) | type memoryBackend struct
    method Storage (line 166) | func (b *memoryBackend) Storage() (storage.Storage, storage.WritableSt...

FILE: modules/git/gitobj/backend_nix.go
  constant alternatesSeparator (line 5) | alternatesSeparator = ":"

FILE: modules/git/gitobj/backend_test.go
  function TestNewMemoryBackend (line 11) | func TestNewMemoryBackend(t *testing.T) {
  function TestNewMemoryBackendWithReadOnlyData (line 26) | func TestNewMemoryBackendWithReadOnlyData(t *testing.T) {
  function TestNewMemoryBackendWithWritableData (line 58) | func TestNewMemoryBackendWithWritableData(t *testing.T) {
  function TestSplitAlternatesString (line 90) | func TestSplitAlternatesString(t *testing.T) {

FILE: modules/git/gitobj/backend_windows.go
  constant alternatesSeparator (line 5) | alternatesSeparator = ";"

FILE: modules/git/gitobj/blob.go
  type Blob (line 12) | type Blob struct
    method Type (line 69) | func (b *Blob) Type() ObjectType { return BlobObjectType }
    method Decode (line 76) | func (b *Blob) Decode(hash hash.Hash, r io.Reader, size int64) (n int,...
    method Encode (line 94) | func (b *Blob) Encode(to io.Writer) (n int, err error) {
    method Close (line 102) | func (b *Blob) Close() error {
    method Equal (line 112) | func (b *Blob) Equal(other *Blob) bool {
  function NewBlobFromBytes (line 26) | func NewBlobFromBytes(contents []byte) *Blob {
  function NewBlobFromFile (line 42) | func NewBlobFromFile(path string) (*Blob, error) {

FILE: modules/git/gitobj/blob_test.go
  function TestBlobReturnsCorrectObjectType (line 13) | func TestBlobReturnsCorrectObjectType(t *testing.T) {
  function TestBlobFromString (line 19) | func TestBlobFromString(t *testing.T) {
  function TestBlobEncoding (line 38) | func TestBlobEncoding(t *testing.T) {
  function TestBlobDecoding (line 55) | func TestBlobDecoding(t *testing.T) {
  function TestBlobCallCloseFn (line 82) | func TestBlobCallCloseFn(t *testing.T) {
  function TestBlobCanCloseWithoutCloseFn (line 104) | func TestBlobCanCloseWithoutCloseFn(t *testing.T) {
  function TestBlobEqualReturnsTrueWithUnchangedContents (line 114) | func TestBlobEqualReturnsTrueWithUnchangedContents(t *testing.T) {
  function TestBlobEqualReturnsFalseWithChangedContents (line 125) | func TestBlobEqualReturnsFalseWithChangedContents(t *testing.T) {
  function TestBlobEqualReturnsTrueWhenOneBlobIsNil (line 137) | func TestBlobEqualReturnsTrueWhenOneBlobIsNil(t *testing.T) {
  function TestBlobEqualReturnsTrueWhenBothBlobsAreNil (line 149) | func TestBlobEqualReturnsTrueWhenBothBlobsAreNil(t *testing.T) {

FILE: modules/git/gitobj/commit.go
  type Signature (line 20) | type Signature struct
    method String (line 38) | func (s *Signature) String() string {
  constant formatTimeZoneOnly (line 31) | formatTimeZoneOnly = "-0700"
  type ExtraHeader (line 49) | type ExtraHeader struct
  type Commit (line 59) | type Commit struct
    method Type (line 87) | func (c *Commit) Type() ObjectType { return CommitObjectType }
    method Decode (line 95) | func (c *Commit) Decode(hash hash.Hash, from io.Reader, size int64) (n...
    method Encode (line 179) | func (c *Commit) Encode(to io.Writer) (n int, err error) {
    method Equal (line 226) | func (c *Commit) Equal(other *Commit) bool {
    method Subject (line 264) | func (c *Commit) Subject() string {

FILE: modules/git/gitobj/commit_test.go
  function TestCommitReturnsCorrectObjectType (line 15) | func TestCommitReturnsCorrectObjectType(t *testing.T) {
  function TestCommitEncoding (line 21) | func TestCommitEncoding(t *testing.T) {
  function TestCommitDecoding (line 65) | func TestCommitDecoding(t *testing.T) {
  function TestCommitDecodingWithEmptyName (line 123) | func TestCommitDecodingWithEmptyName(t *testing.T) {
  function TestCommitDecodingWithLargeCommitMessage (line 159) | func TestCommitDecodingWithLargeCommitMessage(t *testing.T) {
  function TestCommitDecodingWithMessageKeywordPrefix (line 200) | func TestCommitDecodingWithMessageKeywordPrefix(t *testing.T) {
  function TestCommitDecodingWithWhitespace (line 239) | func TestCommitDecodingWithWhitespace(t *testing.T) {
  function TestCommitDecodingMultilineHeader (line 278) | func TestCommitDecodingMultilineHeader(t *testing.T) {
  function equalStringSlices (line 325) | func equalStringSlices(a, b []string) bool {
  function TestCommitDecodingBadMessageWithLineStartingWithTree (line 337) | func TestCommitDecodingBadMessageWithLineStartingWithTree(t *testing.T) {
  function equalExtraHeaders (line 405) | func equalExtraHeaders(a, b []*ExtraHeader) bool {
  function TestCommitDecodingMessageWithLineStartingWithTree (line 417) | func TestCommitDecodingMessageWithLineStartingWithTree(t *testing.T) {
  function assertLine (line 487) | func assertLine(t *testing.T, buf *bytes.Buffer, wanted string, args ......
  function TestCommitEqualReturnsTrueWithIdenticalCommits (line 501) | func TestCommitEqualReturnsTrueWithIdenticalCommits(t *testing.T) {
  function TestCommitEqualReturnsFalseWithDifferentParentCounts (line 528) | func TestCommitEqualReturnsFalseWithDifferentParentCounts(t *testing.T) {
  function TestCommitEqualReturnsFalseWithDifferentParentsIds (line 541) | func TestCommitEqualReturnsFalseWithDifferentParentsIds(t *testing.T) {
  function TestCommitEqualReturnsFalseWithDifferentHeaderCounts (line 556) | func TestCommitEqualReturnsFalseWithDifferentHeaderCounts(t *testing.T) {
  function TestCommitEqualReturnsFalseWithDifferentHeaders (line 574) | func TestCommitEqualReturnsFalseWithDifferentHeaders(t *testing.T) {
  function TestCommitEqualReturnsFalseWithDifferentAuthors (line 591) | func TestCommitEqualReturnsFalseWithDifferentAuthors(t *testing.T) {
  function TestCommitEqualReturnsFalseWithDifferentCommitters (line 604) | func TestCommitEqualReturnsFalseWithDifferentCommitters(t *testing.T) {
  function TestCommitEqualReturnsFalseWithDifferentMessages (line 617) | func TestCommitEqualReturnsFalseWithDifferentMessages(t *testing.T) {
  function TestCommitEqualReturnsFalseWithDifferentTreeIDs (line 630) | func TestCommitEqualReturnsFalseWithDifferentTreeIDs(t *testing.T) {
  function TestCommitEqualReturnsFalseWhenOneCommitIsNil (line 645) | func TestCommitEqualReturnsFalseWhenOneCommitIsNil(t *testing.T) {
  function TestCommitEqualReturnsTrueWhenBothCommitsAreNil (line 663) | func TestCommitEqualReturnsTrueWhenBothCommitsAreNil(t *testing.T) {
  function TestBadCommit (line 672) | func TestBadCommit(t *testing.T) {
  function TestBad2Commit (line 689) | func TestBad2Commit(t *testing.T) {
  function TestCommitDecodeWithLeadingWhitespaceWithoutPreviousHeader (line 710) | func TestCommitDecodeWithLeadingWhitespaceWithoutPreviousHeader(t *testi...
  function TestCommitDecodePanicOnContinuationWithoutPreviousHeader (line 731) | func TestCommitDecodePanicOnContinuationWithoutPreviousHeader(t *testing...
  function TestSplitBehavior (line 750) | func TestSplitBehavior(t *testing.T) {
  function TestCommitDecodePanicOnEmptyFields (line 779) | func TestCommitDecodePanicOnEmptyFields(t *testing.T) {
  function TestCommitDecodePanicWithMalformedInput (line 817) | func TestCommitDecodePanicWithMalformedInput(t *testing.T) {
  function TestCommitDecodeWithEmptyAuthor (line 881) | func TestCommitDecodeWithEmptyAuthor(t *testing.T) {
  function TestCommitDecodeWithEmptyCommitter (line 901) | func TestCommitDecodeWithEmptyCommitter(t *testing.T) {
  function TestCommitDecodeWithMultipleParents (line 921) | func TestCommitDecodeWithMultipleParents(t *testing.T) {
  function TestCommitDecodeWithSpecialCharacters (line 950) | func TestCommitDecodeWithSpecialCharacters(t *testing.T) {
  function TestCommitDecodeWithExtraHeaderBeforeStandard (line 984) | func TestCommitDecodeWithExtraHeaderBeforeStandard(t *testing.T) {
  function TestCommitDecodeMultilineExtraHeaders (line 1009) | func TestCommitDecodeMultilineExtraHeaders(t *testing.T) {
  function TestCommitDecodeMultipleExtraHeaders (line 1056) | func TestCommitDecodeMultipleExtraHeaders(t *testing.T) {
  function TestCommitDecodeWithStringsCut (line 1122) | func TestCommitDecodeWithStringsCut(t *testing.T) {

FILE: modules/git/gitobj/errors.go
  type UnexpectedObjectType (line 8) | type UnexpectedObjectType struct
    method Error (line 16) | func (e *UnexpectedObjectType) Error() string {

FILE: modules/git/gitobj/errors/errors.go
  type noSuchObject (line 10) | type noSuchObject struct
    method Error (line 15) | func (e *noSuchObject) Error() string {
  function NoSuchObject (line 21) | func NoSuchObject(oid []byte) error {
  function IsNoSuchObject (line 26) | func IsNoSuchObject(err error) bool {

FILE: modules/git/gitobj/errors/errors_test.go
  function TestNoSuchObjectTypeErrFormatting (line 8) | func TestNoSuchObjectTypeErrFormatting(t *testing.T) {
  function TestIsNoSuchObjectNilHandling (line 25) | func TestIsNoSuchObjectNilHandling(t *testing.T) {

FILE: modules/git/gitobj/errors_test.go
  function TestUnexpectedObjectTypeErrFormatting (line 7) | func TestUnexpectedObjectTypeErrFormatting(t *testing.T) {

FILE: modules/git/gitobj/file_storer.go
  type fileStorer (line 16) | type fileStorer struct
    method Open (line 38) | func (fs *fileStorer) Open(sha []byte) (f io.ReadCloser, err error) {
    method Store (line 51) | func (fs *fileStorer) Store(sha []byte, r io.Reader) (n int64, err err...
    method Root (line 107) | func (fs *fileStorer) Root() string {
    method Close (line 112) | func (fs *fileStorer) Close() error {
    method IsCompressed (line 117) | func (fs *fileStorer) IsCompressed() bool {
    method open (line 122) | func (fs *fileStorer) open(path string, flag int) (*os.File, error) {
    method path (line 127) | func (fs *fileStorer) path(sha []byte) string {
  function newFileStorer (line 25) | func newFileStorer(root, tmp string) *fileStorer {

FILE: modules/git/gitobj/memory_storer.go
  type memoryStorer (line 14) | type memoryStorer struct
    method Store (line 42) | func (ms *memoryStorer) Store(sha []byte, r io.Reader) (n int64, err e...
    method Open (line 55) | func (ms *memoryStorer) Open(sha []byte) (f io.ReadCloser, err error) {
    method Close (line 67) | func (ms *memoryStorer) Close() error {
    method IsCompressed (line 72) | func (ms *memoryStorer) IsCompressed() bool {
  function newMemoryStorer (line 27) | func newMemoryStorer(m map[string]io.ReadWriter) *memoryStorer {
  type bufCloser (line 79) | type bufCloser struct
    method Close (line 84) | func (b *bufCloser) Close() error { return nil }

FILE: modules/git/gitobj/memory_storer_test.go
  function TestMemoryStorerIncludesGivenEntries (line 13) | func TestMemoryStorerIncludesGivenEntries(t *testing.T) {
  function TestMemoryStorerAcceptsNilEntries (line 39) | func TestMemoryStorerAcceptsNilEntries(t *testing.T) {
  function TestMemoryStorerDoesntOpenMissingEntries (line 50) | func TestMemoryStorerDoesntOpenMissingEntries(t *testing.T) {
  function TestMemoryStorerStoresNewEntries (line 69) | func TestMemoryStorerStoresNewEntries(t *testing.T) {
  function TestMemoryStorerStoresExistingEntries (line 103) | func TestMemoryStorerStoresExistingEntries(t *testing.T) {

FILE: modules/git/gitobj/object.go
  type Object (line 10) | type Object interface

FILE: modules/git/gitobj/object_db.go
  type Database (line 19) | type Database struct
    method Close (line 116) | func (d *Database) Close() error {
    method Object (line 135) | func (d *Database) Object(sha []byte) (Object, error) {
    method Blob (line 164) | func (d *Database) Blob(sha []byte) (*Blob, error) {
    method Tree (line 175) | func (d *Database) Tree(sha []byte) (*Tree, error) {
    method Commit (line 185) | func (o *Database) Commit(sha []byte) (*Commit, error) {
    method Tag (line 196) | func (d *Database) Tag(sha []byte) (*Tag, error) {
    method WriteBlob (line 207) | func (d *Database) WriteBlob(b *Blob) ([]byte, error) {
    method WriteTree (line 240) | func (o *Database) WriteTree(t *Tree) ([]byte, error) {
    method WriteCommit (line 250) | func (o *Database) WriteCommit(c *Commit) ([]byte, error) {
    method WriteTag (line 260) | func (o *Database) WriteTag(t *Tag) ([]byte, error) {
    method Root (line 273) | func (o *Database) Root() (string, bool) {
    method Hasher (line 285) | func (o *Database) Hasher() hash.Hash {
    method encode (line 291) | func (d *Database) encode(object Object) (sha []byte, n int64, err err...
    method encodeBuffer (line 297) | func (d *Database) encodeBuffer(object Object, buf io.ReadWriter) (sha...
    method save (line 336) | func (o *Database) save(sha []byte, buf io.Reader) ([]byte, int64, err...
    method open (line 344) | func (o *Database) open(sha []byte) (*ObjectReader, error) {
    method openDecode (line 361) | func (o *Database) openDecode(sha []byte, into Object) error {
    method decode (line 377) | func (o *Database) decode(r *ObjectReader, into Object) error {
    method cleanup (line 395) | func (o *Database) cleanup(f *os.File) {
  type options (line 40) | type options struct
  type Option (line 45) | type Option
  type ObjectFormatAlgorithm (line 47) | type ObjectFormatAlgorithm
  constant ObjectFormatSHA1 (line 50) | ObjectFormatSHA1   = ObjectFormatAlgorithm("sha1")
  constant ObjectFormatSHA256 (line 51) | ObjectFormatSHA256 = ObjectFormatAlgorithm("sha256")
  function Alternates (line 57) | func Alternates(alternates string) Option {
  function ObjectFormat (line 65) | func ObjectFormat(algo ObjectFormatAlgorithm) Option {
  function NewDatabase (line 75) | func NewDatabase(root, tmp string, setters ...Option) (*Database, error) {
  function FromBackend (line 95) | func FromBackend(b storage.Backend, setters ...Option) (*Database, error) {
  function hasher (line 400) | func hasher(algo ObjectFormatAlgorithm) hash.Hash {

FILE: modules/git/gitobj/object_db_test.go
  constant roundTripCommitSha (line 15) | roundTripCommitSha string = `561ed224a6bd39232d902ad8023c0ebe44fbf6c5`
  constant roundTripCommit (line 16) | roundTripCommit string = `tree f2ebdf9c967f69d57b370901f9344596ec47e51c
  function TestDecodeObject (line 53) | func TestDecodeObject(t *testing.T) {
  function TestDecodeBlob (line 108) | func TestDecodeBlob(t *testing.T) {
  function TestDecodeTree (line 162) | func TestDecodeTree(t *testing.T) {
  function TestDecodeCommit (line 235) | func TestDecodeCommit(t *testing.T) {
  function TestWriteBlob (line 307) | func TestWriteBlob(t *testing.T) {
  function TestWriteTree (line 351) | func TestWriteTree(t *testing.T) {
  function TestWriteCommit (line 408) | func TestWriteCommit(t *testing.T) {
  function TestWriteCommitWithGPGSignature (line 468) | func TestWriteCommitWithGPGSignature(t *testing.T) {
  function TestDecodeTag (line 503) | func TestDecodeTag(t *testing.T) {
  function TestWriteTag (line 554) | func TestWriteTag(t *testing.T) {
  function TestReadingAMissingObjectAfterClose (line 607) | func TestReadingAMissingObjectAfterClose(t *testing.T) {
  function TestClosingAnDatabaseMoreThanOnce (line 635) | func TestClosingAnDatabaseMoreThanOnce(t *testing.T) {
  function TestDatabaseRootWithRoot (line 649) | func TestDatabaseRootWithRoot(t *testing.T) {
  function TestDatabaseRootWithoutRoot (line 664) | func TestDatabaseRootWithoutRoot(t *testing.T) {

FILE: modules/git/gitobj/object_reader.go
  type ObjectReader (line 15) | type ObjectReader struct
    method Header (line 97) | func (r *ObjectReader) Header() (typ ObjectType, size int64, err error) {
    method Read (line 139) | func (r *ObjectReader) Read(p []byte) (n int, err error) {
    method Close (line 150) | func (r *ObjectReader) Close() error {
  function NewObjectReader (line 42) | func NewObjectReader(r io.Reader) (*ObjectReader, error) {
  function NewUncompressedObjectReader (line 49) | func NewUncompressedObjectReader(r io.Reader) (*ObjectReader, error) {
  function NewObjectReadCloser (line 59) | func NewObjectReadCloser(r io.ReadCloser) (*ObjectReader, error) {
  function NewUncompressedObjectReadCloser (line 85) | func NewUncompressedObjectReadCloser(r io.ReadCloser) (*ObjectReader, er...

FILE: modules/git/gitobj/object_reader_test.go
  function TestObjectReaderReadsHeaders (line 12) | func TestObjectReaderReadsHeaders(t *testing.T) {
  function TestObjectReaderConsumesHeaderBeforeReads (line 37) | func TestObjectReaderConsumesHeaderBeforeReads(t *testing.T) {
  type ReadCloserFn (line 63) | type ReadCloserFn struct
    method Close (line 68) | func (r *ReadCloserFn) Close() error {
  function TestObjectReaderCallsClose (line 72) | func TestObjectReaderCallsClose(t *testing.T) {

FILE: modules/git/gitobj/object_type.go
  type ObjectType (line 7) | type ObjectType
    method String (line 36) | func (t ObjectType) String() string {
  constant UnknownObjectType (line 10) | UnknownObjectType ObjectType = iota
  constant BlobObjectType (line 11) | BlobObjectType
  constant TreeObjectType (line 12) | TreeObjectType
  constant CommitObjectType (line 13) | CommitObjectType
  constant TagObjectType (line 14) | TagObjectType
  function ObjectTypeFromString (line 19) | func ObjectTypeFromString(s string) ObjectType {

FILE: modules/git/gitobj/object_type_test.go
  function TestObjectTypeFromString (line 8) | func TestObjectTypeFromString(t *testing.T) {
  function TestObjectTypeToString (line 24) | func TestObjectTypeToString(t *testing.T) {

FILE: modules/git/gitobj/object_writer.go
  type ObjectWriter (line 15) | type ObjectWriter struct
    method WriteHeader (line 88) | func (w *ObjectWriter) WriteHeader(typ ObjectType, length int64) (n in...
    method Write (line 101) | func (w *ObjectWriter) Write(p []byte) (n int, err error) {
    method Sha (line 109) | func (w *ObjectWriter) Sha() []byte {
    method Close (line 119) | func (w *ObjectWriter) Close() error {
  type nopCloser (line 41) | type nopCloser struct
    method Close (line 48) | func (n *nopCloser) Close() error {
  function NewObjectWriter (line 55) | func NewObjectWriter(w io.Writer, hash hash.Hash) *ObjectWriter {
  function NewObjectWriteCloser (line 64) | func NewObjectWriteCloser(w io.WriteCloser, sum hash.Hash) *ObjectWriter {

FILE: modules/git/gitobj/object_writer_test.go
  function TestObjectWriterWritesHeaders (line 16) | func TestObjectWriterWritesHeaders(t *testing.T) {
  function TestObjectWriterWritesData (line 51) | func TestObjectWriterWritesData(t *testing.T) {
  function TestObjectWriterKeepsTrackOfHash (line 104) | func TestObjectWriterKeepsTrackOfHash(t *testing.T) {
  type WriteCloserFn (line 134) | type WriteCloserFn struct
    method Close (line 139) | func (r *WriteCloserFn) Close() error { return r.closeFn() }
  function TestObjectWriterCallsClose (line 141) | func TestObjectWriterCallsClose(t *testing.T) {

FILE: modules/git/gitobj/pack/bounds.go
  type bounds (line 13) | type bounds struct
    method Left (line 30) | func (b *bounds) Left() int64 {
    method Right (line 35) | func (b *bounds) Right() int64 {
    method WithLeft (line 41) | func (b *bounds) WithLeft(v int64) *bounds {
    method WithRight (line 50) | func (b *bounds) WithRight(v int64) *bounds {
    method Equal (line 67) | func (b *bounds) Equal(other *bounds) bool {
    method String (line 83) | func (b *bounds) String() string {
  function newBounds (line 22) | func newBounds(left, right int64) *bounds {

FILE: modules/git/gitobj/pack/bounds_test.go
  function TestBoundsLeft (line 7) | func TestBoundsLeft(t *testing.T) {
  function TestBoundsRight (line 13) | func TestBoundsRight(t *testing.T) {
  function TestBoundsWithLeftReturnsNewBounds (line 19) | func TestBoundsWithLeftReturnsNewBounds(t *testing.T) {
  function TestBoundsWithRightReturnsNewBounds (line 38) | func TestBoundsWithRightReturnsNewBounds(t *testing.T) {
  function TestBoundsEqualWithIdenticalBounds (line 57) | func TestBoundsEqualWithIdenticalBounds(t *testing.T) {
  function TestBoundsEqualWithDifferentBounds (line 66) | func TestBoundsEqualWithDifferentBounds(t *testing.T) {
  function TestBoundsEqualWithNilReceiver (line 75) | func TestBoundsEqualWithNilReceiver(t *testing.T) {
  function TestBoundsEqualWithNilArgument (line 84) | func TestBoundsEqualWithNilArgument(t *testing.T) {
  function TestBoundsEqualWithNilArgumentAndReceiver (line 93) | func TestBoundsEqualWithNilArgumentAndReceiver(t *testing.T) {
  function TestBoundsString (line 102) | func TestBoundsString(t *testing.T) {

FILE: modules/git/gitobj/pack/chain.go
  type Chain (line 5) | type Chain interface

FILE: modules/git/gitobj/pack/chain_base.go
  type ChainBase (line 9) | type ChainBase struct
    method Unpack (line 27) | func (b *ChainBase) Unpack() ([]byte, error) {
    method Type (line 47) | func (b *ChainBase) Type() PackedObjectType {

FILE: modules/git/gitobj/pack/chain_base_test.go
  function TestChainBaseDecompressesData (line 9) | func TestChainBaseDecompressesData(t *testing.T) {
  function TestChainBaseTypeReturnsType (line 50) | func TestChainBaseTypeReturnsType(t *testing.T) {
  function compress (line 60) | func compress(base string) ([]byte, error) {

FILE: modules/git/gitobj/pack/chain_delta.go
  type ChainDelta (line 9) | type ChainDelta struct
    method Unpack (line 24) | func (d *ChainDelta) Unpack() ([]byte, error) {
    method Type (line 34) | func (d *ChainDelta) Type() PackedObjectType {
  function patch (line 45) | func patch(base, delta []byte) ([]byte, error) {
  function patchDeltaHeader (line 159) | func patchDeltaHeader(delta []byte, pos int) (size int64, end int) {

FILE: modules/git/gitobj/pack/chain_delta_test.go
  function TestChainDeltaUnpackCopiesFromBase (line 8) | func TestChainDeltaUnpackCopiesFromBase(t *testing.T) {
  function TestChainDeltaUnpackAddsToBase (line 33) | func TestChainDeltaUnpackAddsToBase(t *testing.T) {
  function TestChainDeltaWithMultipleInstructions (line 58) | func TestChainDeltaWithMultipleInstructions(t *testing.T) {
  function TestChainDeltaWithInvalidDeltaInstruction (line 90) | func TestChainDeltaWithInvalidDeltaInstruction(t *testing.T) {
  function TestChainDeltaWithExtraInstructions (line 112) | func TestChainDeltaWithExtraInstructions(t *testing.T) {

FILE: modules/git/gitobj/pack/chain_test.go
  type ChainSimple (line 3) | type ChainSimple struct
    method Unpack (line 8) | func (c *ChainSimple) Unpack() ([]byte, error) {
    method Type (line 12) | func (c *ChainSimple) Type() PackedObjectType { return TypeNone }

FILE: modules/git/gitobj/pack/delayed_object.go
  type delayedObjectReader (line 13) | type delayedObjectReader struct
    method makeReader (line 19) | func (d *delayedObjectReader) makeReader() (err error) {
    method Read (line 60) | func (d *delayedObjectReader) Read(b []byte) (int, error) {
    method Close (line 70) | func (d *delayedObjectReader) Close() error {

FILE: modules/git/gitobj/pack/errors.go
  type UnsupportedVersionErr (line 7) | type UnsupportedVersionErr struct
    method Error (line 13) | func (u *UnsupportedVersionErr) Error() string {

FILE: modules/git/gitobj/pack/errors_test.go
  function TestUnsupportedVersionErr (line 7) | func TestUnsupportedVersionErr(t *testing.T) {

FILE: modules/git/gitobj/pack/index.go
  constant MaxHashSize (line 10) | MaxHashSize = sha256.Size
  type Index (line 14) | type Index struct
    method Count (line 32) | func (i *Index) Count() int {
    method Close (line 38) | func (i *Index) Close() error {
    method Entry (line 67) | func (i *Index) Entry(name []byte) (*IndexEntry, error) {
    method readAt (line 115) | func (i *Index) readAt(p []byte, at int64) (n int, err error) {
    method bounds (line 121) | func (i *Index) bounds(name []byte) *bounds {
  function IsNotFound (line 53) | func IsNotFound(err error) bool {

FILE: modules/git/gitobj/pack/index_decode.go
  constant indexMagicWidth (line 14) | indexMagicWidth = 4
  constant indexVersionWidth (line 17) | indexVersionWidth = 4
  constant indexV2Width (line 19) | indexV2Width = indexMagicWidth + indexVersionWidth
  constant indexV1Width (line 21) | indexV1Width = 0
  constant indexFanoutEntries (line 24) | indexFanoutEntries = 256
  constant indexFanoutEntryWidth (line 26) | indexFanoutEntryWidth = 4
  constant indexFanoutWidth (line 28) | indexFanoutWidth = indexFanoutEntries * indexFanoutEntryWidth
  constant indexOffsetV1Start (line 32) | indexOffsetV1Start = indexV1Width + indexFanoutWidth
  constant indexOffsetV2Start (line 35) | indexOffsetV2Start = indexV2Width + indexFanoutWidth
  constant indexObjectCRCWidth (line 39) | indexObjectCRCWidth = 4
  constant indexObjectSmallOffsetWidth (line 42) | indexObjectSmallOffsetWidth = 4
  constant indexObjectLargeOffsetWidth (line 45) | indexObjectLargeOffsetWidth = 8
  function DecodeIndex (line 64) | func DecodeIndex(r io.ReaderAt, hash hash.Hash) (*Index, error) {
  function decodeIndexHeader (line 84) | func decodeIndexHeader(r io.ReaderAt, hash hash.Hash) (IndexVersion, err...
  function decodeIndexFanout (line 110) | func decodeIndexFanout(r io.ReaderAt, offset int64) ([]uint32, error) {

FILE: modules/git/gitobj/pack/index_decode_test.go
  function TestDecodeIndexV2 (line 12) | func TestDecodeIndexV2(t *testing.T) {
  function TestDecodeIndexV2InvalidFanout (line 34) | func TestDecodeIndexV2InvalidFanout(t *testing.T) {
  function TestDecodeIndexV1 (line 50) | func TestDecodeIndexV1(t *testing.T) {
  function TestDecodeIndexV1InvalidFanout (line 61) | func TestDecodeIndexV1InvalidFanout(t *testing.T) {
  function TestDecodeIndexUnsupportedVersion (line 72) | func TestDecodeIndexUnsupportedVersion(t *testing.T) {
  function TestDecodeIndexEmptyContents (line 90) | func TestDecodeIndexEmptyContents(t *testing.T) {

FILE: modules/git/gitobj/pack/index_entry.go
  type IndexEntry (line 4) | type IndexEntry struct

FILE: modules/git/gitobj/pack/index_test.go
  function TestIndexEntrySearch (line 15) | func TestIndexEntrySearch(t *testing.T) {
  function TestIndexEntrySearchClampLeft (line 29) | func TestIndexEntrySearchClampLeft(t *testing.T) {
  function TestIndexEntrySearchClampRight (line 43) | func TestIndexEntrySearchClampRight(t *testing.T) {
  function TestIndexSearchOutOfBounds (line 57) | func TestIndexSearchOutOfBounds(t *testing.T) {
  function TestIndexEntryNotFound (line 72) | func TestIndexEntryNotFound(t *testing.T) {
  function TestIndexCount (line 87) | func TestIndexCount(t *testing.T) {
  function TestIndexIsNotFound (line 100) | func TestIndexIsNotFound(t *testing.T) {
  function TestIndexIsNotFoundForOtherErrors (line 107) | func TestIndexIsNotFoundForOtherErrors(t *testing.T) {
  function init (line 116) | func init() {

FILE: modules/git/gitobj/pack/index_v1.go
  type V1 (line 9) | type V1 struct
    method Name (line 15) | func (v *V1) Name(idx *Index, at int64) ([]byte, error) {
    method Entry (line 29) | func (v *V1) Entry(idx *Index, at int64) (*IndexEntry, error) {
    method Width (line 42) | func (v *V1) Width() int64 {
  function v1ShaOffset (line 47) | func v1ShaOffset(at int64, hashlen int64) int64 {
  function v1EntryOffset (line 57) | func v1EntryOffset(at int64, hashlen int64) int64 {

FILE: modules/git/gitobj/pack/index_v1_test.go
  function TestIndexV1SearchExact (line 16) | func TestIndexV1SearchExact(t *testing.T) {
  function TestIndexVersionWidthV1 (line 31) | func TestIndexVersionWidthV1(t *testing.T) {
  function newV1Index (line 40) | func newV1Index(hash hash.Hash) *Index {

FILE: modules/git/gitobj/pack/index_v2.go
  type V2 (line 9) | type V2 struct
    method Name (line 15) | func (v *V2) Name(idx *Index, at int64) ([]byte, error) {
    method Entry (line 29) | func (v *V2) Entry(idx *Index, at int64) (*IndexEntry, error) {
    method Width (line 59) | func (v *V2) Width() int64 {
  function v2ShaOffset (line 64) | func v2ShaOffset(at int64, hashlen int64) int64 {
  function v2SmallOffsetOffset (line 73) | func v2SmallOffsetOffset(at, total, hashlen int64) int64 {
  function v2LargeOffsetOffset (line 86) | func v2LargeOffsetOffset(at, total, hashlen int64) int64 {

FILE: modules/git/gitobj/pack/index_v2_test.go
  function TestIndexV2EntryExact (line 35) | func TestIndexV2EntryExact(t *testing.T) {
  function TestIndexV2EntryExtendedOffset (line 50) | func TestIndexV2EntryExtendedOffset(t *testing.T) {
  function TestIndexVersionWidthV2 (line 65) | func TestIndexVersionWidthV2(t *testing.T) {
  function newV2Index (line 74) | func newV2Index(hash hash.Hash) *Index {

FILE: modules/git/gitobj/pack/index_version.go
  type IndexVersion (line 3) | type IndexVersion interface

FILE: modules/git/gitobj/pack/io.go
  type OffsetReaderAt (line 7) | type OffsetReaderAt struct
    method Read (line 22) | func (r *OffsetReaderAt) Read(p []byte) (n int, err error) {

FILE: modules/git/gitobj/pack/io_test.go
  function TestOffsetReaderAtReadsAtOffset (line 9) | func TestOffsetReaderAtReadsAtOffset(t *testing.T) {
  function TestOffsetReaderPropogatesErrors (line 43) | func TestOffsetReaderPropogatesErrors(t *testing.T) {
  type ErrReaderAt (line 60) | type ErrReaderAt struct
    method ReadAt (line 64) | func (e *ErrReaderAt) ReadAt(p []byte, at int64) (n int, err error) {

FILE: modules/git/gitobj/pack/object.go
  type Object (line 5) | type Object struct
    method Unpack (line 19) | func (o *Object) Unpack() ([]byte, error) {
    method Type (line 25) | func (o *Object) Type() PackedObjectType {

FILE: modules/git/gitobj/pack/object_test.go
  function TestObjectTypeReturnsObjectType (line 9) | func TestObjectTypeReturnsObjectType(t *testing.T) {
  function TestObjectUnpackUnpacksData (line 19) | func TestObjectUnpackUnpacksData(t *testing.T) {
  function TestObjectUnpackPropogatesErrors (line 38) | func TestObjectUnpackPropogatesErrors(t *testing.T) {

FILE: modules/git/gitobj/pack/packfile.go
  type Packfile (line 12) | type Packfile struct
    method Close (line 30) | func (p *Packfile) Close() error {
    method Object (line 54) | func (p *Packfile) Object(name []byte) (*Object, error) {
    method find (line 86) | func (p *Packfile) find(offset int64) (Chain, error) {
    method findBase (line 184) | func (p *Packfile) findBase(typ PackedObjectType, offset, objOffset in...

FILE: modules/git/gitobj/pack/packfile_decode.go
  function DecodePackfile (line 26) | func DecodePackfile(r io.ReaderAt, hash hash.Hash) (*Packfile, error) {

FILE: modules/git/gitobj/pack/packfile_decode_test.go
  function TestDecodePackfileDecodesIntegerVersion (line 11) | func TestDecodePackfileDecodesIntegerVersion(t *testing.T) {
  function TestDecodePackfileDecodesIntegerCount (line 26) | func TestDecodePackfileDecodesIntegerCount(t *testing.T) {
  function TestDecodePackfileReportsBadHeaders (line 41) | func TestDecodePackfileReportsBadHeaders(t *testing.T) {

FILE: modules/git/gitobj/pack/packfile_test.go
  function TestPackObjectReturnsObjectWithSingleBaseAtLowOffset (line 15) | func TestPackObjectReturnsObjectWithSingleBaseAtLowOffset(t *testing.T) {
  function TestPackObjectReturnsObjectWithSingleBaseAtHighOffset (line 53) | func TestPackObjectReturnsObjectWithSingleBaseAtHighOffset(t *testing.T) {
  function TestPackObjectReturnsObjectWithDeltaBaseOffset (line 95) | func TestPackObjectReturnsObjectWithDeltaBaseOffset(t *testing.T) {
  function TestPackfileObjectReturnsObjectWithDeltaBaseReference (line 149) | func TestPackfileObjectReturnsObjectWithDeltaBaseReference(t *testing.T) {
  function TestPackfileClosesReadClosers (line 210) | func TestPackfileClosesReadClosers(t *testing.T) {
  function TestPackfileClosePropogatesCloseErrors (line 224) | func TestPackfileClosePropogatesCloseErrors(t *testing.T) {
  type ReaderAtCloser (line 235) | type ReaderAtCloser struct
    method ReadAt (line 240) | func (r *ReaderAtCloser) ReadAt(p []byte, at int64) (int, error) {
    method Close (line 244) | func (r *ReaderAtCloser) Close() error {
  function IndexWith (line 249) | func IndexWith(offsets map[string]uint32) *Index {
  function DecodeHex (line 309) | func DecodeHex(t *testing.T, str string) []byte {

FILE: modules/git/gitobj/pack/set.go
  type Set (line 15) | type Set struct
    method Close (line 157) | func (s *Set) Close() error {
    method Object (line 178) | func (s *Set) Object(name []byte) (*Object, error) {
    method each (line 197) | func (s *Set) each(name []byte, fn iterFn) (*Object, error) {
  function NewSet (line 41) | func NewSet(db string, algo hash.Hash) (*Set, error) {
  function escapeGlobPattern (line 106) | func escapeGlobPattern(s string) string {
  function NewSetPacks (line 114) | func NewSetPacks(packs ...*Packfile) *Set {
  type iterFn (line 185) | type iterFn

FILE: modules/git/gitobj/pack/set_test.go
  function TestSetOpenOpensAPackedObject (line 8) | func TestSetOpenOpensAPackedObject(t *testing.T) {
  function TestSetOpenOpensPackedObjectsInPackOrder (line 38) | func TestSetOpenOpensPackedObjectsInPackOrder(t *testing.T) {

FILE: modules/git/gitobj/pack/storage.go
  type Storage (line 9) | type Storage struct
    method Open (line 23) | func (f *Storage) Open(oid []byte) (r io.ReadCloser, err error) {
    method Close (line 32) | func (f *Storage) Close() error {
    method IsCompressed (line 37) | func (f *Storage) IsCompressed() bool {
  function NewStorage (line 14) | func NewStorage(root string, algo hash.Hash) (*Storage, error) {

FILE: modules/git/gitobj/pack/type.go
  type PackedObjectType (line 9) | type PackedObjectType
    method String (line 34) | func (t PackedObjectType) String() string {
  constant TypeNone (line 14) | TypeNone PackedObjectType = iota
  constant TypeCommit (line 16) | TypeCommit
  constant TypeTree (line 18) | TypeTree
  constant TypeBlob (line 20) | TypeBlob
  constant TypeTag (line 22) | TypeTag
  constant TypeObjectOffsetDelta (line 25) | TypeObjectOffsetDelta PackedObjectType = 6
  constant TypeObjectReferenceDelta (line 27) | TypeObjectReferenceDelta PackedObjectType = 7

FILE: modules/git/gitobj/pack/type_test.go
  type PackedObjectStringTestCase (line 8) | type PackedObjectStringTestCase struct
    method Assert (line 15) | func (c *PackedObjectStringTestCase) Assert(t *testing.T) {
  function TestPackedObjectTypeString (line 35) | func TestPackedObjectTypeString(t *testing.T) {

FILE: modules/git/gitobj/storage/backend.go
  type Backend (line 5) | type Backend interface

FILE: modules/git/gitobj/storage/decompressing_readcloser.go
  type decompressingReadCloser (line 10) | type decompressingReadCloser struct
    method Read (line 25) | func (d *decompressingReadCloser) Read(b []byte) (int, error) {
    method Close (line 30) | func (d *decompressingReadCloser) Close() error {
  function newDecompressingReadCloser (line 16) | func newDecompressingReadCloser(r io.ReadCloser) (io.ReadCloser, error) {

FILE: modules/git/gitobj/storage/multi_storage.go
  type multiStorage (line 12) | type multiStorage struct
    method Open (line 22) | func (m *multiStorage) Open(oid []byte) (f io.ReadCloser, err error) {
    method Close (line 41) | func (m *multiStorage) Close() error {
    method IsCompressed (line 53) | func (m *multiStorage) IsCompressed() bool {
  function MultiStorage (line 16) | func MultiStorage(args ...Storage) Storage {

FILE: modules/git/gitobj/storage/storage.go
  type Storage (line 7) | type Storage interface
  type WritableStorage (line 23) | type WritableStorage interface

FILE: modules/git/gitobj/storer.go
  type Storer (line 7) | type Storer interface

FILE: modules/git/gitobj/tag.go
  type Tag (line 13) | type Tag struct
    method Extract (line 24) | func (t *Tag) Extract() (message string, signature string) {
    method StrictMessage (line 31) | func (t *Tag) StrictMessage() string {
    method Decode (line 42) | func (t *Tag) Decode(hash hash.Hash, r io.Reader, size int64) (int, er...
    method Encode (line 103) | func (t *Tag) Encode(w io.Writer) (int, error) {
    method Equal (line 117) | func (t *Tag) Equal(other *Tag) bool {
    method Type (line 135) | func (t *Tag) Type() ObjectType {

FILE: modules/git/gitobj/tag_test.go
  function TestTagTypeReturnsCorrectObjectType (line 10) | func TestTagTypeReturnsCorrectObjectType(t *testing.T) {
  function TestTagEncode (line 16) | func TestTagEncode(t *testing.T) {
  function TestTagDecode (line 49) | func TestTagDecode(t *testing.T) {

FILE: modules/git/gitobj/tree.go
  constant sIFMT (line 20) | sIFMT      = int32(0170000)
  constant sIFREG (line 21) | sIFREG     = int32(0100000)
  constant sIFDIR (line 22) | sIFDIR     = int32(0040000)
  constant sIFLNK (line 23) | sIFLNK     = int32(0120000)
  constant sIFGITLINK (line 24) | sIFGITLINK = int32(0160000)
  type Tree (line 28) | type Tree struct
    method Type (line 35) | func (t *Tree) Type() ObjectType { return TreeObjectType }
    method Decode (line 43) | func (t *Tree) Decode(hash hash.Hash, from io.Reader, size int64) (n i...
    method Encode (line 90) | func (t *Tree) Encode(to io.Writer) (n int, err error) {
    method Merge (line 115) | func (t *Tree) Merge(others ...*TreeEntry) *Tree {
    method Equal (line 166) | func (t *Tree) Equal(other *Tree) bool {
  type TreeEntry (line 190) | type TreeEntry struct
    method Equal (line 202) | func (e *TreeEntry) Equal(other *TreeEntry) bool {
    method Type (line 217) | func (e *TreeEntry) Type() ObjectType {
    method IsLink (line 236) | func (e *TreeEntry) IsLink() bool {
  type SubtreeOrder (line 250) | type SubtreeOrder
    method Len (line 254) | func (s SubtreeOrder) Len() int { return len(s) }
    method Swap (line 257) | func (s SubtreeOrder) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
    method Less (line 265) | func (s SubtreeOrder) Less(i, j int) bool {
    method Name (line 275) | func (s SubtreeOrder) Name(i int) string {

FILE: modules/git/gitobj/tree_test.go
  function TestTreeReturnsCorrectObjectType (line 13) | func TestTreeReturnsCorrectObjectType(t *testing.T) {
  function TestTreeEncoding (line 19) | func TestTreeEncoding(t *testing.T) {
  function TestTreeDecoding (line 59) | func TestTreeDecoding(t *testing.T) {
  function TestTreeDecodingShaBoundary (line 131) | func TestTreeDecodingShaBoundary(t *testing.T) {
  function TestTreeMergeReplaceElements (line 165) | func TestTreeMergeReplaceElements(t *testing.T) {
  function TestMergeInsertElementsInSubtreeOrder (line 204) | func TestMergeInsertElementsInSubtreeOrder(t *testing.T) {
  type TreeEntryTypeTestCase (line 243) | type TreeEntryTypeTestCase struct
    method AssertType (line 249) | func (c *TreeEntryTypeTestCase) AssertType(t *testing.T) {
    method AssertIsLink (line 259) | func (c *TreeEntryTypeTestCase) AssertIsLink(t *testing.T) {
  function TestTreeEntryTypeResolution (line 269) | func TestTreeEntryTypeResolution(t *testing.T) {
  function TestSubtreeOrder (line 281) | func TestSubtreeOrder(t *testing.T) {
  function TestSubtreeOrderReturnsEmptyForOutOfBounds (line 321) | func TestSubtreeOrderReturnsEmptyForOutOfBounds(t *testing.T) {
  function TestSubtreeOrderReturnsEmptyForNilElements (line 330) | func TestSubtreeOrderReturnsEmptyForNilElements(t *testing.T) {
  function TestTreeEqualReturnsTrueWithUnchangedContents (line 338) | func TestTreeEqualReturnsTrueWithUnchangedContents(t *testing.T) {
  function TestTreeEqualReturnsFalseWithChangedContents (line 351) | func TestTreeEqualReturnsFalseWithChangedContents(t *testing.T) {
  function TestTreeEqualReturnsTrueWhenOneTreeIsNil (line 366) | func TestTreeEqualReturnsTrueWhenOneTreeIsNil(t *testing.T) {
  function TestTreeEqualReturnsTrueWhenBothTreesAreNil (line 380) | func TestTreeEqualReturnsTrueWhenBothTreesAreNil(t *testing.T) {
  function TestTreeEntryEqualReturnsTrueWhenEntriesAreTheSame (line 389) | func TestTreeEntryEqualReturnsTrueWhenEntriesAreTheSame(t *testing.T) {
  function TestTreeEntryEqualReturnsFalseWhenDifferentNames (line 398) | func TestTreeEntryEqualReturnsFalseWhenDifferentNames(t *testing.T) {
  function TestTreeEntryEqualReturnsFalseWhenDifferentOids (line 407) | func TestTreeEntryEqualReturnsFalseWhenDifferentOids(t *testing.T) {
  function TestTreeEntryEqualReturnsFalseWhenDifferentFilemodes (line 418) | func TestTreeEntryEqualReturnsFalseWhenDifferentFilemodes(t *testing.T) {
  function TestTreeEntryEqualReturnsFalseWhenOneEntryIsNil (line 427) | func TestTreeEntryEqualReturnsFalseWhenOneEntryIsNil(t *testing.T) {
  function TestTreeEntryEqualReturnsTrueWhenBothEntriesAreNil (line 436) | func TestTreeEntryEqualReturnsTrueWhenBothEntriesAreNil(t *testing.T) {
  function assertTreeEntry (line 445) | func assertTreeEntry(t *testing.T, buf *bytes.Buffer,

FILE: modules/git/hash.go
  function RevParseHEAD (line 38) | func RevParseHEAD(ctx context.Context, environ []string, repoPath string...
  function ParseReference (line 50) | func ParseReference(ctx context.Context, repoPath string, symref string)...
  function startsWithHashablePrefix (line 70) | func startsWithHashablePrefix(line []byte) bool {
  function HashFromEnv (line 84) | func HashFromEnv(ctx context.Context, environ []string, repoPath string)...
  function Hash (line 127) | func Hash(ctx context.Context, repoPath string) (string, error) {
  type HashResult (line 131) | type HashResult struct
  function HashEx (line 138) | func HashEx(ctx context.Context, repoPath string) (*HashResult, error) {

FILE: modules/git/hash_test.go
  function TestHash (line 10) | func TestHash(t *testing.T) {
  function TestParseReference (line 19) | func TestParseReference(t *testing.T) {

FILE: modules/git/object.go
  type Metadata (line 8) | type Metadata struct
  type Object (line 17) | type Object struct
    method Read (line 29) | func (o *Object) Read(p []byte) (int, error) {
    method WriteTo (line 36) | func (o *Object) WriteTo(w io.Writer) (int64, error) {
    method Discard (line 41) | func (o *Object) Discard() {

FILE: modules/git/odb.go
  type ODB (line 12) | type ODB struct
    method Close (line 17) | func (o *ODB) Close() error {
  function NewODB (line 24) | func NewODB(repoPath string, hashAlgo HashFormat) (*ODB, error) {
  type ObjectType (line 55) | type ObjectType
    method String (line 70) | func (t ObjectType) String() string {
    method Bytes (line 91) | func (t ObjectType) Bytes() []byte {
    method Valid (line 96) | func (t ObjectType) Valid() bool {
    method IsDelta (line 102) | func (t ObjectType) IsDelta() bool {
  constant InvalidObject (line 58) | InvalidObject ObjectType = 0
  constant CommitObject (line 59) | CommitObject  ObjectType = 1
  constant TreeObject (line 60) | TreeObject    ObjectType = 2
  constant BlobObject (line 61) | BlobObject    ObjectType = 3
  constant TagObject (line 62) | TagObject     ObjectType = 4
  constant OFSDeltaObject (line 64) | OFSDeltaObject ObjectType = 6
  constant REFDeltaObject (line 65) | REFDeltaObject ObjectType = 7
  constant AnyObject (line 67) | AnyObject ObjectType = -127
  function ParseObjectType (line 108) | func ParseObjectType(value string) (typ ObjectType, err error) {

FILE: modules/git/reference.go
  constant refPrefix (line 16) | refPrefix       = "refs/"
  constant refHeadPrefix (line 17) | refHeadPrefix   = refPrefix + "heads/"
  constant refTagPrefix (line 18) | refTagPrefix    = refPrefix + "tags/"
  constant refRemotePrefix (line 19) | refRemotePrefix = refPrefix + "remotes/"
  constant refNotePrefix (line 20) | refNotePrefix   = refPrefix + "notes/"
  constant RefRevParseRulesCount (line 24) | RefRevParseRulesCount = 6
  type ReferenceType (line 40) | type ReferenceType
    method String (line 48) | func (r ReferenceType) String() string {
  constant InvalidReference (line 43) | InvalidReference  ReferenceType = 0
  constant HashReference (line 44) | HashReference     ReferenceType = 1
  constant SymbolicReference (line 45) | SymbolicReference ReferenceType = 2
  type ReferenceName (line 62) | type ReferenceName
    method IsBranch (line 95) | func (r ReferenceName) IsBranch() bool {
    method BranchName (line 99) | func (r ReferenceName) BranchName() string {
    method IsNote (line 104) | func (r ReferenceName) IsNote() bool {
    method IsRemote (line 109) | func (r ReferenceName) IsRemote() bool {
    method IsTag (line 114) | func (r ReferenceName) IsTag() bool {
    method TagName (line 118) | func (r ReferenceName) TagName() string {
    method String (line 122) | func (r ReferenceName) String() string {
    method Short (line 129) | func (r ReferenceName) Short() string {
    method Branch (line 151) | func (r ReferenceName) Branch() (string, bool) {
  function NewBranchReferenceName (line 66) | func NewBranchReferenceName(name string) ReferenceName {
  function NewNoteReferenceName (line 72) | func NewNoteReferenceName(name string) ReferenceName {
  function NewRemoteReferenceName (line 78) | func NewRemoteReferenceName(remote, name string) ReferenceName {
  function NewRemoteHEADReferenceName (line 84) | func NewRemoteHEADReferenceName(remote string) ReferenceName {
  function NewTagReferenceName (line 90) | func NewTagReferenceName(name string) ReferenceName {
  constant HEAD (line 144) | HEAD   ReferenceName = "HEAD"
  constant Master (line 145) | Master ReferenceName = "refs/heads/master"
  type Reference (line 159) | type Reference struct
  function NewReference (line 175) | func NewReference(name ReferenceName, target string) Reference {
  function NewSymbolicReference (line 184) | func NewSymbolicReference(name ReferenceName, target ReferenceName) Refe...
  type ErrAlreadyLocked (line 192) | type ErrAlreadyLocked struct
    method Error (line 197) | func (e *ErrAlreadyLocked) Error() string {
  function IsErrAlreadyLocked (line 209) | func IsErrAlreadyLocked(err error) bool {
  function ReferenceTarget (line 214) | func ReferenceTarget(ctx context.Context, repoPath, reference string) (s...
  function UpdateRef (line 230) | func UpdateRef(ctx context.Context, repoPath string, reference string, o...
  type ErrReferenceBadName (line 258) | type ErrReferenceBadName struct
    method Error (line 262) | func (err ErrReferenceBadName) Error() string {
  function IsErrReferenceBadName (line 266) | func IsErrReferenceBadName(err error) bool {
  function checkReferenceNameComponent (line 299) | func checkReferenceNameComponent(refname []byte) int {
  function ValidateReferenceName (line 356) | func ValidateReferenceName(refname []byte) bool {
  function ValidateBranchName (line 375) | func ValidateBranchName(branch []byte) bool {
  function ValidateTagName (line 383) | func ValidateTagName(tag []byte) bool {
  constant ReferenceLineFormat (line 391) | ReferenceLineFormat = "%(refname)%00%(refname:short)%00%(objectname)%00%...
  function ParseOneReference (line 394) | func ParseOneReference(referenceLine string) (*Reference, error) {
  type ReferenceEx (line 406) | type ReferenceEx struct
  function ReferencePrefixMatch (line 419) | func ReferencePrefixMatch(ctx context.Context, repoPath string, refname ...
  function HasSpecificReference (line 478) | func HasSpecificReference(ctx context.Context, repoPath string, referenc...
  type Order (line 502) | type Order
  constant OrderNone (line 505) | OrderNone Order = iota
  constant OrderNewest (line 506) | OrderNewest
  constant OrderOldest (line 507) | OrderOldest
  function ParseReferences (line 510) | func ParseReferences(ctx context.Context, repoPath string, order Order) ...

FILE: modules/git/reftable/reftable.go
  type version (line 33) | type version
    method HeaderSize (line 36) | func (v version) HeaderSize() int {
    method FooterSize (line 50) | func (v version) FooterSize() int {
  type headerV1 (line 63) | type headerV1 struct
  type header (line 72) | type header struct
  function parseHeader (line 80) | func parseHeader(reader io.Reader, hdr *header) error {
  type footerEnd (line 107) | type footerEnd struct
  type footer (line 117) | type footer struct
  function parseFooter (line 124) | func parseFooter(reader io.Reader, f *footer) error {
  type block (line 146) | type block struct
  type Table (line 155) | type Table struct
    method MinUpdateIndex (line 164) | func (t *Table) MinUpdateIndex() uint64 {
    method MaxUpdateIndex (line 169) | func (t *Table) MaxUpdateIndex() uint64 {
    method shaFormat (line 174) | func (t *Table) shaFormat() git.HashFormat {
    method getBlockRange (line 188) | func (t *Table) getBlockRange(offset, size uint) (uint, uint) {
    method extractBlockLen (line 201) | func (t *Table) extractBlockLen(src []byte, blockStart uint) uint {
    method getVarInt (line 206) | func (t *Table) getVarInt(src []byte, start uint, blockEnd uint) (uint...
    method getRefsFromBlock (line 224) | func (t *Table) getRefsFromBlock(src []byte, b *block) ([]git.Referenc...
    method parseRefBlock (line 307) | func (t *Table) parseRefBlock(src []byte, headerOffset, blockStart, bl...
    method GetReferences (line 332) | func (t *Table) GetReferences() ([]git.Reference, error) {
    method PatchUpdateIndexes (line 376) | func (t *Table) PatchUpdateIndexes(minVal, maxVal uint64) (returnedErr...
    method Close (line 445) | func (t *Table) Close() error {
  function parseUint24 (line 182) | func parseUint24(data [3]byte) uint {
  function ParseTable (line 451) | func ParseTable(absolutePath string) (_ *Table, returnedErr error) {
  function ReadTablesList (line 494) | func ReadTablesList(repoPath string) ([]Name, error) {
  type Name (line 514) | type Name struct
    method String (line 524) | func (n Name) String() string {
  function ParseName (line 539) | func ParseName(reftableName string) (Name, error) {

FILE: modules/git/remote.go
  function MatchesScheme (line 14) | func MatchesScheme(url string) bool {
  function MatchesScpLike (line 20) | func MatchesScpLike(url string) bool {
  function IsLocalEndpoint (line 28) | func IsLocalEndpoint(url string) bool {
  function FindScpLikeComponents (line 34) | func FindScpLikeComponents(url string) (user, host, port, path string) {

FILE: modules/git/repo.go
  function IsBareRepository (line 12) | func IsBareRepository(ctx context.Context, repoPath string) bool {
  constant differentHashErr (line 22) | differentHashErr     = "fatal: attempt to reinitialize repository with d...
  constant invalidBranchNameErr (line 23) | invalidBranchNameErr = "fatal: invalid initial branch name"
  function NewRepo (line 31) | func NewRepo(ctx context.Context, repoPath, branch string, bare bool, sh...

FILE: modules/git/repo_test.go
  function TestIsBareRepository (line 11) | func TestIsBareRepository(t *testing.T) {

FILE: modules/git/signature.go
  constant GitTimeLayout (line 18) | GitTimeLayout = "Mon Jan _2 15:04:05 2006 -0700"
  type Signature (line 22) | type Signature struct
    method String (line 39) | func (s *Signature) String() string {
    method Decode (line 47) | func (s *Signature) Decode(b []byte) {
    method Encode (line 114) | func (s *Signature) Encode(w io.Writer) error {
    method encodeTimeAndTimeZone (line 124) | func (s *Signature) encodeTimeAndTimeZone(w io.Writer) error {
  constant formatTimeZoneOnly (line 32) | formatTimeZoneOnly = "-0700"
  function newSignatureFromCommitLine (line 61) | func newSignatureFromCommitLine(line []byte) (sig *Signature, err error) {
  function SignatureFromLine (line 130) | func SignatureFromLine(line string) *Signature {

FILE: modules/git/stats/commit-graph.go
  type CommitGraphInfo (line 15) | type CommitGraphInfo struct
  function CommitGraphInfoForRepository (line 41) | func CommitGraphInfoForRepository(repoPath string) (CommitGraphInfo, err...

FILE: modules/git/stats/status.go
  constant StaleObjectsGracePeriod (line 26) | StaleObjectsGracePeriod = -10 * 24 * time.Hour
  function PackfilesCount (line 30) | func PackfilesCount(repoPath string) (uint64, error) {
  function LooseObjects (line 40) | func LooseObjects(repoPath string) (uint64, error) {
  type Stat (line 50) | type Stat struct
  function Status (line 63) | func Status(ctx context.Context, repoPath string, refFormat string) (Sta...
  type ReferencesStat (line 91) | type ReferencesStat struct
  type ReftableTable (line 106) | type ReftableTable struct
  function ReferencesStatus (line 118) | func ReferencesStatus(ctx context.Context, repoPath string, refFormat st...
  type LooseObjectsStat (line 209) | type LooseObjectsStat struct
  function LooseObjectsStatus (line 229) | func LooseObjectsStatus(repoPath string, cutoffDate time.Time) (LooseObj...
  function isValidLooseObjectName (line 273) | func isValidLooseObjectName(s string) bool {
  type PackEntry (line 282) | type PackEntry struct
  type PackfilesStat (line 288) | type PackfilesStat struct
    method NoLargePack (line 323) | func (pi PackfilesStat) NoLargePack() bool {
  constant LargePackThreshold (line 319) | LargePackThreshold uint64 = 2 * 1024 * 1024 * 1024
  constant PackSizeTotal (line 320) | PackSizeTotal      uint64 = 8 * 1024 * 1024 * 1024
  function PackfilesStatus (line 333) | func PackfilesStatus(repoPath string) (PackfilesStat, error) {
  type packfileMetadata (line 422) | type packfileMetadata struct
  function classifyPackfiles (line 429) | func classifyPackfiles(entries []fs.DirEntry) map[string]packfileMetadata {
  function entrySize (line 453) | func entrySize(entry fs.DirEntry) (uint64, error) {
  function hasPrefixAndSuffix (line 466) | func hasPrefixAndSuffix(s, prefix, suffix string) bool {
  type BitmapStat (line 471) | type BitmapStat struct
  function BitmapStatus (line 491) | func BitmapStatus(path string) (BitmapStat, error) {
  type MultiPackIndexStat (line 529) | type MultiPackIndexStat struct
  function MultiPackIndexStatus (line 540) | func MultiPackIndexStatus(path string) (MultiPackIndexStat, error) {
  type LFSObjectsStat (line 584) | type LFSObjectsStat struct
  function LFSObjectsStatus (line 589) | func LFSObjectsStatus(repoPath string) (LFSObjectsStat, error) {

FILE: modules/git/tag.go
  function JoinTagPrefix (line 13) | func JoinTagPrefix(tag string) string {
  type Tag (line 20) | type Tag struct
    method Size (line 36) | func (t *Tag) Size() int64 {
    method Extract (line 40) | func (t *Tag) Extract() (message string, signature string) {
    method Message (line 47) | func (t *Tag) Message() string {
    method ExtractCommitGPGSignature (line 52) | func (t *Tag) ExtractCommitGPGSignature() *CommitGPGSignature {
    method Decode (line 87) | func (t *Tag) Decode(hash string, reader io.Reader, size int64) error {
  function FindTag (line 133) | func FindTag(ctx context.Context, repoPath string, name string) (*Refere...

FILE: modules/git/tree.go
  constant sIFMT (line 15) | sIFMT      = FileMode(0170000)
  constant sIFREG (line 16) | sIFREG     = FileMode(0100000)
  constant sIFDIR (line 17) | sIFDIR     = FileMode(0040000)
  constant sIFLNK (line 18) | sIFLNK     = FileMode(0120000)
  constant sIFGITLINK (line 19) | sIFGITLINK = FileMode(0160000)
  type Tree (line 23) | type Tree struct
    method Size (line 43) | func (t *Tree) Size() int64 {
    method Decode (line 53) | func (t *Tree) Decode(hash string, from io.Reader, size int64) (n int,...
  type TreeEntry (line 33) | type TreeEntry struct
    method Type (line 99) | func (e *TreeEntry) Type() string {
    method IsLink (line 116) | func (e *TreeEntry) IsLink() bool {

FILE: modules/git/updateref.go
  type state (line 21) | type state
  constant stateIdle (line 25) | stateIdle state = "idle"
  constant stateStarted (line 28) | stateStarted state = "started"
  constant statePrepared (line 32) | statePrepared state = "prepared"
  type RefUpdater (line 35) | type RefUpdater struct
    method expectState (line 91) | func (u *RefUpdater) expectState(expected state) error {
    method checkState (line 104) | func (u *RefUpdater) checkState(expected state) error {
    method Start (line 114) | func (u *RefUpdater) Start() error {
    method Update (line 130) | func (u *RefUpdater) Update(reference ReferenceName, newRev, oldRev st...
    method UpdateSymbolicReference (line 140) | func (u *RefUpdater) UpdateSymbolicReference(reference, newTarget Refe...
    method Create (line 151) | func (u *RefUpdater) Create(reference ReferenceName, oid string) error {
    method Delete (line 159) | func (u *RefUpdater) Delete(reference ReferenceName) error {
    method Prepare (line 166) | func (u *RefUpdater) Prepare() error {
    method Commit (line 178) | func (u *RefUpdater) Commit() error {
    method Close (line 197) | func (u *RefUpdater) Close() error {
    method teardown (line 201) | func (u *RefUpdater) teardown() {
    method closeWithError (line 210) | func (u *RefUpdater) closeWithError(closeErr error) error {
    method write (line 233) | func (u *RefUpdater) write(format string, args ...any) error {
    method setState (line 241) | func (u *RefUpdater) setState(state string) error {
  function NewRefUpdater (line 49) | func NewRefUpdater(ctx context.Context, repoPath string, environ []strin...

FILE: modules/git/util.go
  constant Sundries (line 18) | Sundries = "sundries"
  function RevParseHashFormat (line 21) | func RevParseHashFormat(ctx context.Context, repoPath string) (string, e...
  function HashFormatResult (line 30) | func HashFormatResult(repoPath string) (HashFormat, error) {
  function HashFormatOK (line 38) | func HashFormatOK(repoPath string) HashFormat {
  function ExtensionsFormat (line 46) | func ExtensionsFormat(repoPath string) (HashFormat, string) {
  function RevParseRepoPath (line 55) | func RevParseRepoPath(ctx context.Context, p string) string {
  function RevParseWorktree (line 73) | func RevParseWorktree(ctx context.Context, p string) (string, error) {
  function ValidateBytesRevision (line 96) | func ValidateBytesRevision(revision []byte) error {
  function ValidateRevision (line 107) | func ValidateRevision(revision string) error {
  function PareTimeFallback (line 125) | func PareTimeFallback(s string) time.Time {
  function NewSundriesDir (line 132) | func NewSundriesDir(repoPath string, pattern string) (string, error) {

FILE: modules/git/version.go
  type Version (line 15) | type Version struct
    method String (line 49) | func (v Version) String() string {
    method LessThan (line 54) | func (v Version) LessThan(other Version) bool {
    method Equal (line 83) | func (v Version) Equal(other Version) bool {
    method GreaterOrEqual (line 88) | func (v Version) GreaterOrEqual(other Version) bool {
  function NewVersion (line 22) | func NewVersion(major, minor, patch uint32) Version {
  function ParseVersionOutput (line 33) | func ParseVersionOutput(versionOutput []byte) (Version, error) {
  function ParseVersion (line 93) | func ParseVersion(versionStr string) (Version, error) {
  function gitVersionDetect (line 135) | func gitVersionDetect() (Version, error) {
  function IsGitVersionAtLeast (line 150) | func IsGitVersionAtLeast(other Version) bool {

FILE: modules/git/version_test.go
  function TestVersion (line 10) | func TestVersion(t *testing.T) {
  function TestIsGitVersionAtLeast (line 22) | func TestIsGitVersionAtLeast(t *testing.T) {

FILE: modules/hexview/format.go
  constant CN (line 14) | CN byte = 0
  constant CS (line 15) | CS byte = 1
  constant CP (line 16) | CP byte = 2
  constant CC (line 17) | CC byte = 3
  constant CH (line 18) | CH byte = 4
  type binaryPrinter (line 54) | type binaryPrinter struct
    method doPrintln (line 85) | func (b *binaryPrinter) doPrintln(a ...string) {
    method writeBorder (line 91) | func (b *binaryPrinter) writeBorder() error {
    method writeFooter (line 98) | func (b *binaryPrinter) writeFooter() error {
    method formatByte (line 105) | func (b *binaryPrinter) formatByte(v byte) {
    method displayByte (line 110) | func (b *binaryPrinter) displayByte(v byte) {
    method writeLine (line 115) | func (b *binaryPrinter) writeLine(offset int64, input []byte) error {
    method flush (line 150) | func (b *binaryPrinter) flush() error {
  function newBinaryPrinter (line 60) | func newBinaryPrinter(w io.Writer, colorMode term.Level) *binaryPrinter {
  constant panelSize (line 82) | panelSize = 2*8 + 9
  function Format (line 156) | func Format(r io.Reader, w io.Writer, size int64, colorMode term.Level) ...

FILE: modules/hexview/format_test.go
  function TestFormat (line 12) | func TestFormat(t *testing.T) {
  function TestFormatOverflow (line 21) | func TestFormatOverflow(t *testing.T) {
  function TestBorder (line 30) | func TestBorder(t *testing.T) {

FILE: modules/keyring/keyring.go
  type Cred (line 27) | type Cred struct
  type Option (line 43) | type Option
  type Options (line 46) | type Options struct
  function WithStorage (line 70) | func WithStorage(storage string) Option {
  function WithEncryptionKey (line 78) | func WithEncryptionKey(key string) Option {
  function WithStoragePath (line 86) | func WithStoragePath(path string) Option {
  function resolveStorageOptions (line 92) | func resolveStorageOptions(opts ...Option) *Options {
  constant storageAuto (line 104) | storageAuto = "auto"
  constant storageFile (line 105) | storageFile = "file"
  constant storageNone (line 106) | storageNone = "none"
  function NewCredFromURL (line 112) | func NewCredFromURL(targetURL string) *Cred {
  function buildTargetName (line 147) | func buildTargetName(cred *Cred) string {
  function parseTargetName (line 170) | func parseTargetName(target string) *Cred {
  function parseSchemePrefix (line 198) | func parseSchemePrefix(scheme, prefix string) (protocol string, found bo...

FILE: modules/keyring/keyring_darwin.go
  constant kCFStringEncodingUTF8 (line 23) | kCFStringEncodingUTF8 = 0x08000100
  constant kCFAllocatorDefault (line 24) | kCFAllocatorDefault   = 0
  type osStatus (line 27) | type osStatus
  constant errSecSuccess (line 30) | errSecSuccess       osStatus = 0
  constant errSecDuplicateItem (line 31) | errSecDuplicateItem osStatus = -25299
  constant errSecItemNotFound (line 32) | errSecItemNotFound  osStatus = -25300
  type _CFRange (line 35) | type _CFRange struct
  type _CFNumberType (line 40) | type _CFNumberType
  constant kCFNumberIntType (line 44) | kCFNumberIntType _CFNumberType = 3
  function ensureInitialized (line 105) | func ensureInitialized() error {
  function initializeKeyring (line 113) | func initializeKeyring() error {
  function Get (line 202) | func Get(ctx context.Context, cred *Cred, opts ...Option) (*Cred, error) {
  function getFromKeychain (line 232) | func getFromKeychain(ctx context.Context, cred *Cred) (*Cred, error) {
  function Store (line 333) | func Store(ctx context.Context, cred *Cred, opts ...Option) error {
  function storeToKeychain (line 378) | func storeToKeychain(ctx context.Context, cred *Cred) error {
  function Erase (line 478) | func Erase(ctx context.Context, cred *Cred, opts ...Option) error {
  function eraseFromKeychain (line 508) | func eraseFromKeychain(ctx context.Context, cred *Cred) error {
  function darwinProtocolFromScheme (line 568) | func darwinProtocolFromScheme(protocol string) uintptr {
  type darwinOptionalFields (line 592) | type darwinOptionalFields struct
    method Release (line 601) | func (f *darwinOptionalFields) Release() {
  function newOptionalFields (line 619) | func newOptionalFields(cred *Cred, keys, values *[]uintptr) *darwinOptio...
  function deref (line 667) | func deref(ptr uintptr) uintptr {

FILE: modules/keyring/keyring_darwin_security.go
  constant storageSecurity (line 21) | storageSecurity = "security"
  constant securityCLIPath (line 23) | securityCLIPath = "/usr/bin/security"
  constant securityErrNotFoundExitCode (line 26) | securityErrNotFoundExitCode = 44
  constant maxSecurityCommandLen (line 31) | maxSecurityCommandLen = 64 * 1024
  function protocolFourCC (line 43) | func protocolFourCC(protocol string) string {
  function isSecurityNotFoundError (line 66) | func isSecurityNotFoundError(err error, output []byte) bool {
  function shellQuote (line 86) | func shellQuote(s string) string {
  function getFromSecurityCLI (line 100) | func getFromSecurityCLI(ctx context.Context, cred *Cred) (*Cred, error) {
  function parseKeychainOutput (line 166) | func parseKeychainOutput(r io.Reader) (*Cred, error) {
  function parseBlobValue (line 214) | func parseBlobValue(s string) (string, error) {
  function storeToSecurityCLI (line 231) | func storeToSecurityCLI(ctx context.Context, cred *Cred) error {
  function eraseFromSecurityCLI (line 327) | func eraseFromSecurityCLI(ctx context.Context, cred *Cred) error {

FILE: modules/keyring/keyring_darwin_security_test.go
  function TestSecurityCLI (line 11) | func TestSecurityCLI(t *testing.T) {
  function TestSecurityCLIWithHTTP (line 76) | func TestSecurityCLIWithHTTP(t *testing.T) {
  function TestSecurityCLIWithSpecialChars (line 103) | func TestSecurityCLIWithSpecialChars(t *testing.T) {

FILE: modules/keyring/keyring_darwin_test.go
  function TestGet (line 10) | func TestGet(t *testing.T) {

FILE: modules/keyring/keyring_file.go
  type credentialStorage (line 33) | type credentialStorage struct
    method encrypt (line 171) | func (s *credentialStorage) encrypt(plaintext string) (string, error) {
    method decrypt (line 192) | func (s *credentialStorage) decrypt(ciphertext string) (string, error) {
    method readCredentials (line 222) | func (s *credentialStorage) readCredentials() (map[string]*Cred, error) {
    method decryptCredentialEntry (line 256) | func (s *credentialStorage) decryptCredentialEntry(entry credentialEnt...
    method writeCredentials (line 280) | func (s *credentialStorage) writeCredentials(credentials map[string]*C...
    method acquireFileLock (line 339) | func (s *credentialStorage) acquireFileLock(ctx context.Context) (func...
    method encryptCredentialEntry (line 367) | func (s *credentialStorage) encryptCredentialEntry(target string, cred...
    method Get (line 391) | func (s *credentialStorage) Get(ctx context.Context, cred *Cred) (*Cre...
    method Store (line 414) | func (s *credentialStorage) Store(ctx context.Context, cred *Cred) err...
    method Erase (line 442) | func (s *credentialStorage) Erase(ctx context.Context, cred *Cred) err...
    method Name (line 471) | func (s *credentialStorage) Name() string {
  type credentialEntry (line 41) | type credentialEntry struct
  type credentialsFile (line 48) | type credentialsFile struct
  constant defaultCredentialsFileName (line 53)
Condensed preview — 1006 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5,438K chars).
[
  {
    "path": ".github/dependabot.yml",
    "chars": 365,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n  "
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 1226,
    "preview": "name: CI\non:\n  push:\n    paths-ignore:\n      # https://help.github.com/en/actions/reference/workflow-syntax-for-github-a"
  },
  {
    "path": ".gitignore",
    "chars": 209,
    "preview": "bin/*\n/build/\n/dest/\n/etc/zeta.toml\n/cmd/zeta/zeta\n*.exe\n*.dll\n*.so\n*.a\n*.tar.gz\n*.zip\n/*.sh\nlocal/*\n.DS_Store\n*.gop1\n*."
  },
  {
    "path": ".golangci.yml",
    "chars": 819,
    "preview": "version: 2\n\nrun:\n  timeout: 5m\n  issues-exit-code: 1\n  tests: true\n\noutput:\n  format: colored-line-number\n  print-issued"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 5161,
    "preview": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Change"
  },
  {
    "path": "LEGAL.md",
    "chars": 406,
    "preview": "Legal Disclaimer\n\nWithin this source code, the comments in Chinese shall be the original, governing version. Any comment"
  },
  {
    "path": "LICENSE",
    "chars": 11356,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "Makefile",
    "chars": 1226,
    "preview": "SHELL = /usr/bin/env bash -eo pipefail\n\nPKG           := github.com/antgroup/hugescm\nSOURCE_DIR    := $(abspath $(dir $("
  },
  {
    "path": "README.md",
    "chars": 10323,
    "preview": "# HugeSCM - A next generation cloud-based version control system\n\n[![license badge](https://img.shields.io/github/licens"
  },
  {
    "path": "README.zh-CN.md",
    "chars": 6558,
    "preview": "# HugeSCM - 基于云的下一代版本控制系统\n\n[![license badge](https://img.shields.io/github/license/antgroup/hugescm.svg)](LICENSE)\n[![Ma"
  },
  {
    "path": "VERSION",
    "chars": 6,
    "preview": "0.23.0"
  },
  {
    "path": "bali.toml",
    "chars": 522,
    "preview": "# https://toml.io/en/\nname = \"zeta\"\nsummary = \"HugeSCM - A next generation cloud-based version control system\"\ndescripti"
  },
  {
    "path": "cmd/README.md",
    "chars": 9,
    "preview": "# command"
  },
  {
    "path": "cmd/hot/command/command.go",
    "chars": 1779,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"conte"
  },
  {
    "path": "cmd/hot/command/command_az.go",
    "chars": 1109,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"conte"
  },
  {
    "path": "cmd/hot/command/command_cat.go",
    "chars": 7937,
    "preview": "package command\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"charm.l"
  },
  {
    "path": "cmd/hot/command/command_co.go",
    "chars": 3344,
    "preview": "package command\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/antgroup/"
  },
  {
    "path": "cmd/hot/command/command_diff.go",
    "chars": 3016,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"conte"
  },
  {
    "path": "cmd/hot/command/command_expire_refs.go",
    "chars": 3644,
    "preview": "package command\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/antgroup/hugescm/cmd"
  },
  {
    "path": "cmd/hot/command/command_graft.go",
    "chars": 2191,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"conte"
  },
  {
    "path": "cmd/hot/command/command_mc.go",
    "chars": 3549,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"conte"
  },
  {
    "path": "cmd/hot/command/command_prune_refs.go",
    "chars": 7110,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"bufio"
  },
  {
    "path": "cmd/hot/command/command_remove.go",
    "chars": 1772,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"conte"
  },
  {
    "path": "cmd/hot/command/command_scan_refs.go",
    "chars": 6446,
    "preview": "package command\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"charm.land/bubbles/v2/paginator\"\n\t\"ch"
  },
  {
    "path": "cmd/hot/command/command_show.go",
    "chars": 2743,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"conte"
  },
  {
    "path": "cmd/hot/command/command_size.go",
    "chars": 1236,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"conte"
  },
  {
    "path": "cmd/hot/command/command_smart.go",
    "chars": 3327,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"conte"
  },
  {
    "path": "cmd/hot/command/command_snapshot.go",
    "chars": 7812,
    "preview": "package command\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"git"
  },
  {
    "path": "cmd/hot/command/command_stat.go",
    "chars": 702,
    "preview": "package command\n\nimport (\n\t\"context\"\n\n\t\"github.com/antgroup/hugescm/cmd/hot/pkg/stat\"\n\t\"github.com/antgroup/hugescm/modu"
  },
  {
    "path": "cmd/hot/command/command_unbranch.go",
    "chars": 1973,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"conte"
  },
  {
    "path": "cmd/hot/command/misc.go",
    "chars": 3281,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage command\n\nimport (\n\t\"bytes"
  },
  {
    "path": "cmd/hot/command/pager.go",
    "chars": 2369,
    "preview": "package command\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\n\t\"github.com/antgroup/hugescm/modules/env\"\n\t\"github.com/ant"
  },
  {
    "path": "cmd/hot/crate.toml",
    "chars": 426,
    "preview": "name = \"hot\"\ndescription = \"HugeSCM - A next generation cloud-based version control system\"\ndestination = \"bin\"\nversion "
  },
  {
    "path": "cmd/hot/hot.go",
    "chars": 2835,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage main\n\nimport (\n\t\"os\"\n\n\t\"g"
  },
  {
    "path": "cmd/hot/pkg/README.md",
    "chars": 9,
    "preview": "# hot pkg"
  },
  {
    "path": "cmd/hot/pkg/co/co.go",
    "chars": 6983,
    "preview": "package co\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"slices\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/antgroup/hugescm/cmd/hot"
  },
  {
    "path": "cmd/hot/pkg/co/misc.go",
    "chars": 443,
    "preview": "package co\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/antgroup/hugescm/modules/git\"\n\t\"github.com/antgroup/hugescm/pkg/version\"\n)\n\nfu"
  },
  {
    "path": "cmd/hot/pkg/co/misc_test.go",
    "chars": 177,
    "preview": "package co\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestNewUserAgent(t *testing.T) {\n\tu, ok := NewUserAgent()\n\tif ok {\n"
  },
  {
    "path": "cmd/hot/pkg/diff/diff.go",
    "chars": 22991,
    "preview": "// Package diff provides a parser for git diff output.\n// It parses the output of: git diff --raw --full-index --find-re"
  },
  {
    "path": "cmd/hot/pkg/diff/parser_test.go",
    "chars": 21506,
    "preview": "package diff\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/antgroup/hugescm/modules/git\"\n)\n\n// rawLine g"
  },
  {
    "path": "cmd/hot/pkg/hud/bar.go",
    "chars": 1522,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage hud\n\nimport (\n\t\"fmt\"\n\t\"os"
  },
  {
    "path": "cmd/hot/pkg/hud/display.go",
    "chars": 3328,
    "preview": "package hud\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/antgroup/hugescm/modules/git\"\n\t\"github.com/antgrou"
  },
  {
    "path": "cmd/hot/pkg/mc/migrate.go",
    "chars": 13390,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage mc\n\nimport (\n\t\"bufio\"\n\t\"c"
  },
  {
    "path": "cmd/hot/pkg/refs/refs.go",
    "chars": 3897,
    "preview": "package refs\n\nimport (\n\t\"context\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/antgroup/hugesc"
  },
  {
    "path": "cmd/hot/pkg/replay/cache.go",
    "chars": 2128,
    "preview": "// Copyright (c) 2014- GitHub, Inc. and Git LFS contributors\n// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-Lic"
  },
  {
    "path": "cmd/hot/pkg/replay/cleanup.go",
    "chars": 1361,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage replay\n\nimport (\n\t\"fmt\"\n\t"
  },
  {
    "path": "cmd/hot/pkg/replay/drop.go",
    "chars": 5027,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage replay\n\nimport (\n\t\"errors"
  },
  {
    "path": "cmd/hot/pkg/replay/graft.go",
    "chars": 5361,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage replay\n\nimport (\n\t\"encodi"
  },
  {
    "path": "cmd/hot/pkg/replay/misc.go",
    "chars": 2045,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage replay\n\nimport (\n\t\"fmt\"\n\t"
  },
  {
    "path": "cmd/hot/pkg/replay/replay.go",
    "chars": 2545,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage replay\n\nimport (\n\t\"bufio\""
  },
  {
    "path": "cmd/hot/pkg/replay/unbranch.go",
    "chars": 6394,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage replay\n\nimport (\n\t\"bufio\""
  },
  {
    "path": "cmd/hot/pkg/replay/update.go",
    "chars": 3829,
    "preview": "// Copyright (c) 2014- GitHub, Inc. and Git LFS contributors\n// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-Lic"
  },
  {
    "path": "cmd/hot/pkg/stat/az.go",
    "chars": 1358,
    "preview": "package stat\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/antgroup/hugescm/cmd/hot/pkg/tr\"\n\t\"github.com/antgroup/huge"
  },
  {
    "path": "cmd/hot/pkg/stat/color.go",
    "chars": 1620,
    "preview": "package stat\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/antgroup/hugescm/modules/strengthen\"\n\t\"github.com/antgroup/hugescm/modules/t"
  },
  {
    "path": "cmd/hot/pkg/stat/draw.go",
    "chars": 2256,
    "preview": "package stat\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/antgroup/hugescm/cmd/hot/pkg/tr\"\n\t\"gith"
  },
  {
    "path": "cmd/hot/pkg/stat/size.go",
    "chars": 3423,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\npackage stat\n\nimport (\n\t\"bufio\"\n\t"
  },
  {
    "path": "cmd/hot/pkg/stat/stat.go",
    "chars": 7944,
    "preview": "package stat\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github"
  },
  {
    "path": "cmd/hot/pkg/stat/stat_test.go",
    "chars": 1939,
    "preview": "package stat\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestCheckEmail(t *testing.T) {\n\tss := []string{\n\t\t// valid\n\t\t\"tes"
  },
  {
    "path": "cmd/hot/pkg/stat/table.go",
    "chars": 3684,
    "preview": "package stat\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"charm.land/lipgloss/v2\"\n\t\"charm.land/lipgloss/v2/ta"
  },
  {
    "path": "cmd/hot/pkg/tr/README.md",
    "chars": 11,
    "preview": "# translate"
  },
  {
    "path": "cmd/hot/pkg/tr/languages/zh-CN.toml",
    "chars": 9056,
    "preview": "\"hot - Git repositories maintenance tool\" = \"hot - Git 存储库维护工具\"\n\"Show context-sensitive help\" = \"显示上下文相关的帮助\"\n\"Make the o"
  },
  {
    "path": "cmd/hot/pkg/tr/tr.go",
    "chars": 1006,
    "preview": "package tr\n\nimport (\n\t\"embed\"\n\t\"fmt\"\n\t\"io\"\n\t\"path\"\n\t\"strings\"\n\n\t\"github.com/antgroup/hugescm/modules/locale\"\n\t\"github.co"
  },
  {
    "path": "cmd/hot/pkg/tr/tr_test.go",
    "chars": 537,
    "preview": "package tr\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"testing\"\n)\n\nfunc TestFS(t *testing.T) {\n\t_ = DelayInitializeLocale()\n\tlan"
  },
  {
    "path": "cmd/hot/winres.toml",
    "chars": 1658,
    "preview": "# icon = \"res/bali.ico\"\nmanifest = \"\"\"data:<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly xmlns=\"urn:"
  },
  {
    "path": "cmd/zeta/crate.toml",
    "chars": 369,
    "preview": "name = \"zeta\"\ndescription = \"HugeSCM - A next generation cloud-based version control system\"\ndestination = \"bin\"\nversion"
  },
  {
    "path": "cmd/zeta/main.go",
    "chars": 5136,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"errors\""
  },
  {
    "path": "cmd/zeta/winres.toml",
    "chars": 1691,
    "preview": "# icon = \"res/bali.ico\"\nmanifest = \"\"\"data:<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly xmlns=\"urn:"
  },
  {
    "path": "cmd/zeta-mc/crate.toml",
    "chars": 350,
    "preview": "name = \"zeta-mc\"\ndescription = \"zeta-mc - Migrate Git repository to zeta\"\ndestination = \"bin\"\nversion = \"0.23.0\"\ngoflags"
  },
  {
    "path": "cmd/zeta-mc/main.go",
    "chars": 988,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"os\"\n\n\t\""
  },
  {
    "path": "cmd/zeta-mc/migrate.go",
    "chars": 4142,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"errors\""
  },
  {
    "path": "cmd/zeta-mc/msic.go",
    "chars": 1797,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"context"
  },
  {
    "path": "cmd/zeta-mc/winres.toml",
    "chars": 1705,
    "preview": "# icon = \"res/bali.ico\"\nmanifest = \"\"\"data:<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly xmlns=\"urn:"
  },
  {
    "path": "cmd/zeta-serve/command_encrypt.go",
    "chars": 2635,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\""
  },
  {
    "path": "cmd/zeta-serve/command_httpd.go",
    "chars": 1047,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"errors\""
  },
  {
    "path": "cmd/zeta-serve/command_keygen.go",
    "chars": 2578,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"crypto/"
  },
  {
    "path": "cmd/zeta-serve/command_sshd.go",
    "chars": 1036,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"errors\""
  },
  {
    "path": "cmd/zeta-serve/global.go",
    "chars": 887,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"fmt\"\n\n\t"
  },
  {
    "path": "cmd/zeta-serve/main.go",
    "chars": 1119,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"os\"\n\t\"t"
  },
  {
    "path": "cmd/zeta-serve/shutdown.go",
    "chars": 300,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"context"
  },
  {
    "path": "cmd/zeta-serve/shutdown_other.go",
    "chars": 699,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n//go:build darwin || linux || fr"
  },
  {
    "path": "cmd/zeta-serve/shutdown_windows.go",
    "chars": 612,
    "preview": "// Copyright ©️ Ant Group. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n//go:build windows\n\npackage main"
  },
  {
    "path": "docs/README.md",
    "chars": 3300,
    "preview": "# Zeta 文档中心\n\n欢迎来到 Zeta 文档中心!Zeta 是面向 AI 场景的巨型存储库版本控制系统。\n\n---\n\n## 文档索引\n\n### 设计与架构\n\n| 文档 | 描述 |\n|------|------|\n| [design."
  },
  {
    "path": "docs/cdc.md",
    "chars": 4781,
    "preview": "# CDC (Content-Defined Chunking) 实现文档\n\n## 一、核心原理\n\n### 传统固定分片的问题\n\n传统 VCS 使用**固定大小分片**,存在严重缺陷:\n\n```\n文件版本 1: [AAAAA][BBBBB]"
  },
  {
    "path": "docs/config.md",
    "chars": 6774,
    "preview": "# HugeSCM 配置文件说明\n\n本文档详细说明 HugeSCM 支持的配置项和环境变量。\n\n## 一、配置层级\n\nHugeSCM 的配置系统支持三个层级(优先级从低到高):\n\n| 层级 | 位置 | 说明 |\n|------|-----"
  },
  {
    "path": "docs/design.md",
    "chars": 5375,
    "preview": "# HugeSCM 的设计哲学\n\n## 一、版本控制系统的演进与挑战\n\n### 1.1 传统版本控制系统的局限性\n\n在软件开发的长河中,版本控制系统(VCS)经历了从集中式到分布式的演进。Subversion 作为集中式版本控制的代表,采用"
  },
  {
    "path": "docs/hot.md",
    "chars": 4163,
    "preview": "# hot - Git 存储库维护工具\n\n`hot` 是整合到 HugeSCM 中的 Git 存储库维护工具,专用于存储库治理和优化。它帮助开发者高效地清理、维护和迁移 Git 存储库。\n\n---\n\n## 为什么需要 hot?\n\nGit 存"
  },
  {
    "path": "docs/object-format.md",
    "chars": 19596,
    "preview": "# HugeSCM 对象格式与存储规范\n\n## 一、前言\n### 1.1 术语和定义\n元数据(Metadata):提交(commit),以及目录(tree),切片(fragments)。\n\n元数据数据库:由分布式关系型数据库存储版本控制系统"
  },
  {
    "path": "docs/pack-format.md",
    "chars": 1711,
    "preview": "# HugeSCM 打包文件格式\n\n当我们实现了 HugeSCM 的基本功能之后,我们也逐渐考虑到应当实现对象打包机制,从而减少打开的文件数量,从而提高各种操作的效率。在借鉴了 git 的打包格式之后,结合 HugeSCM 自身的特性,我们"
  },
  {
    "path": "docs/protocol.md",
    "chars": 15535,
    "preview": "# HugeSCM 传输协议规范\n\n## 一、协议约定\n早期在我们设计 HugeSCM 传输协议时,我们对 HugeSCM 的设计存在认识不足,没有充分考虑到实际需求,此外,在 HugeSCM 的推广过程,我们也发现 HugeSCM 需要引"
  },
  {
    "path": "docs/pull-strategy.md",
    "chars": 3956,
    "preview": "# HugeSCM Pull 不同策略说明\n\n在 HugeSCM 中,我们引入了与 git pull 相匹配的策略,如下:\n\n1. **merge** - 合并策略(默认)\n2. **rebase** - 变基策略\n3. **fast-fo"
  },
  {
    "path": "docs/sparse-checkout.md",
    "chars": 5299,
    "preview": "# HugeSCM 稀疏检出\n\n稀疏检出(Sparse Checkout)允许用户只检出存储库中的部分目录,而非完整的工作区。这对于巨型存储库特别有用,可以显著减少本地存储空间和检出时间。\n\n## 一、概述\n\n### 1.1 什么是稀疏检出"
  },
  {
    "path": "docs/stash.md",
    "chars": 6024,
    "preview": "# Stash - 暂存工作区修改\n\n`zeta stash` 命令用于暂存工作区和索引的修改,以便在不提交的情况下切换分支或执行其他操作。这对于需要临时保存工作进度的场景非常有用。\n\n## 一、基本概念\n\n### 1.1 什么是 Stas"
  },
  {
    "path": "docs/switch.md",
    "chars": 4023,
    "preview": "# Switch - 切换分支和提交\n\n`zeta switch` 命令用于切换工作区到不同的分支或提交。与 Git 的 `git switch` / `git checkout` 类似,但针对 HugeSCM 的集中式架构进行了优化。\n\n"
  },
  {
    "path": "docs/version-negotiation.md",
    "chars": 5832,
    "preview": "# 版本协商备忘录\n\n本文档描述 HugeSCM 的版本协商机制,包括分支基线、检出、拉取、合并和推送等核心操作的流程。\n\n## 一、分支基线\n\n### 1.1 基线概念\n\n在 HugeSCM 客户端,我们存在一个**分支基线(Baseli"
  },
  {
    "path": "docs/zeta.toml",
    "chars": 252,
    "preview": "[core]\nremote = \"https://zeta.example.io/group/mono-zeta\"\n# https://git-scm.com/docs/sparse-index\nsparse-checkout = [\"de"
  },
  {
    "path": "docs/zeta.toml.example",
    "chars": 1131,
    "preview": "# Zeta Configuration Example for AI Model Storage\n\n[core]\nremote = \"https://zeta.io/your-group/your-repo\"\ncompression-al"
  },
  {
    "path": "go.mod",
    "chars": 2760,
    "preview": "module github.com/antgroup/hugescm\n\ngo 1.26\n\nrequire (\n\tcharm.land/bubbles/v2 v2.1.0\n\tcharm.land/bubbletea/v2 v2.0.6\n\tch"
  },
  {
    "path": "go.sum",
    "chars": 14086,
    "preview": "charm.land/bubbles/v2 v2.1.0 h1:YSnNh5cPYlYjPxRrzs5VEn3vwhtEn3jVGRBT3M7/I0g=\ncharm.land/bubbles/v2 v2.1.0/go.mod h1:l97h"
  },
  {
    "path": "modules/README.md",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "modules/base58/LICENSE",
    "chars": 812,
    "preview": "ISC License\n\nCopyright (c) 2013-2017 The btcsuite developers\nCopyright (c) 2016-2017 The Lightning Network Developers\n\nP"
  },
  {
    "path": "modules/base58/README.md",
    "chars": 1503,
    "preview": "base58\n==========\n\n[![Build Status](http://img.shields.io/travis/btcsuite/btcutil.svg)](https://travis-ci.org/btcsuite/b"
  },
  {
    "path": "modules/base58/alphabet.go",
    "chars": 1646,
    "preview": "// Copyright (c) 2015 The btcsuite developers\n// Use of this source code is governed by an ISC\n// license that can be fo"
  },
  {
    "path": "modules/base58/base58.go",
    "chars": 3371,
    "preview": "// Copyright (c) 2013-2015 The btcsuite developers\n// Use of this source code is governed by an ISC\n// license that can "
  },
  {
    "path": "modules/base58/base58_test.go",
    "chars": 3353,
    "preview": "// Copyright (c) 2013-2017 The btcsuite developers\n// Use of this source code is governed by an ISC\n// license that can "
  },
  {
    "path": "modules/base58/base58bench_test.go",
    "chars": 949,
    "preview": "// Copyright (c) 2013-2014 The btcsuite developers\n// Use of this source code is governed by an ISC\n// license that can "
  },
  {
    "path": "modules/base58/base58check.go",
    "chars": 1506,
    "preview": "// Copyright (c) 2013-2014 The btcsuite developers\n// Use of this source code is governed by an ISC\n// license that can "
  },
  {
    "path": "modules/base58/base58check_test.go",
    "chars": 2120,
    "preview": "// Copyright (c) 2013-2014 The btcsuite developers\n// Use of this source code is governed by an ISC\n// license that can "
  },
  {
    "path": "modules/base58/cov_report.sh",
    "chars": 512,
    "preview": "#!/bin/sh\n\n# This script uses gocov to generate a test coverage report.\n# The gocov tool my be obtained with the followi"
  },
  {
    "path": "modules/base58/doc.go",
    "chars": 1264,
    "preview": "// Copyright (c) 2014 The btcsuite developers\n// Use of this source code is governed by an ISC\n// license that can be fo"
  },
  {
    "path": "modules/base58/example_test.go",
    "chars": 1789,
    "preview": "// Copyright (c) 2014 The btcsuite developers\n// Use of this source code is governed by an ISC\n// license that can be fo"
  },
  {
    "path": "modules/base58/genalphabet.go",
    "chars": 1475,
    "preview": "// Copyright (c) 2015 The btcsuite developers\n// Use of this source code is governed by an ISC\n// license that can be fo"
  },
  {
    "path": "modules/binary/read.go",
    "chars": 4344,
    "preview": "// Package binary implements syntax-sugar functions on top of the standard\n// library binary package\npackage binary\n\nimp"
  },
  {
    "path": "modules/binary/write.go",
    "chars": 1470,
    "preview": "package binary\n\nimport (\n\t\"encoding/binary\"\n\t\"io\"\n)\n\nfunc Swap16(v uint16) []byte {\n\tbs := make([]byte, 2)\n\tbinary.BigEn"
  },
  {
    "path": "modules/bitmap/LICENSE",
    "chars": 1079,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2018 Miguel Molina\n\nPermission is hereby granted, free of charge, to any person obt"
  },
  {
    "path": "modules/bitmap/bitmap.go",
    "chars": 8088,
    "preview": "package bitmap\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n)\n\n// Bitmap is an EWAH-encoded bitm"
  },
  {
    "path": "modules/bitmap/bitmap_test.go",
    "chars": 8643,
    "preview": "//go:build !386\n\npackage bitmap\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"strcon"
  },
  {
    "path": "modules/chardet/2022.go",
    "chars": 2277,
    "preview": "package chardet\n\nimport (\n\t\"bytes\"\n)\n\ntype recognizer2022 struct {\n\tcharset string\n\tescapes [][]byte\n}\n\nfunc (r *recogni"
  },
  {
    "path": "modules/chardet/LICENSE",
    "chars": 1173,
    "preview": "Copyright (c) 2012 chardet Authors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis"
  },
  {
    "path": "modules/chardet/VERSION",
    "chars": 77,
    "preview": "https://github.com/saintfish/chardet\n5e3ef4b5456d970814525f09c1f176294f1751a9"
  },
  {
    "path": "modules/chardet/detector.go",
    "chars": 3950,
    "preview": "// Package chardet ports character set detection from ICU.\npackage chardet\n\nimport (\n\t\"errors\"\n\t\"sort\"\n)\n\n// Result cont"
  },
  {
    "path": "modules/chardet/encoding.go",
    "chars": 2678,
    "preview": "package chardet\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\t\"golang.org/x/text/encoding\"\n\t\"golang.org/x/text/encoding/charmap\"\n\t"
  },
  {
    "path": "modules/chardet/icu-license.html",
    "chars": 1980,
    "preview": "<html>\n\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\"></meta>\n<title>ICU License - ICU 1."
  },
  {
    "path": "modules/chardet/multi_byte.go",
    "chars": 9572,
    "preview": "package chardet\n\nimport (\n\t\"errors\"\n\t\"math\"\n)\n\ntype recognizerMultiByte struct {\n\tcharset     string\n\tlanguage    string"
  },
  {
    "path": "modules/chardet/recognizer.go",
    "chars": 1583,
    "preview": "package chardet\n\ntype recognizer interface {\n\tMatch(*recognizerInput) recognizerOutput\n}\n\ntype recognizerOutput Result\n\n"
  },
  {
    "path": "modules/chardet/single_byte.go",
    "chars": 45928,
    "preview": "package chardet\n\n// Recognizer for single byte charset family\ntype recognizerSingleByte struct {\n\tcharset          strin"
  },
  {
    "path": "modules/chardet/unicode.go",
    "chars": 2290,
    "preview": "package chardet\n\nimport (\n\t\"bytes\"\n)\n\nvar (\n\tutf16beBom = []byte{0xFE, 0xFF}\n\tutf16leBom = []byte{0xFF, 0xFE}\n\tutf32beBo"
  },
  {
    "path": "modules/chardet/utf8.go",
    "chars": 1373,
    "preview": "package chardet\n\nimport (\n\t\"bytes\"\n)\n\nvar utf8Bom = []byte{0xEF, 0xBB, 0xBF}\n\ntype recognizerUtf8 struct {\n}\n\nfunc newRe"
  },
  {
    "path": "modules/command/command.go",
    "chars": 5390,
    "preview": "package command\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n)\n\n"
  },
  {
    "path": "modules/command/shepherd.go",
    "chars": 2564,
    "preview": "package command\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"os/exec\"\n\t\"sync/atomic\"\n\n\t\"github.com/antgroup/hugescm/modules/env\"\n)\n\ntype"
  },
  {
    "path": "modules/command/shepherd_linux.go",
    "chars": 532,
    "preview": "//go:build linux\n\npackage command\n\nimport (\n\t\"os/exec\"\n\t\"syscall\"\n)\n\nfunc setSysProcAttribute(c *exec.Cmd, detached bool"
  },
  {
    "path": "modules/command/shepherd_test.go",
    "chars": 2281,
    "preview": "package command\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestNewCommand(t *testing.T) {\n\t"
  },
  {
    "path": "modules/command/shepherd_unix.go",
    "chars": 469,
    "preview": "//go:build !windows && !linux\n\npackage command\n\nimport (\n\t\"os/exec\"\n\t\"syscall\"\n)\n\nfunc setSysProcAttribute(c *exec.Cmd, "
  },
  {
    "path": "modules/command/shepherd_win.go",
    "chars": 231,
    "preview": "//go:build windows\n\npackage command\n\nimport \"os/exec\"\n\nfunc setSysProcAttribute(c *exec.Cmd, detached bool) {\n\t// placeh"
  },
  {
    "path": "modules/command/util.go",
    "chars": 560,
    "preview": "package command\n\nimport (\n\t\"errors\"\n\t\"os/exec\"\n\n\t\"github.com/antgroup/hugescm/modules/strengthen\"\n)\n\nconst (\n\tNoDir = \"\""
  },
  {
    "path": "modules/crc/reader.go",
    "chars": 1336,
    "preview": "package crc\n\nimport (\n\t\"bufio\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash\"\n\t\"hash/crc64\"\n\t\"io\"\n\t\"strings\"\n)\n\ntype Crc64Writ"
  },
  {
    "path": "modules/deflect/az.go",
    "chars": 2291,
    "preview": "package deflect\n\nimport (\n\t\"slices\"\n\n\t\"github.com/antgroup/hugescm/modules/git\"\n\t\"github.com/antgroup/hugescm/modules/st"
  },
  {
    "path": "modules/deflect/deflect.go",
    "chars": 4678,
    "preview": "package deflect\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/antgroup/hugescm/modules/git\"\n\t\"github.com/antgroup/hugescm/modules"
  },
  {
    "path": "modules/deflect/deflect_test.go",
    "chars": 7625,
    "preview": "package deflect_test\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"github.com/antgroup/hugescm/module"
  },
  {
    "path": "modules/deflect/du.go",
    "chars": 4134,
    "preview": "package deflect\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\nconst (\n\t// ENV_GIT_QUARANTINE_PATH is the environment va"
  },
  {
    "path": "modules/deflect/pack.go",
    "chars": 6218,
    "preview": "package deflect\n\n// We only support Git pack index file version 2 (SHA1/SHA256)\n// Reference: https://forcemz.net/git/20"
  },
  {
    "path": "modules/deflect/struct.go",
    "chars": 1648,
    "preview": "package deflect\n\n// object32 represents an object in pack files with 32-bit offsets (< 4GB)\n// The offset and index are "
  },
  {
    "path": "modules/diferenco/MERGE_PARALLEL.md",
    "chars": 4491,
    "preview": "# MergeParallel 实现文档\n\n> **本实现由 GLM-5 (智谱 AI) 生成**\n>\n> MergeParallel 和 HasConflictParallel 是基于 Diff3 论文的三路合并实现,\n> 由 GLM-5"
  },
  {
    "path": "modules/diferenco/README.md",
    "chars": 17768,
    "preview": "# Diferenco - Advanced Diff Algorithms\n\n[![Go Version](https://img.shields.io/badge/Go-1.22+-00ADD8?style=flat&logo=go)]"
  },
  {
    "path": "modules/diferenco/algorithms_bench_test.go",
    "chars": 14173,
    "preview": "package diferenco\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strings\"\n\t\"testing\"\n)\n\n// Benchmark helpers to generate tes"
  },
  {
    "path": "modules/diferenco/color/color.go",
    "chars": 4670,
    "preview": "package color\n\n// TODO read colors from a github.com/go-git/go-git/plumbing/format/config.Config struct\n// TODO implemen"
  },
  {
    "path": "modules/diferenco/diferenco.go",
    "chars": 6323,
    "preview": "package diferenco\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"slices\"\n\t\"strings\"\n)\n\n// https://github.com/Wilfred/diff"
  },
  {
    "path": "modules/diferenco/diferenco_test.go",
    "chars": 7916,
    "preview": "package diferenco\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/antgroup/hugescm/m"
  },
  {
    "path": "modules/diferenco/gen_unicode.go",
    "chars": 4495,
    "preview": "//go:build ignore\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\""
  },
  {
    "path": "modules/diferenco/histogram.go",
    "chars": 4882,
    "preview": "// Refer to https://github.com/pascalkuthe/imara-diff reimplemented in Golang.\npackage diferenco\n\nimport \"context\"\n\n// h"
  },
  {
    "path": "modules/diferenco/histogram_test.go",
    "chars": 6951,
    "preview": "package diferenco\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"github.com/antgroup/hugescm/modules/d"
  },
  {
    "path": "modules/diferenco/lcs/LICENSE",
    "chars": 1479,
    "preview": "Copyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or with"
  },
  {
    "path": "modules/diferenco/lcs/common.go",
    "chars": 4694,
    "preview": "// Copyright 2022 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "modules/diferenco/lcs/common_test.go",
    "chars": 3930,
    "preview": "// Copyright 2022 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "modules/diferenco/lcs/doc.go",
    "chars": 11329,
    "preview": "// Copyright 2022 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "modules/diferenco/lcs/git.sh",
    "chars": 928,
    "preview": "#!/bin/bash\n#\n# Copyright 2022 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style"
  },
  {
    "path": "modules/diferenco/lcs/labels.go",
    "chars": 1102,
    "preview": "// Copyright 2022 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "modules/diferenco/lcs/old.go",
    "chars": 13192,
    "preview": "// Copyright 2022 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "modules/diferenco/lcs/old_test.go",
    "chars": 7915,
    "preview": "// Copyright 2022 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "modules/diferenco/lcs/sequence.go",
    "chars": 3783,
    "preview": "// Copyright 2022 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "modules/diferenco/merge.go",
    "chars": 12425,
    "preview": "/*\nCopyright (c) 2024 epic labs\nPackage diff3 implements a three-way merge algorithm\nOriginal version in Javascript by B"
  },
  {
    "path": "modules/diferenco/merge_parallel.go",
    "chars": 13050,
    "preview": "// Package diferenco provides diff and merge functionality.\n//\n// This file (merge_parallel.go) contains the MergeParall"
  },
  {
    "path": "modules/diferenco/merge_parallel_bench_test.go",
    "chars": 10407,
    "preview": "package diferenco\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n\n// Helper functions for benchmark test"
  },
  {
    "path": "modules/diferenco/merge_parallel_test.go",
    "chars": 34287,
    "preview": "// Package diferenco provides diff and merge functionality.\n//\n// This file (merge_new_test.go) contains comprehensive t"
  },
  {
    "path": "modules/diferenco/merge_test.go",
    "chars": 16375,
    "preview": "package diferenco\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestMerge(t *testing.T) {\n\tconst textO = `celery\n"
  },
  {
    "path": "modules/diferenco/minimal.go",
    "chars": 561,
    "preview": "package diferenco\n\nimport (\n\t\"context\"\n\n\t\"github.com/antgroup/hugescm/modules/diferenco/lcs\"\n)\n\n// minimal: Myers: An O("
  },
  {
    "path": "modules/diferenco/minimal_test.go",
    "chars": 968,
    "preview": "package diferenco\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"github.com/antgroup/hugescm/modules/d"
  },
  {
    "path": "modules/diferenco/myers.go",
    "chars": 5845,
    "preview": "/*---------------------------------------------------------------------------------------------\n *  Copyright (c) Micros"
  },
  {
    "path": "modules/diferenco/myers_bench_test.go",
    "chars": 3919,
    "preview": "package diferenco\n\nimport (\n\t\"context\"\n\t\"math/rand\"\n\t\"testing\"\n)\n\n// myersFast is a GPT implementation for comparison\nfu"
  },
  {
    "path": "modules/diferenco/myers_test.go",
    "chars": 2293,
    "preview": "package diferenco\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n)\n\nfunc TestMyersDiff(t *testing.T) {\n\t_"
  },
  {
    "path": "modules/diferenco/onp.go",
    "chars": 2992,
    "preview": "//\tCopyright (c) 2014-2021 Akinori Hattori <hattya@gmail.com>\n//\n//\tSPDX-License-Identifier: MIT\n//\n//\tSOURCE: https://g"
  },
  {
    "path": "modules/diferenco/onp_test.go",
    "chars": 1128,
    "preview": "package diferenco\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n)\n\nfunc TestONP(t *testing.T) {\n\t_, file"
  },
  {
    "path": "modules/diferenco/patience.go",
    "chars": 5243,
    "preview": "// MIT License\n\n// Copyright (c) 2022 Peter Evans\n\n// Permission is hereby granted, free of charge, to any person obtain"
  },
  {
    "path": "modules/diferenco/patience_bench_test.go",
    "chars": 8360,
    "preview": "package diferenco\n\nimport (\n\t\"context\"\n\t\"math/rand\"\n\t\"slices\"\n\t\"testing\"\n)\n\n// patienceLCSLegacy is the original O(n²) i"
  },
  {
    "path": "modules/diferenco/patience_test.go",
    "chars": 1142,
    "preview": "package diferenco\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n)\n\nfunc TestPatienceDiff(t *testing.T) {"
  },
  {
    "path": "modules/diferenco/regression_test.go",
    "chars": 1590,
    "preview": "package diferenco\n\nimport \"testing\"\n\nfunc TestPatchNameHandlesNilSides(t *testing.T) {\n\ttests := []struct {\n\t\tname strin"
  },
  {
    "path": "modules/diferenco/sink.go",
    "chars": 7119,
    "preview": "package diferenco\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\nconst (\n\tNEWLINE_RAW = iota\n\t"
  },
  {
    "path": "modules/diferenco/sink_test.go",
    "chars": 6648,
    "preview": "package diferenco\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestProcessLine(t *testing.T) {\n\ttext := `A\nB\nC\nD"
  },
  {
    "path": "modules/diferenco/suffixarray.go",
    "chars": 7377,
    "preview": "// Package diferenco provides diff algorithms.\n// Suffix-Array Diff implementation inspired by diff-match-patch.\npackage"
  },
  {
    "path": "modules/diferenco/suffixarray_test.go",
    "chars": 9890,
    "preview": "package diferenco\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n)\n\nfunc TestSuffixArrayDiff(t"
  },
  {
    "path": "modules/diferenco/testdata/a.txt",
    "chars": 336,
    "preview": "#include <stdio.h>\n\n// Frobs foo heartily\nint frobnitz(int foo)\n{\n    int i;\n    for(i = 0; i < 10; i++)\n    {\n        p"
  },
  {
    "path": "modules/diferenco/testdata/b.txt",
    "chars": 304,
    "preview": "#include <stdio.h>\n\nint fib(int n)\n{\n    if(n > 2)\n    {\n        return fib(n-1) + fib(n-2);\n    }\n    return 1;\n}\n\n// F"
  },
  {
    "path": "modules/diferenco/testdata/css_1.css",
    "chars": 161,
    "preview": "/* hello\nworld */\n.foo1 {\n  margin: 0 0 20px 0;\n}\n\n.bar {\n  margin: 0;\n}\n\n.baz {\n  color: yellow;\n  font-family: \"Before"
  },
  {
    "path": "modules/diferenco/testdata/css_2.css",
    "chars": 194,
    "preview": "/* hello\nworld */\n.bar {\n  margin: 0;\n}\n\n.foo1 {\n  margin: 0 0 20px 0;\n  color: green;\n}\n\n.baz {\n  color: blue;\n  font-f"
  },
  {
    "path": "modules/diferenco/testdata/simple_1.scss",
    "chars": 921,
    "preview": "@mixin buttons($basicBorder:1px, $gradient1:#fff, $gradient2:#d8dee7){\n  button{\n    border:$basicBorder solid #acbed3;\n"
  },
  {
    "path": "modules/diferenco/testdata/simple_2.scss",
    "chars": 923,
    "preview": "@mixin buttons($basicBorder:1px, $gradient1:#333, $gradient2:#d8dee7){\n  button{\n    border:$basicBorder dotted #acbed3;"
  },
  {
    "path": "modules/diferenco/text.go",
    "chars": 4798,
    "preview": "package diferenco\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"unsafe\"\n\n\t\"github.com/antgroup/hugescm/modules/"
  },
  {
    "path": "modules/diferenco/unicode.go",
    "chars": 855,
    "preview": "// Code generated by running \"go generate\". DO NOT EDIT.\n// See gen_unicode.go for generation logic.\n\npackage diferenco\n"
  },
  {
    "path": "modules/diferenco/unicode_data.go",
    "chars": 5815,
    "preview": "// Code generated by gen_unicode.go. DO NOT EDIT.\n\npackage diferenco\n\nvar cjkRanges = []interval{\n\t{0x1100, 0x115F},\n\t{0"
  },
  {
    "path": "modules/diferenco/unicode_test.go",
    "chars": 3816,
    "preview": "package diferenco\n\nimport (\n\t\"testing\"\n\t\"unicode\"\n)\n\nfunc TestIsCJK(t *testing.T) {\n\ttests := []struct {\n\t\tr      rune\n\t"
  },
  {
    "path": "modules/diferenco/unified.go",
    "chars": 6229,
    "preview": "// Copyright 2019 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "modules/diferenco/unified_encoder.go",
    "chars": 7088,
    "preview": "package diferenco\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/antgroup/hugescm/modules/diferenco/color\"\n)"
  },
  {
    "path": "modules/env/broker.go",
    "chars": 3450,
    "preview": "package env\n\nimport (\n\t\"os\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/antgroup/hugescm/mo"
  },
  {
    "path": "modules/env/builder.go",
    "chars": 195,
    "preview": "package env\n\ntype Builder interface {\n\tEnviron() []string\n}\n\ntype builder struct {\n}\n\nfunc (b *builder) Environ() []stri"
  },
  {
    "path": "modules/env/constant.go",
    "chars": 1544,
    "preview": "package env\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/antgroup/hugescm/modules/strengthen\"\n)\n\ntype K string\n\n/"
  },
  {
    "path": "modules/env/env.go",
    "chars": 2033,
    "preview": "package env\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\nfunc SanitizeEnv(keys ...string) []string {\n\texclude"
  },
  {
    "path": "modules/env/env_test.go",
    "chars": 550,
    "preview": "package env\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestEnviron(t *testing.T) {\n\tnow := time.Now()\n"
  },
  {
    "path": "modules/env/env_unix.go",
    "chars": 2217,
    "preview": "//go:build !windows\n\npackage env\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n\t\"sync\"\n)\n\nvar (\n\tallo"
  },
  {
    "path": "modules/env/env_windows.go",
    "chars": 3359,
    "preview": "//go:build windows\n\npackage env\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"golang.org/x"
  },
  {
    "path": "modules/env/env_windows_test.go",
    "chars": 496,
    "preview": "//go:build windows\n\npackage env\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestInitializeEnv(t *testing.T) {\n\t_ = os.Sete"
  },
  {
    "path": "modules/fnmatch/LICENSE",
    "chars": 1298,
    "preview": "Copyright (c) 2016, Daniel Wakefield\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or wi"
  }
]

// ... and 806 more files (download for full content)

About this extraction

This page contains the full source code of the antgroup/hugescm GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1006 files (4.6 MB), approximately 1.3M tokens, and a symbol index with 8556 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!