Skip to content

Commit b84cea5

Browse files
authored
Merge branch 'master' into master
2 parents 3b5d5e6 + 5f0f058 commit b84cea5

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

src/aliases.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,19 @@ function gpoat {
260260
git push origin --all
261261
git push origin --tags
262262
}
263+
function gpr {
264+
git pull --rebase $args
265+
}
266+
function gpra {
267+
git pull --rebase --autostash $args
268+
}
263269
function gpristine {
264270
git reset --hard
265271
git clean -dfx
266272
}
273+
function gprv {
274+
git pull --rebase -v $args
275+
}
267276
function gpu {
268277
git push upstream $args
269278
}
@@ -402,12 +411,15 @@ function gunwip {
402411
git reset HEAD~1
403412
}
404413
function gup {
414+
Write-Host-Deprecated "gup" "gpr"
405415
git pull --rebase $args
406416
}
407417
function gupa {
418+
Write-Host-Deprecated "gupa" "gpra"
408419
git pull --rebase --autostash $args
409420
}
410421
function gupv {
422+
Write-Host-Deprecated "gupv" "gprv"
411423
git pull --rebase -v $args
412424
}
413425
function glum {

src/git-aliases.psm1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ $FunctionsToExport = @(
8080
'gpf',
8181
'gpf!',
8282
'gpoat',
83+
'gpr',
84+
'gpra',
8385
'gpristine',
86+
'gprv',
8487
'gpu',
8588
'gpv',
8689
'gr',

src/utils.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,26 @@ function Get-Git-Aliases ([string] $Alias) {
133133

134134
return Format-Table -InputObject $aliases -AutoSize -Wrap -Property $cols
135135
}
136+
137+
<#
138+
.SYNOPSIS
139+
Print deprecated message.
140+
.DESCRIPTION
141+
Print a colored message telling that a specific alias ($previous)
142+
is deprecated, suggesting the use of another alias ($next).
143+
.EXAMPLE
144+
PS C:\> Write-Host-Deprecated "gup" "gpr"
145+
[git-aliases] gup is a deprecated alias, use "gpr" instead.
146+
#>
147+
function Write-Host-Deprecated {
148+
param (
149+
[Parameter(Mandatory = $true)][string] $previous,
150+
[Parameter(Mandatory = $true)][string] $next
151+
)
152+
153+
Write-Host "[git-aliases] " -ForegroundColor Yellow -NoNewLine
154+
Write-Host "${previous}" -ForegroundColor Red -NoNewLine
155+
Write-Host " is a deprecated alias, use " -ForegroundColor Yellow -NoNewLine
156+
Write-Host """${next}""" -ForegroundColor Green -NoNewLine
157+
Write-Host " instead.`n" -ForegroundColor Yellow
158+
}

0 commit comments

Comments
 (0)