{"thread":{"id":"29601","subject":"[PATCH 1/7] t5700: document a failure of alternates to affect fetch","startedAt":"2012-02-11T06:20:54Z","lastAt":"2012-02-14T22:51:13Z","messageCount":14,"participants":["mhagger@alum.mit.edu","Junio C Hamano","Michael Haggerty","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"184430","messageId":"1328941261-29746-1-git-send-email-mhagger@alum.mit.edu","threadId":"29601","inReplyTo":null,"subject":"[PATCH 0/7] Make alternates affect fetch behavior","fromName":"","fromEmail":"mhagger@alum.mit.edu","sentAt":"2012-02-11T06:20:54Z","receivedAt":"2012-02-11T06:20:54Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"From: Michael Haggerty <mhagger@alum.mit.edu>\n\nIt used to be that alternate references were not considered \"complete\"\nwhen fetching via fetch-pack.  This failure was not so obvious because\nthe big benefit of alternates is seen when cloning, and clone used a\ndifferent data path: it put the alternate references into extra refs\n(which makes them look like references within the local repository).\n\nThis patch series teaches fetch-pack to treat objects that are\navailable via alternates as \"complete\".\n\nOnce that is fixed, clone doesn't need to use the special extra_refs\nkludge, so change that.\n\nAnd once that is changed, the extra_refs API is no longer needed at\nall, so remove it.\n\nMichael Haggerty (7):\n  t5700: document a failure of alternates to affect fetch\n  clone.c: move more code into the \"if (refs)\" conditional\n  fetch-pack.c: rename some parameters from \"path\" to \"refname\"\n  fetch-pack.c: inline insert_alternate_refs()\n  everything_local(): mark alternate refs as complete\n  clone: do not add alternate references to extra_refs\n  refs: remove the extra_refs API\n\n builtin/clone.c            |   51 +++++++++++++++++--------------------------\n builtin/fetch-pack.c       |   23 ++++++++++---------\n refs.c                     |   23 +-------------------\n refs.h                     |    8 -------\n t/t5700-clone-reference.sh |   34 ++++++++++++++++++++++++++--\n 5 files changed, 64 insertions(+), 75 deletions(-)\n\n-- \n1.7.9\n"},{"id":"184427","messageId":"1328941261-29746-2-git-send-email-mhagger@alum.mit.edu","threadId":"29601","inReplyTo":"1328941261-29746-1-git-send-email-mhagger@alum.mit.edu","subject":"[PATCH 1/7] t5700: document a failure of alternates to affect fetch","fromName":"","fromEmail":"mhagger@alum.mit.edu","sentAt":"2012-02-11T06:20:55Z","receivedAt":"2012-02-11T06:20:55Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"From: Michael Haggerty <mhagger@alum.mit.edu>\n\nIf an alternate supplies some, but not all, of the objects needed for\na fetch, fetch-pack nevertheless generates \"want\" lines for the\nalternate objects that are present.  Demonstrate this problem via a\nfailing test.\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\n t/t5700-clone-reference.sh |   34 +++++++++++++++++++++++++++++++---\n 1 files changed, 31 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh\nindex c4c375a..2dafee8 100755\n--- a/t/t5700-clone-reference.sh\n+++ b/t/t5700-clone-reference.sh\n@@ -52,13 +52,13 @@ test_cmp expected current'\n \n cd \"$base_dir\"\n \n-rm -f \"$U\"\n+rm -f \"$U.D\"\n \n test_expect_success 'cloning with reference (no -l -s)' \\\n-'GIT_DEBUG_SEND_PACK=3 git clone --reference B \"file://$(pwd)/A\" D 3>\"$U\"'\n+'GIT_DEBUG_SEND_PACK=3 git clone --reference B \"file://$(pwd)/A\" D 3>\"$U.D\"'\n \n test_expect_success 'fetched no objects' \\\n-'! grep \"^want\" \"$U\"'\n+'! grep \"^want\" \"$U.D\"'\n \n cd \"$base_dir\"\n \n@@ -153,4 +153,32 @@ test_expect_success 'clone with reference from a tagged repository' '\n \tgit clone --reference=A A I\n '\n \n+test_expect_success 'prepare branched repository' '\n+\tgit clone A J &&\n+\t(\n+\t\tcd J &&\n+\t\tgit checkout -b other master^ &&\n+\t\techo other > otherfile &&\n+\t\tgit add otherfile &&\n+\t\tgit commit -m other &&\n+\t\tgit checkout master\n+\t)\n+'\n+\n+rm -f \"$U.K\"\n+\n+test_expect_failure 'fetch with incomplete alternates' '\n+\tgit init K &&\n+\techo \"$base_dir/A/.git/objects\" >K/.git/objects/info/alternates &&\n+\t(\n+\t\tcd K &&\n+\t\tgit remote add J \"file://$base_dir/J\" &&\n+\t\tGIT_DEBUG_SEND_PACK=3 git fetch J 3>\"$U.K\"\n+\t) &&\n+\tmaster_object=$(cd A && git for-each-ref --format=\"%(objectname)\" refs/heads/master) &&\n+\t! grep \"^want $master_object\" \"$U.K\" &&\n+\ttag_object=$(cd A && git for-each-ref --format=\"%(objectname)\" refs/tags/HEAD) &&\n+\t! grep \"^want $tag_object\" \"$U.K\"\n+'\n+\n test_done\n-- \n1.7.9\n"},{"id":"184428","messageId":"1328941261-29746-3-git-send-email-mhagger@alum.mit.edu","threadId":"29601","inReplyTo":"1328941261-29746-1-git-send-email-mhagger@alum.mit.edu","subject":"[PATCH 2/7] clone.c: move more code into the \"if (refs)\" conditional","fromName":"","fromEmail":"mhagger@alum.mit.edu","sentAt":"2012-02-11T06:20:56Z","receivedAt":"2012-02-11T06:20:56Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"From: Michael Haggerty <mhagger@alum.mit.edu>\n\nThe bahavior of a bunch of code before the \"if (refs)\" statement also\ndepends on whether refs is set, so make the logic clearer by shifting\nthis code into the if statement.\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\n builtin/clone.c |   39 ++++++++++++++++++++-------------------\n 1 files changed, 20 insertions(+), 19 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex c62d4b5..279fdf0 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -813,28 +813,28 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t}\n \n \trefs = transport_get_remote_refs(transport);\n-\tmapped_refs = refs ? wanted_peer_refs(refs, refspec) : NULL;\n \n-\t/*\n-\t * transport_get_remote_refs() may return refs with null sha-1\n-\t * in mapped_refs (see struct transport->get_refs_list\n-\t * comment). In that case we need fetch it early because\n-\t * remote_head code below relies on it.\n-\t *\n-\t * for normal clones, transport_get_remote_refs() should\n-\t * return reliable ref set, we can delay cloning until after\n-\t * remote HEAD check.\n-\t */\n-\tfor (ref = refs; ref; ref = ref->next)\n-\t\tif (is_null_sha1(ref->old_sha1)) {\n-\t\t\tcomplete_refs_before_fetch = 0;\n-\t\t\tbreak;\n-\t\t}\n+\tif (refs) {\n+\t\tmapped_refs = wanted_peer_refs(refs, refspec);\n+\t\t/*\n+\t\t * transport_get_remote_refs() may return refs with null sha-1\n+\t\t * in mapped_refs (see struct transport->get_refs_list\n+\t\t * comment). In that case we need fetch it early because\n+\t\t * remote_head code below relies on it.\n+\t\t *\n+\t\t * for normal clones, transport_get_remote_refs() should\n+\t\t * return reliable ref set, we can delay cloning until after\n+\t\t * remote HEAD check.\n+\t\t */\n+\t\tfor (ref = refs; ref; ref = ref->next)\n+\t\t\tif (is_null_sha1(ref->old_sha1)) {\n+\t\t\t\tcomplete_refs_before_fetch = 0;\n+\t\t\t\tbreak;\n+\t\t\t}\n \n-\tif (!is_local && !complete_refs_before_fetch && refs)\n-\t\ttransport_fetch_refs(transport, mapped_refs);\n+\t\tif (!is_local && !complete_refs_before_fetch)\n+\t\t\ttransport_fetch_refs(transport, mapped_refs);\n \n-\tif (refs) {\n \t\tremote_head = find_ref_by_name(refs, \"HEAD\");\n \t\tremote_head_points_at =\n \t\t\tguess_remote_head(remote_head, mapped_refs, 0);\n@@ -852,6 +852,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t}\n \telse {\n \t\twarning(_(\"You appear to have cloned an empty repository.\"));\n+\t\tmapped_refs = NULL;\n \t\tour_head_points_at = NULL;\n \t\tremote_head_points_at = NULL;\n \t\tremote_head = NULL;\n-- \n1.7.9\n"},{"id":"184429","messageId":"1328941261-29746-4-git-send-email-mhagger@alum.mit.edu","threadId":"29601","inReplyTo":"1328941261-29746-1-git-send-email-mhagger@alum.mit.edu","subject":"[PATCH 3/7] fetch-pack.c: rename some parameters from \"path\" to \"refname\"","fromName":"","fromEmail":"mhagger@alum.mit.edu","sentAt":"2012-02-11T06:20:57Z","receivedAt":"2012-02-11T06:20:57Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"From: Michael Haggerty <mhagger@alum.mit.edu>\n\nThe parameters denote reference names, which are no longer 1:1 with\nfilesystem paths.\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\n builtin/fetch-pack.c |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c\nindex 6207ecd..9bd2096 100644\n--- a/builtin/fetch-pack.c\n+++ b/builtin/fetch-pack.c\n@@ -58,9 +58,9 @@ static void rev_list_push(struct commit *commit, int mark)\n \t}\n }\n \n-static int rev_list_insert_ref(const char *path, const unsigned char *sha1, int flag, void *cb_data)\n+static int rev_list_insert_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)\n {\n-\tstruct object *o = deref_tag(parse_object(sha1), path, 0);\n+\tstruct object *o = deref_tag(parse_object(sha1), refname, 0);\n \n \tif (o && o->type == OBJ_COMMIT)\n \t\trev_list_push((struct commit *)o, SEEN);\n@@ -68,9 +68,9 @@ static int rev_list_insert_ref(const char *path, const unsigned char *sha1, int\n \treturn 0;\n }\n \n-static int clear_marks(const char *path, const unsigned char *sha1, int flag, void *cb_data)\n+static int clear_marks(const char *refname, const unsigned char *sha1, int flag, void *cb_data)\n {\n-\tstruct object *o = deref_tag(parse_object(sha1), path, 0);\n+\tstruct object *o = deref_tag(parse_object(sha1), refname, 0);\n \n \tif (o && o->type == OBJ_COMMIT)\n \t\tclear_commit_marks((struct commit *)o,\n@@ -493,7 +493,7 @@ done:\n \n static struct commit_list *complete;\n \n-static int mark_complete(const char *path, const unsigned char *sha1, int flag, void *cb_data)\n+static int mark_complete(const char *refname, const unsigned char *sha1, int flag, void *cb_data)\n {\n \tstruct object *o = parse_object(sha1);\n \n-- \n1.7.9\n"},{"id":"184434","messageId":"1328941261-29746-5-git-send-email-mhagger@alum.mit.edu","threadId":"29601","inReplyTo":"1328941261-29746-1-git-send-email-mhagger@alum.mit.edu","subject":"[PATCH 4/7] fetch-pack.c: inline insert_alternate_refs()","fromName":"","fromEmail":"mhagger@alum.mit.edu","sentAt":"2012-02-11T06:20:58Z","receivedAt":"2012-02-11T06:20:58Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"From: Michael Haggerty <mhagger@alum.mit.edu>\n\nThe logic of the (single) caller is clearer without encapsulating this\none line in a function.\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\n builtin/fetch-pack.c |    7 +------\n 1 files changed, 1 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c\nindex 9bd2096..dbe9acb 100644\n--- a/builtin/fetch-pack.c\n+++ b/builtin/fetch-pack.c\n@@ -256,11 +256,6 @@ static void insert_one_alternate_ref(const struct ref *ref, void *unused)\n \trev_list_insert_ref(NULL, ref->old_sha1, 0, NULL);\n }\n \n-static void insert_alternate_refs(void)\n-{\n-\tfor_each_alternate_ref(insert_one_alternate_ref, NULL);\n-}\n-\n #define INITIAL_FLUSH 16\n #define PIPESAFE_FLUSH 32\n #define LARGE_FLUSH 1024\n@@ -295,7 +290,7 @@ static int find_common(int fd[2], unsigned char *result_sha1,\n \tmarked = 1;\n \n \tfor_each_ref(rev_list_insert_ref, NULL);\n-\tinsert_alternate_refs();\n+\tfor_each_alternate_ref(insert_one_alternate_ref, NULL);\n \n \tfetching = 0;\n \tfor ( ; refs ; refs = refs->next) {\n-- \n1.7.9\n"},{"id":"184433","messageId":"1328941261-29746-6-git-send-email-mhagger@alum.mit.edu","threadId":"29601","inReplyTo":"1328941261-29746-1-git-send-email-mhagger@alum.mit.edu","subject":"[PATCH 5/7] everything_local(): mark alternate refs as complete","fromName":"","fromEmail":"mhagger@alum.mit.edu","sentAt":"2012-02-11T06:20:59Z","receivedAt":"2012-02-11T06:20:59Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"From: Michael Haggerty <mhagger@alum.mit.edu>\n\nObjects in an alternate object database are already available to the\nlocal repository and therefore don't need to be fetched.  So mark them\nas complete in everything_local().\n\nThis fixes a test in t5700.\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\n builtin/fetch-pack.c       |    6 ++++++\n t/t5700-clone-reference.sh |    2 +-\n 2 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c\nindex dbe9acb..0e8560f 100644\n--- a/builtin/fetch-pack.c\n+++ b/builtin/fetch-pack.c\n@@ -581,6 +581,11 @@ static void filter_refs(struct ref **refs, int nr_match, char **match)\n \t*refs = newlist;\n }\n \n+static void mark_alternate_complete(const struct ref *ref, void *unused)\n+{\n+\tmark_complete(NULL, ref->old_sha1, 0, NULL);\n+}\n+\n static int everything_local(struct ref **refs, int nr_match, char **match)\n {\n \tstruct ref *ref;\n@@ -609,6 +614,7 @@ static int everything_local(struct ref **refs, int nr_match, char **match)\n \n \tif (!args.depth) {\n \t\tfor_each_ref(mark_complete, NULL);\n+\t\tfor_each_alternate_ref(mark_alternate_complete, NULL);\n \t\tif (cutoff)\n \t\t\tmark_recent_complete_commits(cutoff);\n \t}\ndiff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh\nindex 2dafee8..783f988 100755\n--- a/t/t5700-clone-reference.sh\n+++ b/t/t5700-clone-reference.sh\n@@ -167,7 +167,7 @@ test_expect_success 'prepare branched repository' '\n \n rm -f \"$U.K\"\n \n-test_expect_failure 'fetch with incomplete alternates' '\n+test_expect_success 'fetch with incomplete alternates' '\n \tgit init K &&\n \techo \"$base_dir/A/.git/objects\" >K/.git/objects/info/alternates &&\n \t(\n-- \n1.7.9\n"},{"id":"184431","messageId":"1328941261-29746-7-git-send-email-mhagger@alum.mit.edu","threadId":"29601","inReplyTo":"1328941261-29746-1-git-send-email-mhagger@alum.mit.edu","subject":"[PATCH 6/7] clone: do not add alternate references to extra_refs","fromName":"","fromEmail":"mhagger@alum.mit.edu","sentAt":"2012-02-11T06:21:00Z","receivedAt":"2012-02-11T06:21:00Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"From: Michael Haggerty <mhagger@alum.mit.edu>\n\nAlternate references are directly (and now, correctly) handled by\nfetch-pack, so there is no need to inform fetch-pack about them via\nthe extra_refs back channel.\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\n builtin/clone.c |   12 ------------\n 1 files changed, 0 insertions(+), 12 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 279fdf0..b15fccb 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -232,9 +232,6 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)\n {\n \tchar *ref_git;\n \tstruct strbuf alternate = STRBUF_INIT;\n-\tstruct remote *remote;\n-\tstruct transport *transport;\n-\tconst struct ref *extra;\n \n \t/* Beware: real_path() and mkpath() return static buffer */\n \tref_git = xstrdup(real_path(item->string));\n@@ -249,14 +246,6 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)\n \tstrbuf_addf(&alternate, \"%s/objects\", ref_git);\n \tadd_to_alternates_file(alternate.buf);\n \tstrbuf_release(&alternate);\n-\n-\tremote = remote_get(ref_git);\n-\ttransport = transport_get(remote, ref_git);\n-\tfor (extra = transport_get_remote_refs(transport); extra;\n-\t     extra = extra->next)\n-\t\tadd_extra_ref(extra->name, extra->old_sha1, 0);\n-\n-\ttransport_disconnect(transport);\n \tfree(ref_git);\n \treturn 0;\n }\n@@ -500,7 +489,6 @@ static void update_remote_refs(const struct ref *refs,\n \t\t\t       const char *msg)\n {\n \tif (refs) {\n-\t\tclear_extra_refs();\n \t\twrite_remote_refs(mapped_refs);\n \t\tif (option_single_branch)\n \t\t\twrite_followtags(refs, msg);\n-- \n1.7.9\n"},{"id":"184432","messageId":"1328941261-29746-8-git-send-email-mhagger@alum.mit.edu","threadId":"29601","inReplyTo":"1328941261-29746-1-git-send-email-mhagger@alum.mit.edu","subject":"[PATCH 7/7] refs: remove the extra_refs API","fromName":"","fromEmail":"mhagger@alum.mit.edu","sentAt":"2012-02-11T06:21:01Z","receivedAt":"2012-02-11T06:21:01Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"From: Michael Haggerty <mhagger@alum.mit.edu>\n\nThe extra_refs provided a kludgy way to create fake references at a\nglobal level in the hope that they would only affect some particular\ncode path.  The last user of this API been rewritten, so strip this\nstuff out before somebody else gets the bad idea of using it.\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\n refs.c |   23 +----------------------\n refs.h |    8 --------\n 2 files changed, 1 insertions(+), 30 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex b8843bb..c9f6835 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -183,12 +183,6 @@ static struct ref_cache {\n \n static struct ref_entry *current_ref;\n \n-/*\n- * Never call sort_ref_array() on the extra_refs, because it is\n- * allowed to contain entries with duplicate names.\n- */\n-static struct ref_array extra_refs;\n-\n static void clear_ref_array(struct ref_array *array)\n {\n \tint i;\n@@ -289,16 +283,6 @@ static void read_packed_refs(FILE *f, struct ref_array *array)\n \t}\n }\n \n-void add_extra_ref(const char *refname, const unsigned char *sha1, int flag)\n-{\n-\tadd_ref(&extra_refs, create_ref_entry(refname, sha1, flag, 0));\n-}\n-\n-void clear_extra_refs(void)\n-{\n-\tclear_ref_array(&extra_refs);\n-}\n-\n static struct ref_array *get_packed_refs(struct ref_cache *refs)\n {\n \tif (!refs->did_packed) {\n@@ -733,16 +717,11 @@ fallback:\n static int do_for_each_ref(const char *submodule, const char *base, each_ref_fn fn,\n \t\t\t   int trim, int flags, void *cb_data)\n {\n-\tint retval = 0, i, p = 0, l = 0;\n+\tint retval = 0, p = 0, l = 0;\n \tstruct ref_cache *refs = get_ref_cache(submodule);\n \tstruct ref_array *packed = get_packed_refs(refs);\n \tstruct ref_array *loose = get_loose_refs(refs);\n \n-\tstruct ref_array *extra = &extra_refs;\n-\n-\tfor (i = 0; i < extra->nr; i++)\n-\t\tretval = do_one_ref(base, fn, trim, flags, cb_data, extra->refs[i]);\n-\n \tsort_ref_array(packed);\n \tsort_ref_array(loose);\n \twhile (p < packed->nr && l < loose->nr) {\ndiff --git a/refs.h b/refs.h\nindex 00ba1e2..33202b0 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -56,14 +56,6 @@ extern void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refn\n  */\n extern void add_packed_ref(const char *refname, const unsigned char *sha1);\n \n-/*\n- * Extra refs will be listed by for_each_ref() before any actual refs\n- * for the duration of this process or until clear_extra_refs() is\n- * called. Only extra refs added before for_each_ref() is called will\n- * be listed on a given call of for_each_ref().\n- */\n-extern void add_extra_ref(const char *refname, const unsigned char *sha1, int flags);\n-extern void clear_extra_refs(void);\n extern int ref_exists(const char *);\n \n extern int peel_ref(const char *refname, unsigned char *sha1);\n-- \n1.7.9\n"},{"id":"184540","messageId":"7vsjifids5.fsf@alter.siamese.dyndns.org","threadId":"29601","inReplyTo":"1328941261-29746-2-git-send-email-mhagger@alum.mit.edu","subject":"Re: [PATCH 1/7] t5700: document a failure of alternates to affect fetch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-13T03:35:19Z","receivedAt":"2012-02-13T03:35:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"mhagger@alum.mit.edu writes:\n\n> +test_expect_success 'prepare branched repository' '\n> +\tgit clone A J &&\n> +\t(\n> +\t\tcd J &&\n> +\t\tgit checkout -b other master^ &&\n> +\t\techo other > otherfile &&\n\ns/ > / >/; but that is nothing I cannot fix locally.\n\n> +test_expect_failure 'fetch with incomplete alternates' '\n\nI am assuming that this \"incomplete\" means \"this alternate helps reducing\nthe number of objects we need to fetch from the remote, but it does not\nhave everything objects we need, and we still need to fetch some from the\nremote\".  Am I correct?\n\nI do not think you meant the alternate repository is in some way corrupt,\nbut I am just making sure, because I found the phrasing a bit odd.\n"},{"id":"184541","messageId":"7vmx8nids3.fsf@alter.siamese.dyndns.org","threadId":"29601","inReplyTo":"1328941261-29746-3-git-send-email-mhagger@alum.mit.edu","subject":"Re: [PATCH 2/7] clone.c: move more code into the \"if (refs)\" conditional","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-13T03:35:53Z","receivedAt":"2012-02-13T03:35:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"mhagger@alum.mit.edu writes:\n\n> From: Michael Haggerty <mhagger@alum.mit.edu>\n>\n> The bahavior of a bunch of code before the \"if (refs)\" statement also\n> depends on whether refs is set, so make the logic clearer by shifting\n> this code into the if statement.\n>\n> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n> ---\n>  builtin/clone.c |   39 ++++++++++++++++++++-------------------\n>  1 files changed, 20 insertions(+), 19 deletions(-)\n\nNice; the result is much easier to follow.\n"},{"id":"184542","messageId":"7vhayvids1.fsf@alter.siamese.dyndns.org","threadId":"29601","inReplyTo":"1328941261-29746-4-git-send-email-mhagger@alum.mit.edu","subject":"Re: [PATCH 3/7] fetch-pack.c: rename some parameters from \"path\" to \"refname\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-13T03:47:01Z","receivedAt":"2012-02-13T03:47:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"mhagger@alum.mit.edu writes:\n\n> From: Michael Haggerty <mhagger@alum.mit.edu>\n>\n> The parameters denote reference names, which are no longer 1:1 with\n> filesystem paths.\n\nThese three functions are only used as callback from for_each_ref() so\nthey always get the full refname and nothing else (like a partial refname\nlike tags/v1.7.9), so calling them refname makes perfect sense.\n\nEven though I generally try to stay away from this kind of naming churn\npatches, but hopefully there is nothing in flight to cause horrible\nconflict with it.\n\nThanks.\n"},{"id":"184543","messageId":"7vaa4nidrm.fsf@alter.siamese.dyndns.org","threadId":"29601","inReplyTo":"1328941261-29746-7-git-send-email-mhagger@alum.mit.edu","subject":"Re: [PATCH 6/7] clone: do not add alternate references to extra_refs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-13T04:00:13Z","receivedAt":"2012-02-13T04:00:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"mhagger@alum.mit.edu writes:\n\n> From: Michael Haggerty <mhagger@alum.mit.edu>\n>\n> Alternate references are directly (and now, correctly) handled by\n> fetch-pack, so there is no need to inform fetch-pack about them via\n> the extra_refs back channel.\n>\n> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n> ---\n>  builtin/clone.c |   12 ------------\n>  1 files changed, 0 insertions(+), 12 deletions(-)\n\nVery nice (the real niceness primarily comes from the previous step ;-).\n\nThanks.\n"},{"id":"184544","messageId":"4F389567.8060108@alum.mit.edu","threadId":"29601","inReplyTo":"7vsjifids5.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/7] t5700: document a failure of alternates to affect fetch","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2012-02-13T04:45:27Z","receivedAt":"2012-02-13T04:45:27Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 02/13/2012 04:35 AM, Junio C Hamano wrote:\n> mhagger@alum.mit.edu writes:\n> \n>> +test_expect_success 'prepare branched repository' '\n>> +\tgit clone A J &&\n>> +\t(\n>> +\t\tcd J &&\n>> +\t\tgit checkout -b other master^ &&\n>> +\t\techo other > otherfile &&\n> \n> s/ > / >/; but that is nothing I cannot fix locally.\n> \n>> +test_expect_failure 'fetch with incomplete alternates' '\n> \n> I am assuming that this \"incomplete\" means \"this alternate helps reducing\n> the number of objects we need to fetch from the remote, but it does not\n> have everything objects we need, and we still need to fetch some from the\n> remote\".  Am I correct?\n\nCorrect.  Feel free to improve the description if you can think of a\nbetter way to describe it.\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"},{"id":"184725","messageId":"20120214225113.GA25558@sigill.intra.peff.net","threadId":"29601","inReplyTo":"1328941261-29746-1-git-send-email-mhagger@alum.mit.edu","subject":"Re: [PATCH 0/7] Make alternates affect fetch behavior","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-14T22:51:13Z","receivedAt":"2012-02-14T22:51:13Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Feb 11, 2012 at 07:20:54AM +0100, mhagger@alum.mit.edu wrote:\n\n> It used to be that alternate references were not considered \"complete\"\n> when fetching via fetch-pack.  This failure was not so obvious because\n> the big benefit of alternates is seen when cloning, and clone used a\n> different data path: it put the alternate references into extra refs\n> (which makes them look like references within the local repository).\n> \n> This patch series teaches fetch-pack to treat objects that are\n> available via alternates as \"complete\".\n> \n> Once that is fixed, clone doesn't need to use the special extra_refs\n> kludge, so change that.\n> \n> And once that is changed, the extra_refs API is no longer needed at\n> all, so remove it.\n> \n> Michael Haggerty (7):\n>   t5700: document a failure of alternates to affect fetch\n>   clone.c: move more code into the \"if (refs)\" conditional\n>   fetch-pack.c: rename some parameters from \"path\" to \"refname\"\n>   fetch-pack.c: inline insert_alternate_refs()\n>   everything_local(): mark alternate refs as complete\n>   clone: do not add alternate references to extra_refs\n>   refs: remove the extra_refs API\n\n>From my reading, all of these patches look good. Thanks for a\nwell-organized series.\n\n-Peff\n"}]}