Coder Social home page Coder Social logo

dahlbyk / posh-git Goto Github PK

View Code? Open in Web Editor NEW
7.4K 183.0 795.0 2.89 MB

A PowerShell environment for Git

Home Page: http://dahlbyk.github.io/posh-git/

License: MIT License

PowerShell 100.00%
powershell powershell-profile powershell-gallery git profile-script psgallery chocolatey prompt powershell-module powershell-profile-script

posh-git's People

Contributors

alanstevens avatar bergmeister avatar breisfeld avatar cmarcusreid avatar coridrew avatar csc027 avatar dahlbyk avatar dannoe avatar dscho avatar eamodio avatar exe-boss avatar ferventcoder avatar haroldalmon avatar jeremyskinner avatar lukebakken avatar lzybkr avatar markembling avatar mikesigs avatar paulmarsy avatar ra0to avatar rdnlsmith avatar rkeithhill avatar rkeithhill-keysight avatar seamlessintegrations avatar skeept avatar theaquamarine avatar thesned avatar tomone avatar viceice avatar vorou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

posh-git's Issues

Completion of submodule subcommands does not work

When I type git sub<TAB>, the completion works as expected: the fragment is expanded to git submodule. When I type git sub<TAB> up<TAB>, the completion does not work.

I've also noticed that git ls-f<TAB> is also not completed as expected (git ls-files).

Index status vs working directory status colours

From the readme: "As in git status, index status is dark red and working directory status is dark green".

Isn't it the other way round? I've started to use posh-git for the first time, and have got confused by the index status colour vs the working directory status colour. Seems to me that index is green and w-d is red.

Install in 'Program Files' dir fails

I installed posh-git to c:\Program Files\posh-git and when i restarted powershell this is what I got...

