Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Git Debug Bundle

Git Debug Bundle Laravel Package

leek/git-debug-bundle

A Laravel package for Git-aware debugging that makes repository information available in your app, so you can quickly confirm the branch, commit, and code version you're running during development.

View on GitHub
Deep Wiki
Context7

Adds useful Git information to the Symfony2 Debug Toolbar

Frequently asked questions about Git Debug Bundle
Does leek/git-debug-bundle work with Laravel?
No, not as published. leek/git-debug-bundle is a Symfony2 bundle that hooks into AppKernel, Symfony's EventDispatcher, and the HttpKernel DataCollector contract; Laravel has no bundle layer or equivalent DataCollector contract, so it cannot be installed and used as a Laravel package without a port. The reusable part is the Git introspection logic, not the Symfony adapter.
Can I install leek/git-debug-bundle with Composer in a Laravel app?
You can add the Composer package, but it will not register itself or render into Laravel's debugbar. There is no Laravel service provider, config file, or php-debugbar collector in the package, so installation alone produces no toolbar output. For Laravel you need to build a small collector around the Git commands instead.
Is leek/git-debug-bundle maintained or safe to depend on?
The repository is archived and was last targeted at Symfony 2.x, which has been end-of-life since 2018. There are no dependents, no security response process, and no PHP 8.x compatibility work. Treat it as reference source for design ideas, not as a supported dependency.
How do I show the current Git branch and commit hash in Laravel Debugbar?
The practical route is a custom php-debugbar collector registered through barryvdh/laravel-debugbar's config array. The collector implements DataCollectorInterface methods such as getName, collect, and getWidgets, and in collect it reads branch, commit hash, tag, dirty flag, and remote URL. Use Symfony Process, already available transitively in Laravel, rather than shell_exec so you can handle timeouts and exit codes.
What Git information should a Laravel Git debug collector expose?
Useful fields are branch name, commit hash, tag or describe output, whether the working tree is dirty, remote URL, and ahead/behind counts. Keep the payload small and render it in the debugbar or a /version endpoint. Redact any credentials that may be embedded in remote URLs before displaying them.
Why does Git info fail to load inside Docker or CI-built images?
The original approach shells out to the git binary, which requires shell_exec or proc_open to be enabled and the web-server user to read the .git directory. Docker bind mounts and CI-built images often omit .git or trigger Git's dubious ownership check, producing works-on-my-machine failures. A better design reads a build-injected SHA from config when .git is absent.
How do I prevent Git branch and remote URL leaks in staging or production?
Hard-fail to a no-op when APP_DEBUG is false rather than relying on config discipline. Never render remote URLs without stripping embedded credentials, because legacy CI configs sometimes place tokens there. If staging is shared, decide explicitly whether branch names and commit metadata are allowed on screen at all.
What Laravel and PHP versions would a port need to target?
Laravel 10 through 12 run on PHP 8.2 and newer, and php-debugbar v2 changed collector signatures compared with earlier versions. Any port must pin a php-debugbar major version and assert the collector contract in tests. The original Symfony2-era type hints and signatures are incompatible with this stack.
Should I port leek/git-debug-bundle or rewrite the Git logic?
Rewrite the small Git introspection layer and borrow the field selection and edge-case handling from the archived source. Shimming a Symfony2 bundle into Laravel costs far more than a day's rewrite and creates permanent compatibility debt. Read the upstream code for an hour, then implement against php-debugbar's collector contract.
What are alternatives to a Git toolbar collector for release traceability?
A toolbar collector is only one slice; consider deployment provenance surfaced where engineers already look, such as Sentry or New Relic release tags, an X-App-Commit response header, and a /version endpoint. If the real need is release traceability, sequence the collector as part of that initiative. barryvdh/laravel-debugbar is the natural host for the toolbar piece.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle