mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-23 14:18:38 +01:00
Update list-branches.ps1 and list-commits.ps1
This commit is contained in:
parent
c1376ed2bb
commit
3485a5c4b8
@ -9,17 +9,18 @@
|
||||
param($RepoDir = "$PWD", $Pattern = "*")
|
||||
|
||||
try {
|
||||
write-output "Listing Git branches in repository $RepoDir ..."
|
||||
write-progress "Fetching changes in repository $RepoDir ..."
|
||||
|
||||
if (-not(test-path "$RepoDir")) { throw "Can't access Git repository at: $RepoDir" }
|
||||
if (-not(test-path "$RepoDir")) { throw "Can't access Git repository directory: $RepoDir" }
|
||||
set-location $RepoDir
|
||||
|
||||
$null = (git --version)
|
||||
& git --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
$null = (git fetch --all --recurse-submodules)
|
||||
& git fetch --all --recurse-submodules
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch --all --recurse-submodules' failed" }
|
||||
|
||||
write-output "List of Git branches in repository $($RepoDir):"
|
||||
$Branches = $(git branch --list --remotes --no-color --no-column)
|
||||
if ($lastExitCode -ne "0") { throw "'git branch --list' failed" }
|
||||
|
||||
|
@ -9,17 +9,18 @@
|
||||
param($RepoDir = "$PWD", $Format = "compact")
|
||||
|
||||
try {
|
||||
write-output "Listing commits of Git repository $RepoDir ..."
|
||||
write-progress "Fetching changes in Git repository $RepoDir ..."
|
||||
|
||||
if (-not(test-path "$RepoDir")) { throw "Can't access Git repository at: $RepoDir" }
|
||||
if (-not(test-path "$RepoDir")) { throw "Can't access Git repository directory: $RepoDir" }
|
||||
set-location $RepoDir
|
||||
|
||||
$null = (git --version)
|
||||
& git --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
$null = (git fetch --all --recurse-submodules)
|
||||
& git fetch --all --recurse-submodules
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch --all --recurse-submodules' failed" }
|
||||
|
||||
write-output "List of commits in Git repository $($RepoDir):"
|
||||
if ($Format -eq "compact") {
|
||||
& git log --graph --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %s %C(bold blue)by %an %cr%Creset' --abbrev-commit
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user