Skip to content

Emit cache-side progress as messages to the client #23

Open
@gurjeet

Description

@gurjeet

Consider this is a enhancement-request. I configured my global config to use the cache, and ran fetch on an existing large repo. Since it's an existing repo, I naively expected the fetch to be quick. But since the cache had never cloned this repo before, it seemed like the client was hung, with no response messages from the server.

The cache should emit messages, which should then be shown by the client to let the user know that the cache is working on it, and if possible show some sense of progress.

For example, it would be a great UX improvement if the user saw a message like

remote: git-cache: Cloning populating cache of this remote for the first time,
remote: git-cache: it may take some time.

Below are sample sessions from the client and the cache's output.


$ git config --global url."http://localhost:9898/github.com/".insteadOf [email protected]:
$ git remote -v
origin  http://localhost:9898/github.com/kubernetes/kubernetes.git (fetch)
origin  http://localhost:9898/github.com/kubernetes/kubernetes.git (push)
[gurjeetsingh@GC02WR5SLHTD6E:ttys032 ~/dev/KUBERNETES] time:1 exit:0 T175552 (master)
$ git fetch --all
Fetching origin
<command appears to be hung here for many minutes>

Server session

$ npm run build && ./bin/git-cache-http-server.js --cache-dir /tmp/git-cache-test/ --port 9898
...
INFO: listening to port: 9898
...
GET /github.com/kubernetes/kubernetes.git/info/refs?service=git-upload-pack
INFO: authenticating on the upstream repo github.com/kubernetes/kubernetes.git
INFO: updating: fetching from github.com/kubernetes/kubernetes.git
WARN: updating: fetch failed

fatal: cannot change to '/tmp/git-cache-test/github.com/kubernetes/kubernetes.git': No such file or directory

WARN: continuing with clone
<cache-server appears to be hung here for many minutes>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions