summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-12-05 20:02:32 +0700
committerJunio C Hamano <gitster@pobox.com>2013-12-10 16:14:16 -0800
commitad491366de6c883cd04539cb86db31049201dfbd (patch)
treef94ce53d28f70ad6d971c12567d0cb6dbb5d5615 /commit.h
parent606e435a0a11634744282068174240caf2926fec (diff)
downloadgit-ad491366de6c883cd04539cb86db31049201dfbd.tar.gz
make the sender advertise shallow commits to the receiver
If either receive-pack or upload-pack is called on a shallow repository, shallow commits (*) will be sent after the ref advertisement (but before the packet flush), so that the receiver has the full "shape" of the sender's commit graph. This will be needed for the receiver to update its .git/shallow if necessary. This breaks the protocol for all clients trying to push to a shallow repo, or fetch from one. Which is basically the same end result as today's "is_repository_shallow() && die()" in receive-pack and upload-pack. New clients will be made aware of shallow upstream and can make use of this information. The sender must send all shallow commits that are sent in the following pack. It may send more shallow commits than necessary. upload-pack for example may choose to advertise no shallow commits if it knows in advance that the pack it's going to send contains no shallow commits. But upload-pack is the server, so we choose the cheaper way, send full .git/shallow and let the client deal with it. Smart HTTP is not affected by this patch. Shallow support on smart-http comes later separately. (*) A shallow commit is a commit that terminates the revision walker. It is usually put in .git/shallow in order to keep the revision walker from going out of bound because there is no guarantee that objects behind this commit is available. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
-rw-r--r--commit.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/commit.h b/commit.h
index bd841f4d0c..a8795263b6 100644
--- a/commit.h
+++ b/commit.h
@@ -205,6 +205,7 @@ extern int write_shallow_commits(struct strbuf *out, int use_pack_protocol);
extern void setup_alternate_shallow(struct lock_file *shallow_lock,
const char **alternate_shallow_file);
extern char *setup_temporary_shallow(void);
+extern void advertise_shallow_grafts(int);
int is_descendant_of(struct commit *, struct commit_list *);
int in_merge_bases(struct commit *, struct commit *);