如何知道 git-remote-http 的进度

409 views
Skip to first unread message

wu tied

unread,
Aug 19, 2011, 3:06:23 AM8/19/11
to GotGit, elvi...@quantacn.com

在 sync chromium 的 source tree 的时候, 常常遇到某些 package 会卡住, ps ax 一看, 有个进程
叫:

git-remote-http cros http://git.chromium.org/external/WebKit_trimmed.git
git fetch-pack --stateless-rpc --lock-pack --include-tag --thin
http://git.chromium.org/external/WebKit_trimmed.git efs/heads/master

有没有啥么办法可以知道目前的进度, 或是状态?

Jiang Xin

unread,
Aug 19, 2011, 3:32:21 AM8/19/11
to GotGit
首先你使用的 Git 命令我看得很糊涂,为什么使用那么底层的命令,来做最普通的Git操作呢?
貌似是受到石器时代网页的误导。

Git 1.6.6 开始支持智能 HTTP 协议,之前的老版本Git使用HTTP哑协议会遇到像你这这样看不到
进度提示。如果服务器没有使用智能HTTP方式架设,即使客户端是1.6.6之后版本,也只能用
哑协议,看不到进度,而且克隆/同步效率非常低。

关于协议,参见书第200页。如果服务器支持 git 协议或者 ssh 协议,建议采用。

On Aug 19, 3:06 pm, wu tied <tie...@gmail.com> wrote:
> 在 sync chromium 的 source tree 的时候, 常常遇到某些 package 会卡住, ps ax 一看, 有个进程
> 叫:
>

> git-remote-http croshttp://git.chromium.org/external/WebKit_trimmed.git

Jiang Xin

unread,
Aug 19, 2011, 3:50:19 AM8/19/11
to GotGit
抱歉没有看到你使用 ps 命令看到的。如果使用哑协议会是这样的,看不到数据传输的进度。

智能协议(智能HTTP协议,git协议,ssh协议)会好得多,但是也不能保证进度显示是一致的。
例如某此提交了一个大文件,那么这个大文件在同步的时候,也会显示进度的停滞。

>
> 有没有啥么办法可以知道目前的进度, 或是状态?

--
您收到这封邮件是因为您订阅了 Google Groups "GotGit" 邮件组。
向邮件组发言很简单,发送邮件到: got...@googlegroups.com 即可。
如果不想继续收到相关邮件,发送退订邮件到 gotgit+un...@googlegroups.com
您也可以通过 Web 界面访问和配置本邮件列表:
http://groups.google.com/group/gotgit?hl=en?hl=en



--
蒋鑫

北京群英汇信息技术有限公司
邮件: worldhello.netgmail.com
网址: http://www.ossxp.com/
    http://blog.ossxp.com/
电话: 010-51262007, 13910430470
传真: 010-51262007

wu tied

unread,
Aug 19, 2011, 4:08:31 AM8/19/11
to GotGit
感谢你的回答!

这样的命令, 并不是我自己下的而是透过 android repo 所产生出来的, 因为下载某些 packages 时会很慢, 所以只是想分析看
看:

卡住了是认证时不顺利, 或是文件太大导致下载的时间太久 - 任何线索都想尝试看看。

如照你说的: 如果服务器没有使用智能HTTP方式架设,即使客户端是1.6.6之后版本,也只能用
哑协议,看不到进度,而且克隆/同步效率非常低

这样的情况是不是没有机会了解到到底他的状态是啥么?

Jiang Xin

unread,
Aug 19, 2011, 4:32:46 AM8/19/11
to GotGit
先看看Git客户端版本库是不是 1.6.6或更新版本库,如果怀疑是HTTP哑协议造成进度不可见,
把 chromium 库的地址改为 git 协议(修改 .git/config 或者用 git remote set-url 命令),
进到 chromium 目录,执行 git remote update 命令更新,以免由于 repo 的封装,导致进度看不到?

wu tied

unread,
Aug 19, 2011, 4:53:34 AM8/19/11
to GotGit
首先确认 git version: git version 1.7.0.4

