/usr/share/doc/git/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.]
.
Edit
..
Edit
api-error-handling.html
Edit
api-error-handling.txt
Edit
api-index-skel.txt
Edit
api-index.html
Edit
api-index.sh
Edit
api-index.txt
Edit
api-merge.html
Edit
api-merge.txt
Edit
api-parse-options.html
Edit
api-parse-options.txt
Edit
api-simple-ipc.html
Edit
api-simple-ipc.txt
Edit
api-trace2.html
Edit
api-trace2.txt
Edit
bitmap-format.html
Edit
bitmap-format.txt
Edit
bundle-uri.html
Edit
bundle-uri.txt
Edit
commit-graph.txt
Edit
directory-rename-detection.txt
Edit
hash-function-transition.html
Edit
hash-function-transition.txt
Edit
long-running-process-protocol.html
Edit
long-running-process-protocol.txt
Edit
multi-pack-index.html
Edit
multi-pack-index.txt
Edit
pack-heuristics.html
Edit
pack-heuristics.txt
Edit
packfile-uri.txt
Edit
parallel-checkout.html
Edit
parallel-checkout.txt
Edit
partial-clone.html
Edit
partial-clone.txt
Edit
platform-support.html
Edit
platform-support.txt
Edit
racy-git.html
Edit
racy-git.txt
Edit
reftable.html
Edit
reftable.txt
Edit
remembering-renames.txt
Edit
repository-version.txt
Edit
rerere.txt
Edit
scalar.html
Edit
scalar.txt
Edit
send-pack-pipeline.html
Edit
send-pack-pipeline.txt
Edit
shallow.html
Edit
shallow.txt
Edit
sparse-checkout.txt
Edit
sparse-index.txt
Edit
trivial-merge.html
Edit
trivial-merge.txt
Edit
unit-tests.html
Edit
unit-tests.txt
Edit