![]() ![]() Return Exec $command $args $echo $stopOnNonZeroExitCodeįunction Exec($exe, ]$arguments, $echo=$true, $stopOnNonZeroExitCode=$true) $fullmsg = $msg -replace '(?ms)^', $timestamp # the (?ms) enables multiline modeįunction ExecSimple($command, $echo=$true, $stopOnNonZeroExitCode=$true) $timestamp = "$(get-date -Format 'yyyy/MM/dd HH:mm:ss'): " # If (Test-Path $logFile) įunction Log($msg, $echo = $true) $scriptDir = Split-Path $script:MyInvocation.M圜ommand.Path From DOS ( cmd.exe): powershell gitr -help.Copy the script to C:\bin and add C:\bin to $PATH.It only has minimal testing with simple arguments. ![]() It was extracted from a larger commit script. It never removes the index.lock, assuming the user should intervene. Here is a PowerShell wrapper around Git named "gitr" that retries until index.lock disappears, using default five tries, three seconds between each. or even default to this when run manually. Perhaps 'git' itself should support a '-retriesWhenLocked 5' argument to support retries. For us, Sourcetree or Visual Studio appear to be be doing some maintenance in the background while we were are running large commit scripts. Each client should wait until the lock is released by the other party to be a good citizen. Multiple Git clients working on the same local repository compete for that lock. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |