File tree Expand file tree Collapse file tree 7 files changed +102
-1
lines changed
Expand file tree Collapse file tree 7 files changed +102
-1
lines changed Original file line number Diff line number Diff line change 1+ ## 0.2.7:
2+ * Adding support for git mv (#70 , thanks @ninmonkey !)
3+ ---
4+
15## 0.2.6:
26* Fixing git diff for binary files (#47 )
37---
Original file line number Diff line number Diff line change 1+ <#
2+ . Synopsis
3+ Git Move Extension
4+ . Description
5+ Outputs git mv as objects.
6+ . EXAMPLE
7+ git mv .\OldName.txt .\NewName.txt
8+ . EXAMPLE
9+ git mv .\OldName.txt .\NewName.txt --verbose
10+ #>
11+ [Management.Automation.Cmdlet (" Out" , " Git" )] # It's an extension for Out-Git
12+ [ValidatePattern (" ^git mv" )] # that is run when the switch -o is used.
13+ [OutputType ([IO.FileInfo ])]
14+ param ( )
15+
16+ begin {
17+ $moveLines = @ ()
18+ }
19+
20+ process {
21+ $moveLines += $gitOut
22+ }
23+
24+ end {
25+ if ($gitArgument -match ' --(?>n|dry-run)' ) {
26+ return $moveLines
27+ }
28+
29+ # Take all non-dashed arguments to git.
30+ $cmd , # The first is 'mv'
31+ $source , # The second is the source
32+ $dest , # The third is the detination.
33+ $null = # (ignore anything else)
34+ $gitArgument -notlike ' -*'
35+
36+ if (-not (Test-Path $dest )) { return $moveLines }
37+
38+ $destItem = Get-Item $dest - ErrorAction SilentlyContinue
39+ @ (if ($destItem -is [IO.DirectoryInfo ]) {
40+ $destItem = Get-Item (Join-Path $destItem $source )
41+ $destItem
42+ } elseif ($destItem ) {
43+ $destItem
44+ } else {
45+ return $moveLines
46+ }) |
47+ Add-Member NoteProperty Source (Join-Path $gitRoot $source ) - Force - PassThru |
48+ Add-Member NoteProperty Destination $destItem.FullName - Force - PassThru |
49+ Add-Member NoteProperty GitRoot $gitRoot - Force - PassThru |
50+ Add-Member NoteProperty GitCommand $gitCommand - Force - PassThru
51+ }
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ Get-UGitExtension is built using [Piecemeal](https://github.com/StartAutomating/
6767* git commit
6868* git diff
6969* git log
70+ * git mv
7071* git pull
7172* git push
7273* git reflog
Original file line number Diff line number Diff line change 1+ ## 0.2.7:
2+ * Adding support for git mv (#70 , thanks @ninmonkey !)
3+ ---
4+
15## 0.2.6:
26* Fixing git diff for binary files (#47 )
37---
Original file line number Diff line number Diff line change 1+
2+ Extensions/Git.Mv.UGit.Extension.ps1
3+ ------------------------------------
4+ ### Synopsis
5+ Git Move Extension
6+
7+ ---
8+ ### Description
9+
10+ Outputs git mv as objects.
11+
12+ ---
13+ ### Examples
14+ #### EXAMPLE 1
15+ ``` PowerShell
16+ git mv .\OldName.txt .\NewName.txt
17+ ```
18+
19+ #### EXAMPLE 2
20+ ``` PowerShell
21+ git mv .\OldName.txt .\NewName.txt --verbose
22+ ```
23+
24+ ---
25+ ### Outputs
26+ System.IO.FileInfo
27+
28+
29+ ---
30+ ### Syntax
31+ ``` PowerShell
32+ Extensions/Git.Mv.UGit.Extension.ps1 [<CommonParameters>]
33+ ```
34+ ---
35+
36+
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ Get-UGitExtension is built using [Piecemeal](https://github.com/StartAutomating/
6767* git commit
6868* git diff
6969* git log
70+ * git mv
7071* git pull
7172* git push
7273* git reflog
Original file line number Diff line number Diff line change 11@ {
2- ModuleVersion = ' 0.2.6 '
2+ ModuleVersion = ' 0.2.7 '
33 RootModule = ' ugit.psm1'
44 FormatsToProcess = ' ugit.format.ps1xml'
55 TypesToProcess = ' ugit.types.ps1xml'
@@ -16,6 +16,10 @@ PrivateData = @{
1616 ProjectURI = ' https://github.com/StartAutomating/ugit'
1717 LicenseURI = ' https://github.com/StartAutomating/ugit/blob/main/LICENSE'
1818 ReleaseNotes = @'
19+ ## 0.2.7:
20+ * Adding support for git mv (#70, thanks @ninmonkey !)
21+ ---
22+
1923## 0.2.6:
2024* Fixing git diff for binary files (#47)
2125---
You can’t perform that action at this time.
0 commit comments