Skip to content

Commit 2abe9ea

Browse files
author
nejc
committed
feat: add repository information to check command
- Add repository information section showing local and upstream URLs - Display which repositories are being compared - Show local repository URL (origin remote) - Show upstream repository URL being tracked - Improve transparency and context for users - Better understanding of what repositories are involved in sync Enhanced output now shows: - Local repository URL (your project) - Upstream repository URL (source of updates) - Clear identification of what's being compared - Better context for decision making
1 parent 900eb7e commit 2abe9ea

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Console/Commands/UpstreamCheckCommand.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public function handle(): int
5151
}
5252

5353
$this->info('🔍 Checking for upstream updates...');
54+
55+
// Show repository information
56+
$this->showRepositoryInfo($git, $upstreamUrl);
57+
5458
$this->newLine();
5559

5660
try {
@@ -225,6 +229,24 @@ private function applyDefaultPreset(array $cfg): array
225229
return $cfg;
226230
}
227231

232+
private function showRepositoryInfo(VersionControl $git, string $upstreamUrl): void
233+
{
234+
try {
235+
// Get local repository URL
236+
$localUrl = $git->run(['remote', 'get-url', 'origin'], throw: false);
237+
if (!$localUrl) {
238+
$localUrl = 'Local repository (no origin remote)';
239+
}
240+
241+
$this->line('🏠 <comment>Repository Information:</comment>');
242+
$this->line(" Local: <info>$localUrl</info>");
243+
$this->line(" Upstream: <info>$upstreamUrl</info>");
244+
245+
} catch (Throwable) {
246+
// If we can't get repository info, just continue silently
247+
}
248+
}
249+
228250
private function showCommitDetails(VersionControl $git, string $localCommit, string $upstreamCommit): void
229251
{
230252
try {

0 commit comments

Comments
 (0)