Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with powertab if it's available. #63

Closed
wants to merge 1 commit into from

Conversation

weeble
Copy link
Contributor

@weeble weeble commented Jun 26, 2012

Hi. You mention here that you'd be interested in a patch to integrate with PowerTab: #31

This patch integrates with PowerTab, although you need to load PowerTab first. It falls back to the normal behaviour if PowerTab isn't present. I haven't included the "tgit" command because I don't have Tortoise Git installed and I'm not sure of the full command name. PowerTab seems to be quite picky and requires you to register on the full name of the command you want to provide completion for - the registration code must specify "git.cmd", not just "git", and I'm not sure whether tgit is provided by a "tgit.cmd", "tgit.exe" or something else. (It might be possible to extract the full name at startup using Get-Command, but I haven't investigated this.)

}
else
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using if/else, could you just throw a return at the end of the if block so the rest of the file doesn't need to change?

@weeble
Copy link
Contributor Author

weeble commented Jul 3, 2012

Sure. How's this? (I rebased the branch back down to one commit, but I think I accidentally kept the old commit's timestamp, not the new one, hence Github shows that as me adding a commit 7 days ago.)

@dahlbyk
Copy link
Owner

dahlbyk commented Jul 3, 2012

Perfect!

I probably would look into expanding git into git.cmd, git.exe or something else. For example, at home I use git through https://github.com/dahlbyk/git-achievements. Is it possible for PowerTab to work for a script aliased, or does it have to hook to a .cmd/.exe?

@weeble
Copy link
Contributor Author

weeble commented Jul 3, 2012

PowerTab can definitely allow callbacks to be registered for functions as well as scripts and executables. In fact, it took me quite a while to figure out how to register for a script or executable. I'm not sure how best to handle not knowing whether "git" invokes a function or a script. I think there's a good chance that the right thing to do is register on (Get-Command "git").Name and (Get-Command "tgit").Name, but I haven't actually tried this out yet.

@dahlbyk
Copy link
Owner

dahlbyk commented Aug 8, 2012

Pulled into master

@dahlbyk dahlbyk closed this Aug 8, 2012
lei-yu-wdfc pushed a commit to lei-yu-wdfc/posh-git that referenced this pull request Aug 31, 2012
QA-160 with all needed changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants