# Git Repository Viewer TreeTrek is a free, read-only, open-source, dependency- and authentication-free PHP application for browsing raw Git repositories in either a self-hosted or shared host environment. It functions entirely through direct filesystem access without invoking system commands. ## Core Git Implementation The engine implements low-level Git protocols to navigate and extract data from the repository's internal storage structure. * **Object Resolution**: Resolves and reads commits, trees, blobs, and tags. * **Packfile Navigation**: Navigates .idx and .pack files using binary fanout searches for rapid object lookup. * **Reference Handling**: Resolves HEAD, branches, and tags, including support for the packed-refs format. * **Smart HTTP Protocol**: Implements the Git Smart HTTP protocol for read-only cloning via standard Git clients. ## Content and Visualization The user interface provides developer-focused tools for inspecting history and repository content. * **LCS Diff Engine**: Includes a Longest Common Subsequence (LCS) algorithm to display line-level changes. * **Syntax Highlighting**: Uses a regex-based engine with rules for common programming languages. * **Multimedia Rendering**: Detects media types to natively render images, video, and audio files in the browser. * **Breadcrumb Navigation**: Features a dynamic path trail and repository selector for seamless project switching. * **Streamed Content**: Streams object data in chunks to handle large files without exceeding memory limits. ## Curation and Architecture Project organization and system behavior are managed through flat-file configurations and an object-oriented design. This structure separates repository logic from the presentation layer. * **Repository Curation**: Uses an `order.txt` file to define the display sequence and visibility of projects. * **Project Exclusion**: Allows hiding specific repositories by prefixing their names with a hyphen in the `order.txt` config. * **Stateless Routing**: Maps clean URIs directly to specialized page controllers for consistent navigation.