The term 'C:\Program' is not recognized as the name of a
spelling of the name, or if a path was included, verify t
At C:\Users\xxxx\Documents\WindowsPowerShell\

  • . <<<< C:\Program Files\posh-git\profile.example.ps1
    • CategoryInfo : ObjectNotFound: (C:\Program
    • FullyQualifiedErrorId : CommandNotFoundException

Error when installing posh git

For some unexpected reasons module was not installed.
At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\PsGet\PsGet.psm1:823 char:18
+             throw <<<<  "For some unexpected reasons module was not installed."
    + CategoryInfo          : OperationStopped: (For some unexpe... not installed.:String) [], RuntimeException
    + FullyQualifiedErrorId : For some unexpected reasons module was not installed.

Exception calling "GetDirectoryName" with "1" argument(s): "The path is not of a legal form."
At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\PsGet\PsGet.psm1:171 char:67
+         $TempModuleFolderPath = [System.IO.Path]::GetDirectoryName <<<< ($ModulePath)
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

You cannot call a method on a null-valued expression.
At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\PsGet\PsGet.psm1:629 char:47
+     $destination.Copyhere($PSGET_ZIPFile.items <<<< ())
    + CategoryInfo          : InvalidOperation: (items:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\PsGet\PsGet.psm1:624 char:29
+     if ($PSGET_ZIPFile.items <<<< () | Where-Object { $_.Path -eq $ContentTypesXmlPath }) {
    + CategoryInfo          : InvalidOperation: (items:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\PsGet\PsGet.psm1:623 char:43
+     $ContentTypesXmlPath = Join-Path -Path <<<<  $PSGET_ZIPFile.Self.Path -ChildPath '[Content_Types].xml'
    + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Very Slow prompt return

It takes several seconds for the branch and change stuff to show up.
Is this a core thing in posh-git.

I'd love to understand more about the implementation of how the information is gathered from the repo.

possible issue with 1.7.7.1 msysgit

tried installing msysgit 1.7.7.1 and git stopped working. not sure if this is a posh-git thing or a git thing. but should probably be looked at.

posh git + pscx = broken shell

There seems to be some sort of compatibility problem between posh git and PSCX. Loading both modules at once causes incorrect format for 'help' command output (all lines end with <- [m), tab completion for parameter names on many cmdlets no longer works, and tab completion becomes really slow.

Looks for .ssh folder in wrong location?

(I'm posting this here, because GitHub said I should - I encountered this issue when launching the console from the GitHub for Windows app)

I (used to) use MsysGit, which looks in %HOME% for the .ssh folder. posh-git looks in %HOMEPATH%. This leads to two different .ssh folders.

Could posh-git be changed, so it looks for the .ssh-folder in %HOME% if this variable is present and falls back to %HOMEPATH% if it isn't? That way the transition from MsysGit to posh-git (or the use of both) would be a lot easier.

$lastexitcode lost

This is not really a posh-git issue, but more general to overriding the prompt function in powershell. Have you notice that running your custom prompt will clear $lastexitcode?

Create a script named "fail.ps1" that simple calls "exit 123". Run it and you'll see $? is false while $lastexitcode is 0. $lastexitcode should be 123. Run powershell without running your profile first, then run fail.ps1, and indeed $lastexitcode is 123.

I also posted this on SO, but thought you may be interested. Maybe you have some ideas?

http://stackoverflow.com/questions/6014042/custom-powershell-prompt-is-clearing-lastexitcode

Update default color scheme

Dark red color is barely visible on the dark blue background of the PowerShell window :(

C:\Projects\SiteSDK [master +0 ~1 -0]>

"flashplayerplugin" Displaying at prompt

I'm getting some very strange behavior on my machine that I'm worried might be due to malware, but I want to eliminate post-git as a possible source first.

Do you guys have any idea where the string "flashplayerplugin" could be injected as to cause this error? It only happens in directories that are git repos. I'm running a full system check now, but wanted to get this in a public space just in case posh-git itself was the cause.

flashplayerpluginWindows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

Cannot index into a null array.
At C:\Users\jkodroff\Code\posh-git\CheckVersion.ps1:11 char:34
+     $version = [Version]$Matches[ <<<< 'ver']
    + CategoryInfo          : InvalidOperation: (ver:String) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

WARNING: posh-git requires Git 1.7.2 or better. You have .
C:\Users\jkodroff\Code\rms [flashplayerplugincod-only flashplayerplugin +4 ~6 -1 !]>

Tab completion does not work if PowerTab module is loaded

C:\Users\aaronlev\chrome\chrome0\src [tab_states]> import-module PowerTab
PowerTab version 0.99.6.0 PowerShell TabExpansion Library
Host: ConsoleHost
PowerTab Enabled: True
C:\Users\aaronlev\chrome\chrome0\src [tab_states]> git branch ## Shows popup with list of files for autocomplete

C:\Users\aaronlev\chrome\chrome0\src [tab_states]> remove-module PowerTab
C:\Users\aaronlev\chrome\chrome0\src [tab_states]> git branch ## Cycles through branches

If there's a configuration option I'm missing, it wasn't clear to me -- search engines couldn't find me the answer either.

Broken stash apply

When using posh-git and trying to apply my stash, the following command
git stash apply --index 0 or git stash apply stash@{0}

Both give the error:
fatal: ambiguous argument '0': unknown revision or path not in the working tree. Use '--' to separate paths from revisions

Using the default Git bash works. What am I doing wrong?

Calls to git fail when in a UNC-specified directory

If I cd into the location of a git repo via UNC (like //server/share/dir/subdir) then any git commands fail like so:

Microsoft.PowerShell.Core\FileSystem::\\groups\data\ctrhs\crn\ccrc\oncologynurse\programming\programs [(master)]> git status
'\\groups\data\ctrhs\crn\ccrc\oncologynurse\programming\programs'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
fatal: Not a git repository (or any of the parent directories): .git

Does that indicate bad config on my end? If so, how can I fix? If not--is it something you can fix? The msysgit bash command prompt doesn't have this problem.

Many thanks!

Distinguish git-svn repos

I'll often jump into a git repo and forget whether it's pushing to other git repositories or an svn repo. It throws me off for a few seconds when I see 'origin is not a repository'.

It would be nice if git-svn repositories had some type of distinguisher. Maybe [svn:master] or different color set.

Better README

The introduction/README on the site should include a description of what the colors/text in the command prompt mean. A beginner's guide. This doesn't have to be long, but SOMETHING on the site explaining the project would be nice.

Repo Status in Submodule

Currently we show "(unknown)" when the current directory is within a submodule. Should display part of the submodule SHA instead (like bash).

Posh-git is too slow

I installed GitHub for Windows, which include posh-git. When I use the included GitHub Powershell link, it loads posh-git.

Just loading the posh-git part in a new Powershell window is very slow, taking 8 seconds. Pressing the "enter" key on an empty line takes 3 seconds to show a new prompt.

Here's a video (needs Flash, no audio):
https://www.Scolab.com/Public/Jing/VideoPlayer/Jing.aspx?filename=../CM/slowposhgit2012-06-01_1507.mp4&width=1224&height=672

The machine is quite fast (Intel i7 laptop, dual-core with SSD hard disk). The project weight 726 MB and has 2500 folders and 16300 files, excluding the ".git" folder.

I can live with the slow loading, but not with the wait. Could it disable itself or limit itself if it detects that it's taking more than 500ms to show?

Thanks a lot,
Carl

Add a Stop-SshAgent cmdlet

Posh-Git includes a Start-SshAgent cmdlet, but no corresponding Stop-SshAgent command.

Why would I need one? Well occasionally it seems SSH Agent gets in a state where it's running, but it's not supplying my credentials. So I end up having to supply my pass phrase.

I end up wanting to restart the agent, but I have to go into task manager and kill the process and then run the Start-SshAgent command.

I'd prefer to be able to run Stop-SshAgent and then start it again. Or perhaps even have a Restart-SshAgent command. :)

Can haz websight?

http://dahlbyk.github.com/posh-git/

This here project has long since outgrown a readme. Stuff that needs to be documented:

  • What the prompt means (readme may be good enough)
  • Why the prompt might be slow (sigh) and workarounds
  • $GitPromptSettings Colors/Delimiters
  • $GitPromptSettings Behaviors: Debug, EnableFileStatus, RepositoriesInWhichToDisableFileStatus, etc
  • Supported tab expansions
  • $GitTabSettings
  • ssh-agent Helpers
  • Update-AllBranches

What else?

Issue with tab expansion and non-English file names

Repro steps:

  1. touch 慣用音.txt
  2. git add {tab}

Expected: it expands the filename.
Actual: it expands to:

git add "\346\205\243\347\224\250\351\237\263.txt"

That wouldn't be a problem except it doesn't work.

  1. git config core.quotepath true
  2. git add {tab}

Result:

posh-git does not generate the informational prompt on Win8 Release Preview

On Win8 Consumer Preview, posh-git embedded the git status information into the PowerShell prompt without a problem. On the latest build of Win8 Release Preview, I am no longer able to get the rich prompt. (Also looks like tab completion etc are broken.)

I also updated to the latest version of msysgit at the same time I updated to the latest Win8 drop, so I guess it could be a change there as well.

Auto-Update Upon Opening Powershell (optional)

Add a parameter and functionality so the user has the option to enable "auto-update" functionality whereby upon opening Powershell, a git pull request will trigger causing the user's posh-git scripts to be updated to the latest version.

Remove remote merged branches command

So we (GHfW) team have a PowerShell script that will list all remote branches that are already merged into a specified branch (it defaults to origin/master if no branch is supplied) and offer to delete them for you.

I'd love to clean it up and add it as a command to GitUtils.ps1. Would you be interested in such a thing as part of Posh-Git?

Startup time is too long in Git Shell

Hi,

I've install GitHub for Windows(1.0.38.1) in 3 PCs and all set PowerShell as it's default Shell. But when I click "Git Shell" icon to open the shell console, my fast PC(core-i7) take the longest startup time(more than 12 secs), others slow PC just take about 2-3 secs. Could advise how to find the root cause of this issue?

git rm tab completion issues

Running the command git rm no longer tabs through files to be deleted

For instance
deleted /FolderA/fileA
deleted /FolderA/fileB
deleted /FolderB/fileA

git rm used to give
git rm /FolderA/fileA --first tab
git rm /FolderA/fileB --secondtab

now it gives
git rm ./FolderA -- first tab
git rm ./FolderB -- second tab

"git rm filename" gives error "Deletion of directory 'parentfolder' failed"

This is using the posh-git included in github for windows.

C:\dev\TeamHaven\cdsweb\Images [master]> git rm leftarrow.gif
rm 'cdsweb/Images/leftarrow.gif'
Deletion of directory 'cdsweb/Images' failed. Should I try again? (y/n) n

The file is marked for deletion though, but obviously if this isn't a spurious message, it's a bit concerning that it's trying to delete the folder too!

prompt color updating incorrectly? (with my current workflow)

This maybe more of an issue w/ my git workflow so please help me if I'm doing this all wrong...

Setup:

  • Colors - "Blue" (It's not blue, but it's sort of blue and i'll refer to it as a blue color going forward). This is the color that shows after I've done a git push origin master and everything is in sync.
    "Red" - the color when I've committed local changes, but have not pushed those up to remote.

My issue is when my state is Blue and I run "git pull origin master" I would expect my color to stay blue. However it turns red, it's not until I then run "git remote update" that it turns blue.

Is there a better workflow for me? Or any other thoughts on this?

Disable color of git status

Color should be explicitly disabled on "git status" call at GitUtils.ps1:104.

old: git status --short --branch
new: git -c color.status=false status --short --branch

viceice@f034c69

Regards

SQL Server Snapin

Changing into SQLSERVER:\sql yields an error:

The term 'w' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Have PsGet install Posh-Git as a Git repository

I used PsGet (http://psget.net/) to install Posh-Git on my machine. It was lovely and easy! But now I noticed that my version of Posh-Git is out of date. :(

Ideally, PsGet would be updated frequently. But perhaps even better, have the PsGet package include the posh-git repository so that it's easy to update. :)

Get-SshAgent() doesn't work

Here is my profile:

$agent = Get-SshAgent
if ($agent -eq 0) {
    Write-Host "Starting SSH agent..."
    Start-SshAgent -Quiet       # Start agent
    Add-SshKey          # Add my default key
} else {
    Write-Host "SSH agent is running (PID $agent)"
}

When this is run PS errors with

Get-SshAgent : The term 'Get-SshAgent' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Projects\Test\posh-git\profile.example.ps1:36 char:10

  • $agent = Get-SshAgent
  •      ~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Get-SshAgent:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

I've modified the profile just to call Get-SshAgent on its own and the same error appears.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.