forked from shanselman/PowerShellHgGit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
995b29b
commit 071efe7
Showing
7 changed files
with
155 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
asasd |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?xml version="1.0" encoding="utf-16"?> | ||
<Configuration> | ||
<ViewDefinitions> | ||
<View> | ||
<Name>Dir-Git</Name> | ||
<ViewSelectedBy> | ||
<TypeName>Dir-Git</TypeName> | ||
</ViewSelectedBy> | ||
<TableControl> | ||
<TableHeaders> | ||
<TableColumnHeader> | ||
<Label>Mode</Label> | ||
<Width>5</Width> | ||
<Alignment>left</Alignment> | ||
</TableColumnHeader> | ||
<TableColumnHeader> | ||
<Label>Git</Label> | ||
<Width>4</Width> | ||
<Alignment>left</Alignment> | ||
</TableColumnHeader> | ||
<TableColumnHeader> | ||
<Label>LastWriteTime</Label> | ||
<Width>20</Width> | ||
<Alignment>right</Alignment> | ||
</TableColumnHeader> | ||
<TableColumnHeader> | ||
<Label>Length</Label> | ||
<Width>10</Width> | ||
<Alignment>right</Alignment> | ||
</TableColumnHeader> | ||
<TableColumnHeader/> | ||
</TableHeaders> | ||
<TableRowEntries> | ||
<TableRowEntry> | ||
<Wrap/> | ||
<TableColumnItems> | ||
<TableColumnItem> | ||
<PropertyName>Mode</PropertyName> | ||
</TableColumnItem> | ||
<TableColumnItem> | ||
<PropertyName>Git</PropertyName> | ||
</TableColumnItem> | ||
<TableColumnItem> | ||
<ScriptBlock> | ||
[String]::Format("{0,10} {1,8}", $_.LastWriteTime.ToString("d"), $_.LastWriteTime.ToString("t")) | ||
</ScriptBlock> | ||
</TableColumnItem> | ||
<TableColumnItem> | ||
<PropertyName>Length</PropertyName> | ||
</TableColumnItem> | ||
<TableColumnItem> | ||
<PropertyName>Name</PropertyName> | ||
</TableColumnItem> | ||
</TableColumnItems> | ||
</TableRowEntry> | ||
</TableRowEntries> | ||
</TableControl> | ||
</View> | ||
</ViewDefinitions> | ||
</Configuration> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Types> | ||
<Type> | ||
<Name>System.IO.FileInfo</Name> | ||
<Members> | ||
<ScriptProperty> | ||
<Name>Git</Name> | ||
<GetScriptBlock> | ||
$retVal = "" | ||
if ($GitStatus.Index.Added -contains $this.Name) { $retVal += "+" } ` | ||
elseif ($GitStatus.Index.Modified -contains $this.Name) { $retVal += "~" } ` | ||
elseif ($GitStatus.Index.Deleted -contains $this.Name) { $retVal += "-" } ` | ||
elseif ($GitStatus.Index.Unmerged -contains $this.Name) { $retVal += "!" } ` | ||
else { $retVal += " " } | ||
|
||
if ($GitStatus.Working.Added -contains $this.Name) { $retVal += "+" } ` | ||
elseif ($GitStatus.Working.Modified -contains $this.Name) { $retVal += "~" } ` | ||
elseif ($GitStatus.Working.Deleted -contains $this.Name) { $retVal += "-" } ` | ||
elseif ($GitStatus.Working.Unmerged -contains $this.Name) { $retVal += "!" } ` | ||
else { $retVal += " " } | ||
|
||
$retVal | ||
</GetScriptBlock> | ||
</ScriptProperty> | ||
</Members> | ||
</Type> | ||
<Type> | ||
<Name>System.IO.DirectoryInfo</Name> | ||
<Members> | ||
<ScriptProperty> | ||
<Name>Git</Name> | ||
<GetScriptBlock> | ||
"" | ||
</GetScriptBlock> | ||
</ScriptProperty> | ||
</Members> | ||
</Type> | ||
</Types> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@{ | ||
ModuleVersion="1.0.0.0" | ||
Author="Scott Hanselman" | ||
Description="Posh-GitDir" | ||
CompanyName="Hanselman and Friends" | ||
RequiredModules="Posh-Git" | ||
ScriptsToProcess="prompt.ps1" | ||
TypesToProcess="posh-gitdir.Types.ps1xml" | ||
FormatsToProcess="posh-gitdir.Format.ps1xml" | ||
ModuleToProcess="posh-gitdir.psm1" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
. ([ScriptBlock]::Create(" | ||
function Get-ChildItem { | ||
$([Management.Automation.ProxyCommand]::GetCmdletBindingAttribute((Get-Command Get-ChildItem -CommandType Cmdlet))) | ||
param( | ||
$([Management.Automation.ProxyCommand]::GetParamBlock((Get-Command Get-ChildItem -CommandType Cmdlet))) | ||
) | ||
process { | ||
Microsoft.PowerShell.Management\Get-ChildItem @psBoundParameters | | ||
ForEach-Object { | ||
`$null = `$_.pstypenames.Insert(0, 'Dir-Git') | ||
`$_ | ||
} | ||
} | ||
} | ||
")) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
$defaultPromptHash = "HEYStcKFSSj9jrfqnb9f+A==" | ||
|
||
$md5 = [Security.Cryptography.MD5]::Create() | ||
$thePrompt = [Text.Encoding]::Unicode.GetBytes((Get-Command prompt | Select-Object -ExpandProperty Definition)) | ||
$thePromptHash = [Convert]::ToBase64String($md5.ComputeHash($thePrompt)) | ||
|
||
if ($thePromptHash -eq $defaultPromptHash) #using the default prompt? | ||
{ | ||
#recommend our own | ||
function prompt(){ | ||
# Reset color, which can be messed up by Enable-GitColors | ||
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor | ||
|
||
Write-Host($pwd) -nonewline -foregroundcolor white | ||
|
||
Write-VcsStatus | ||
|
||
Write-Host "" | ||
return "$ " | ||
} | ||
} | ||
else { | ||
Write-Debug "Make sure your prompt includes a called to Write-VcsStatus!" | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
|
||
Hey, it's a readme | ||
Hey, it's a readme. | ||
|
||
poo. |