PATH:
usr
/
share
/
doc
/
git-1.8.3.1
/
technical
Git-send-pack internals ======================= Overall operation ----------------- . Connects to the remote side and invokes git-receive-pack. . Learns what refs the remote has and what commit they point at. Matches them to the refspecs we are pushing. . Checks if there are non-fast-forwards. Unlike fetch-pack, the repository send-pack runs in is supposed to be a superset of the recipient in fast-forward cases, so there is no need for want/have exchanges, and fast-forward check can be done locally. Tell the result to the other end. . Calls pack_objects() which generates a packfile and sends it over to the other end. . If the remote side is new enough (v1.1.0 or later), wait for the unpack and hook status from the other end. . Exit with appropriate error codes. Pack_objects pipeline --------------------- This function gets one file descriptor (`fd`) which is either a socket (over the network) or a pipe (local). What's written to this fd goes to git-receive-pack to be unpacked. send-pack ---> fd ---> receive-pack The function pack_objects creates a pipe and then forks. The forked child execs pack-objects with --revs to receive revision parameters from its standard input. This process will write the packfile to the other end. send-pack | pack_objects() ---> fd ---> receive-pack | ^ (pipe) v | (child) The child dup2's to arrange its standard output to go back to the other end, and read its standard input to come from the pipe. After that it exec's pack-objects. On the other hand, the parent process, before starting to feed the child pipeline, closes the reading side of the pipe and fd to receive-pack. send-pack | pack_objects(parent) | v [0] pack-objects [0] ---> receive-pack [jc: the pipeline was much more complex and needed documentation before I understood an earlier bug, but now it is trivial and straightforward.]
[-] api-strbuf.html
[edit]
[-] api-credentials.txt
[edit]
[-] shallow.txt
[edit]
[-] api-sigchain.html
[edit]
[-] racy-git.html
[edit]
[-] api-allocation-growing.txt
[edit]
[-] api-tree-walking.html
[edit]
[-] index-format.txt
[edit]
[-] pack-protocol.html
[edit]
[-] api-setup.txt
[edit]
[-] api-lockfile.html
[edit]
[-] api-directory-listing.txt
[edit]
[-] api-remote.txt
[edit]
[-] pack-format.html
[edit]
[-] api-quote.txt
[edit]
[-] index-format.html
[edit]
[-] api-in-core-index.txt
[edit]
[-] api-hash.txt
[edit]
[-] send-pack-pipeline.html
[edit]
[-] api-strbuf.txt
[edit]
[+]
..
[-] protocol-common.html
[edit]
[-] pack-heuristics.html
[edit]
[-] api-sha1-array.html
[edit]
[-] api-xdiff-interface.html
[edit]
[-] api-xdiff-interface.txt
[edit]
[-] api-hashmap.html
[edit]
[-] api-ref-iteration.txt
[edit]
[-] trivial-merge.html
[edit]
[-] api-gitattributes.txt
[edit]
[-] pack-format.txt
[edit]
[-] api-run-command.txt
[edit]
[-] api-parse-options.html
[edit]
[-] api-ref-iteration.html
[edit]
[-] trivial-merge.txt
[edit]
[-] api-decorate.txt
[edit]
[-] api-builtin.txt
[edit]
[-] api-directory-listing.html
[edit]
[-] pack-protocol.txt
[edit]
[-] api-hash.html
[edit]
[-] api-quote.html
[edit]
[-] api-setup.html
[edit]
[-] api-argv-array.html
[edit]
[-] api-remote.html
[edit]
[-] api-grep.txt
[edit]
[-] protocol-capabilities.txt
[edit]
[-] api-revision-walking.html
[edit]
[-] api-string-list.txt
[edit]
[-] api-history-graph.txt
[edit]
[-] api-diff.html
[edit]
[-] protocol-common.txt
[edit]
[-] api-sigchain.txt
[edit]
[-] api-gitattributes.html
[edit]
[-] api-grep.html
[edit]
[-] api-history-graph.html
[edit]
[-] api-lockfile.txt
[edit]
[-] api-index.txt
[edit]
[-] api-revision-walking.txt
[edit]
[-] api-sha1-array.txt
[edit]
[-] api-string-list.html
[edit]
[-] api-object-access.txt
[edit]
[-] api-hashmap.txt
[edit]
[-] protocol-capabilities.html
[edit]
[-] api-object-access.html
[edit]
[-] pack-heuristics.txt
[edit]
[-] shallow.html
[edit]
[-] api-run-command.html
[edit]
[-] racy-git.txt
[edit]
[-] api-merge.html
[edit]
[-] api-index-skel.txt
[edit]
[-] api-tree-walking.txt
[edit]
[-] send-pack-pipeline.txt
[edit]
[-] api-in-core-index.html
[edit]
[-] api-diff.txt
[edit]
[-] api-index.html
[edit]
[-] api-credentials.html
[edit]
[-] api-builtin.html
[edit]
[-] api-allocation-growing.html
[edit]
[-] api-merge.txt
[edit]
[-] api-parse-options.txt
[edit]
[-] api-config.html
[edit]
[-] api-decorate.html
[edit]
[-] api-index.sh
[edit]
[-] api-argv-array.txt
[edit]
[-] api-config.txt
[edit]