-
Notifications
You must be signed in to change notification settings - Fork 540
RFC: provide insight into the status of gogit #570
base: master
Are you sure you want to change the base?
Conversation
A project I'm working on uses gogit to power a git remote helper (i.e., it gets invoked by git when you do `git clone <protocol>://...`, etc from the command line). On big repos, gogit and our backing store are slow enough that having printed progress indicators makes a huge difference to usability, and better allows us to debug where slownesses might be. This is a quick-and-dirty PR that lets gogit communicate its status back to some listener. I haven't fixed up the tests yet, or written any new tests, because I wanted to get feedback first on if this is even a good approach or not. Please take a look and let me know! (Note that this is different from the sideband progress stuff, which only lets you know the progress of the remote server. This PR gives the status of the local client.)
@mcuadros @erizocosmico: I don't want this merged as is, I'm just looking for feedback on whether this is a reasonable approach, and if not any suggestions on how better to do it. Thanks! |
Personally I don't like having all the logic for status mixed across all the package. I prefer having an optional If some information cannot be retrieve, from this method, I rather adding a new interface to the storage package to allow to the plumbing communicate this information. |
Will be nice sort the ideas, and write down all the information that needs/wants to be retrieve from which operations. Related #549 |
Ah thanks for the pointer to #549. I can summarize some things there, though I'm also interested in push (more so than fetch/clone actually). Having an interface rather than a bare channel seems reasonable. However, the type of info that's useful for status seems almost entirely orthogonal to the Later today I'll put together a list of what's tracked in this PR and post it here and in #549. |
Here is a summary of the useful status information I've found that gogit needs to report. This is from the perspective of using go-git as a library to build a git-remote-helper. That means my project interfaces with the local git repo as a remote, using the file protocol. Thus, actually transferring the data back and forth to the remote is not a bottleneck for us, and I haven't included that in this PR or in the list below (though in a more general interface, it would of course be needed!). For fetch/clone:
For push:
Lastly, there is a Done phase for both fetches and pushes, which is probably unnecessary as the caller can just end things when the So I think 2 of the 9 phases can be covered by a @mcuadros What do you think is the best way for me to proceed? Here's one proposal:
Open to other suggestions. |
I didn't forgot you. ;) |
336a7d1
to
319bac9
Compare
A project I'm working on uses gogit to power a git remote helper
(i.e., it gets invoked by git when you do
git clone <protocol>://...
, etc from the command line). On big repos, gogitand our backing store are slow enough that having printed progress
indicators makes a huge difference to usability, and better allows us
to debug where slownesses might be.
This is a quick-and-dirty PR that lets gogit communicate its status
back to some listener. I haven't fixed up the tests yet, or written
any new tests, because I wanted to get feedback first on if this is
even a good approach or not. Please take a look and let me know!
(Note that this is different from the sideband progress stuff, which
only lets you know the progress of the remote server. This PR gives
the status of the local client.)