1
在這裏,這部分我不能使它工作。智能HTTP git客戶端
https://gist.github.com/schacon/6092633#file-git-http-proto-txt-L313
# -*- coding: utf-8 -*-
import requests
url = "https://github.com/llacroix/node-nfc.git/git-upload-pack"
def make_line(line):
prefix = "%0.4x" % (len(line) + 4)
return "%s%s" % (prefix, line)
data = ""
data += make_line("want ba9007f12771f6fddf2b1b22888af90352588197\0 \n")
data += make_line("have 5cec4d0c777aa2bda27c6c9be8e6108ef0f08d62\n")
data += "0000"
req = requests.post(url, data, headers={'Content-Type': 'application/x-git-upload-pack-request'})
print req.text
我不明白我怎麼可以讓它工作。我在本地嘗試命令:
git-upload-pack --stateless-rpc .
但我無法弄清楚使協議工作正常。它要麼失敗,要麼本地沒有返回。並遠程,它總是失敗:
IncompleteRead(0字節讀)」,......
你到底想幹什麼?你有沒有考慮過使用[libgit2](https://libgit2.github.com/)? – Schwern
我試圖使用並行互聯網連接異步獲取多個包。 –
如果你能找到一個使用http(不是https)的Git倉庫,你可以用'tcpdump -A -i <網絡接口>主機和tcp端口80'來嗅探git fetch正在做什麼。 –
Schwern