{"thread":{"id":"3398","subject":"[PATCH] rev-list --objects-edge","startedAt":"2006-02-19T23:28:02Z","lastAt":"2006-02-19T23:28:02Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"16430","messageId":"7virrbexod.fsf@assigned-by-dhcp.cox.net","threadId":"3398","inReplyTo":null,"subject":"[PATCH] rev-list --objects-edge","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-19T23:28:02Z","receivedAt":"2006-02-19T23:28:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This new flag is similar to --objects, but causes rev-list to\nshow list of \"uninteresting\" commits that appear on the edge\ncommit prefixed with '-'.\n\nDownstream pack-objects will be changed to take these as hints\nto use the trees and blobs contained with them as base objects\nof resulting pack, producing an incomplete (not self-contained)\npack.\n\nSuch a pack cannot be used in .git/objects/pack (it is prevented\nby git-index-pack erroring out if it is fed to git-fetch-pack -k\nor git-clone-pack), but would be useful when transferring only\nsmall changes to huge blobs.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n * Together with \"thin-pack\" patch I'll send next, this will\n   allow you to do the \"delta transfer\" we discussed on the #git\n   channel last night (eh, *my* last night anyway).\n\n rev-list.c  |   34 ++++++++++++++++++++++++++++------\n rev-parse.c |    1 +\n 2 files changed, 29 insertions(+), 6 deletions(-)\n\n52de788e6094b31be218f0f69576cbbfb310205f\ndiff --git a/rev-list.c b/rev-list.c\nindex f2d1105..373549e 100644\n--- a/rev-list.c\n+++ b/rev-list.c\n@@ -30,7 +30,7 @@ static const char rev_list_usage[] =\n \"    --date-order\\n\"\n \"  formatting output:\\n\"\n \"    --parents\\n\"\n-\"    --objects\\n\"\n+\"    --objects | --objects-edge\\n\"\n \"    --unpacked\\n\"\n \"    --header | --pretty\\n\"\n \"    --abbrev=nr | --no-abbrev\\n\"\n@@ -44,6 +44,7 @@ static int bisect_list = 0;\n static int tag_objects = 0;\n static int tree_objects = 0;\n static int blob_objects = 0;\n+static int edge_hint = 0;\n static int verbose_header = 0;\n static int abbrev = DEFAULT_ABBREV;\n static int show_parents = 0;\n@@ -430,16 +431,30 @@ static struct commit_list *find_bisectio\n \treturn best;\n }\n \n+static void mark_edge_parents_uninteresting(struct commit *commit)\n+{\n+\tstruct commit_list *parents;\n+\n+\tfor (parents = commit->parents; parents; parents = parents->next) {\n+\t\tstruct commit *parent = parents->item;\n+\t\tif (!(parent->object.flags & UNINTERESTING))\n+\t\t\tcontinue;\n+\t\tmark_tree_uninteresting(parent->tree);\n+\t\tif (edge_hint)\n+\t\t\tprintf(\"-%s\\n\", sha1_to_hex(parent->object.sha1));\n+\t}\n+}\n+\n static void mark_edges_uninteresting(struct commit_list *list)\n {\n \tfor ( ; list; list = list->next) {\n-\t\tstruct commit_list *parents = list->item->parents;\n+\t\tstruct commit *commit = list->item;\n \n-\t\tfor ( ; parents; parents = parents->next) {\n-\t\t\tstruct commit *commit = parents->item;\n-\t\t\tif (commit->object.flags & UNINTERESTING)\n-\t\t\t\tmark_tree_uninteresting(commit->tree);\n+\t\tif (commit->object.flags & UNINTERESTING) {\n+\t\t\tmark_tree_uninteresting(commit->tree);\n+\t\t\tcontinue;\n \t\t}\n+\t\tmark_edge_parents_uninteresting(commit);\n \t}\n }\n \n@@ -843,6 +858,13 @@ int main(int argc, const char **argv)\n \t\t\tblob_objects = 1;\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strcmp(arg, \"--objects-edge\")) {\n+\t\t\ttag_objects = 1;\n+\t\t\ttree_objects = 1;\n+\t\t\tblob_objects = 1;\n+\t\t\tedge_hint = 1;\n+\t\t\tcontinue;\n+\t\t}\n \t\tif (!strcmp(arg, \"--unpacked\")) {\n \t\t\tunpacked = 1;\n \t\t\tlimited = 1;\ndiff --git a/rev-parse.c b/rev-parse.c\nindex a5fb93c..610eacb 100644\n--- a/rev-parse.c\n+++ b/rev-parse.c\n@@ -43,6 +43,7 @@ static int is_rev_argument(const char *a\n \t\t\"--min-age=\",\n \t\t\"--no-merges\",\n \t\t\"--objects\",\n+\t\t\"--objects-edge\",\n \t\t\"--parents\",\n \t\t\"--pretty\",\n \t\t\"--show-breaks\",\n-- \n1.2.2.g0d27\n"}]}