修改 http 协议为 git 协议 -

cd chromiumos/.repo/projects/chromium/src/third_party/WebKit.git
vi config

=======
[remote "cros"]
url = http://git.chromium.org/external/WebKit_trimmed.git
review = gerrit.chromium.org/gerrit
projectname = external/WebKit_trimmed
fetch = +refs/heads/*:refs/remotes/cros/*

url = http://git.chromium.org/external/WebKit_trimmed.git 改成 url =
http://git.chromium.org/external/WebKit_trimmed.git

然后执行 git remote update

结果:
$ git remote update
Fetching cros
git.chromium.org[0: 74.125.248.73]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)
error: Could not fetch cros

我想问的是, 是改这地方吗?

Jiang Xin

unread,
Aug 19, 2011, 5:05:08 AM8/19/11
to GotGit
> url =http://git.chromium.org/external/WebKit_trimmed.git改成 url =http://git.chromium.org/external/WebKit_trimmed.git
这不是没改么? :D
而且改之前要查一查git协议的服务器、部署位置是不是一样的,有可能是 git://git.chromium.org/external/WebKit_trimmed.git
也可能不是。

On Aug 19, 4:53 pm, wu tied <tie...@gmail.com> wrote:
> 首先确认 git version: git version 1.7.0.4
>
> 修改 http 协议为 git 协议 -
>
> cd chromiumos/.repo/projects/chromium/src/third_party/WebKit.git
> vi config
>
> =======
> [remote "cros"]

> url =http://git.chromium.org/external/WebKit_trimmed.git


> review = gerrit.chromium.org/gerrit
> projectname = external/WebKit_trimmed
> fetch = +refs/heads/*:refs/remotes/cros/*
>

> url =http://git.chromium.org/external/WebKit_trimmed.git改成 url =http://git.chromium.org/external/WebKit_trimmed.git

Jiang Xin

unread,
Aug 19, 2011, 5:11:46 AM8/19/11
to GotGit
我试着克隆了一下:

$ git clone http://git.chromium.org/external/WebKit_trimmed.git
Cloning into WebKit_trimmed...
remote: Counting objects: 366181, done.
remote: Compressing objects: 100% (102579/102579), done.
Receiving objects: 0% (267/366181), 132.00 KiB | 26 KiB/s

有进度显示,进度在走,库比较大等不到完毕。也许到某个对象因为太大导致貌似卡住也备不住。

btw,祝群友们周末愉快。下周见。


On Aug 19, 4:53 pm, wu tied <tie...@gmail.com> wrote:
> 首先确认 git version: git version 1.7.0.4
>
> 修改 http 协议为 git 协议 -
>
> cd chromiumos/.repo/projects/chromium/src/third_party/WebKit.git
> vi config
>
> =======
> [remote "cros"]

> url =http://git.chromium.org/external/WebKit_trimmed.git


> review = gerrit.chromium.org/gerrit
> projectname = external/WebKit_trimmed
> fetch = +refs/heads/*:refs/remotes/cros/*
>

> url =http://git.chromium.org/external/WebKit_trimmed.git改成 url =http://git.chromium.org/external/WebKit_trimmed.git

wu tied

unread,
Aug 19, 2011, 5:47:01 AM8/19/11
to GotGit
url =git://git.chromium.org/external/WebKit_trimmed.git

是有改的, 一时笔误不好意思.

我直接运行 git clone, 也是有进度的 -

Initialized empty Git repository in /tmp/WebKit_trimmed/.git/


remote: Counting objects: 366181, done.

remote: Compressing objects: 100% (103852/103852), done.
Receiving objects: 1% (4238/366181), 2.11 MiB | 8 KiB/s

但 repo 封装后就看不到了 - 回到之前的那一个尝试:

$ git remote update
Fetching cros
git.chromium.org[0: 74.125.248.73]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)
error: Could not fetch cros

可能改错文件? 也可能是 部署位置不对? 追踪中........

Reply all
Reply to author
Forward
0 new messages