mroth / scmpuff

:1234: Numeric file shortcuts for common git commands
https://mroth.github.io/scmpuff/
MIT License
384 stars 23 forks source link

consider refactor to use go-git instead of system git #33

Open mroth opened 6 years ago

mroth commented 6 years ago

https://github.com/src-d/go-git

This could make shelling out to git completely unnecessary, and could remove some of the complex code related to parsing git porcelain output. It could also be overkill beyond something that already mostly works.

In order to do this, it would involve:

  1. Assessing the stability of the go-git project and code
  2. Assessing feature completeness for everything we need from go-git (not immediately obvious how to get the equivalent of our porcelain call to status -b for branch and ahead/behind info)
  3. Performance benchmarking to make sure there is no perf regression
AndrewSB commented 6 years ago

This sounds really interesting, but might break my usage. when I type in git, it goes from scmpuff's function, to hub, and then to git.

EDIT: I just realized you probably meant that you'd use go-git after the switch statement, so my use of hub should still be fine

mroth commented 6 years ago

@AndrewSB Yeah, it would be totally internal. Beneath the surface now, scmpuff status makes a system call to git status -b -z. This could (in theory) replace that.