-
-
Save kjerk/7550584 to your computer and use it in GitHub Desktop.
Powershell version for git-loglive with cmdlet binding for default params and documentation sytax so get-help works on the command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Git-Loglive() | |
{ | |
<# | |
.SYNOPSIS | |
Outputs git log information live. | |
.DESCRIPTION | |
Outputs log information in a loop with a specified polling rate. | |
.PARAMETER lines | |
The number of log lines to output. | |
.PARAMETER sleep | |
The poll rate of the log in seconds (decimals okay). | |
#> | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$false,Position=1)] | |
[string]$lines = 20, | |
[Parameter(Mandatory=$false,Position=2)] | |
[string]$sleep = 10 | |
) | |
while($true) | |
{ | |
cls | |
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all -$lines | |
sleep $sleep | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment