scmpuff icon indicating copy to clipboard operation
scmpuff copied to clipboard

consider refactor to use go-git instead of system git

Open mroth opened this issue 6 years ago • 2 comments

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

mroth avatar Jan 10 '18 16:01 mroth

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

AndrewSB avatar Jan 23 '18 00:01 AndrewSB

@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.

mroth avatar Jan 23 '18 02:01 mroth