{"thread":{"id":"745","subject":"[PATCH] Add -O<orderfile> option to diff-* brothers.","startedAt":"2005-05-28T09:54:39Z","lastAt":"2005-05-30T07:35:39Z","messageCount":13,"participants":["Junio C Hamano","Thomas Glanzmann","Petr Baudis","Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4128","messageId":"7vzmufwu8w.fsf@assigned-by-dhcp.cox.net","threadId":"745","inReplyTo":null,"subject":"[PATCH] Add -O<orderfile> option to diff-* brothers.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-28T09:54:39Z","receivedAt":"2005-05-28T09:54:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"A new diffcore filter diffcore-order is introduced.  This takes\na text file each of whose line is a shell glob pattern.  Patches\nmatching the glob pattern on an earlier line in the file are\noutput before patches matching the glob pattern on a later line,\nand patches not matching any glob pattern is output last.\n\nA typical orderfile for git project would probably look like\nthis:\n\n    README\n    Documentation\n    Makefile\n    *.h\n    *.c\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\nDocumentation/git-diff-cache.txt |    6 +\nDocumentation/git-diff-files.txt |    6 +\nDocumentation/git-diff-tree.txt  |    6 +\nMakefile                         |    3 \ndiff-cache.c                     |    7 ++\ndiff-files.c                     |    5 +\ndiff-tree.c                      |    7 ++\ndiff.h                           |    2 \ndiffcore-order.c                 |  121 +++++++++++++++++++++++++++++++++++++++\n9 files changed, 159 insertions(+), 4 deletions(-)\nnew file (100644): diffcore-order.c\n\ndiff --git a/Documentation/git-diff-cache.txt b/Documentation/git-diff-cache.txt\n--- a/Documentation/git-diff-cache.txt\n+++ b/Documentation/git-diff-cache.txt\n@@ -9,7 +9,7 @@ git-diff-cache - Compares content and mo\n \n SYNOPSIS\n --------\n-'git-diff-cache' [-p] [-r] [-z] [-m] [-M] [-R] [-C] [-S<string>] [--pickaxe-all] [--cached] <tree-ish> [<path>...]\n+'git-diff-cache' [-p] [-r] [-z] [-m] [-M] [-R] [-C] [-O<orderfile>] [-S<string>] [--pickaxe-all] [--cached] <tree-ish> [<path>...]\n \n DESCRIPTION\n -----------\n@@ -49,6 +49,10 @@ OPTIONS\n \tchangeset, not just the files that contains the change\n \tin <string>.\n \n+-O<orderfile>::\n+\tOutput the patch in the order specified in the\n+\t<orderfile>, which has one shell glob pattern per line.\n+\n -R::\n \tOutput diff in reverse.\n \ndiff --git a/Documentation/git-diff-files.txt b/Documentation/git-diff-files.txt\n--- a/Documentation/git-diff-files.txt\n+++ b/Documentation/git-diff-files.txt\n@@ -9,7 +9,7 @@ git-diff-files - Compares files in the w\n \n SYNOPSIS\n --------\n-'git-diff-files' [-p] [-q] [-r] [-z] [-M] [-C] [-R] [-S<string>] [--pickaxe-all] [<pattern>...]\n+'git-diff-files' [-p] [-q] [-r] [-z] [-M] [-C] [-R] [-O<orderfile>] [-S<string>] [--pickaxe-all] [<pattern>...]\n \n DESCRIPTION\n -----------\n@@ -43,6 +43,10 @@ OPTIONS\n \tchangeset, not just the files that contains the change\n \tin <string>.\n \n+-O<orderfile>::\n+\tOutput the patch in the order specified in the\n+\t<orderfile>, which has one shell glob pattern per line.\n+\n -r::\n \tThis flag does not mean anything.  It is there only to match\n \tgit-diff-tree.  Unlike git-diff-tree, git-diff-files always looks\ndiff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt\n--- a/Documentation/git-diff-tree.txt\n+++ b/Documentation/git-diff-tree.txt\n@@ -9,7 +9,7 @@ git-diff-tree - Compares the content and\n \n SYNOPSIS\n --------\n-'git-diff-tree' [-p] [-r] [-z] [--stdin] [-M] [-R] [-C] [-S<string>] [--pickaxe-all] [-m] [-s] [-v] [-t] <tree-ish> <tree-ish> [<pattern>]\\*\n+'git-diff-tree' [-p] [-r] [-z] [--stdin] [-M] [-R] [-C] [-O<orderfile>] [-S<string>] [--pickaxe-all] [-m] [-s] [-v] [-t] <tree-ish> <tree-ish> [<pattern>]\\*\n \n DESCRIPTION\n -----------\n@@ -50,6 +50,10 @@ OPTIONS\n \tchangeset, not just the files that contains the change\n \tin <string>.\n \n+-O<orderfile>::\n+\tOutput the patch in the order specified in the\n+\t<orderfile>, which has one shell glob pattern per line.\n+\n -r::\n \trecurse\n \ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -48,7 +48,7 @@ LIB_OBJS += strbuf.o\n \n LIB_H += diff.h count-delta.h\n LIB_OBJS += diff.o diffcore-rename.o diffcore-pickaxe.o diffcore-pathspec.o \\\n-\tcount-delta.o\n+\tcount-delta.o diffcore-order.o\n \n LIB_OBJS += gitenv.o\n \n@@ -130,6 +130,7 @@ diff.o: $(LIB_H) diffcore.h\n diffcore-rename.o : $(LIB_H) diffcore.h\n diffcore-pathspec.o : $(LIB_H) diffcore.h\n diffcore-pickaxe.o : $(LIB_H) diffcore.h\n+diffcore-order.o : $(LIB_H) diffcore.h\n \n test: all\n \t$(MAKE) -C t/ all\ndiff --git a/diff-cache.c b/diff-cache.c\n--- a/diff-cache.c\n+++ b/diff-cache.c\n@@ -9,6 +9,7 @@ static int diff_setup_opt = 0;\n static int diff_score_opt = 0;\n static const char *pickaxe = NULL;\n static int pickaxe_opts = 0;\n+static const char *orderfile = NULL;\n \n /* A file entry went away or appeared */\n static void show_file(const char *prefix, struct cache_entry *ce, unsigned char *sha1, unsigned int mode)\n@@ -210,6 +211,10 @@ int main(int argc, const char **argv)\n \t\t\tpickaxe = arg + 2;\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strncmp(arg, \"-O\", 2)) {\n+\t\t\torderfile = arg + 2;\n+\t\t\tcontinue;\n+\t\t}\n \t\tif (!strcmp(arg, \"--pickaxe-all\")) {\n \t\t\tpickaxe_opts = DIFF_PICKAXE_ALL;\n \t\t\tcontinue;\n@@ -246,6 +251,8 @@ int main(int argc, const char **argv)\n \t\tdiffcore_rename(detect_rename, diff_score_opt);\n \tif (pickaxe)\n \t\tdiffcore_pickaxe(pickaxe, pickaxe_opts);\n+\tif (orderfile)\n+\t\tdiffcore_order(orderfile);\n \tdiff_flush(diff_output_format, 1);\n \treturn ret;\n }\ndiff --git a/diff-files.c b/diff-files.c\n--- a/diff-files.c\n+++ b/diff-files.c\n@@ -15,6 +15,7 @@ static int diff_setup_opt = 0;\n static int diff_score_opt = 0;\n static const char *pickaxe = NULL;\n static int pickaxe_opts = 0;\n+static const char *orderfile = NULL;\n static int silent = 0;\n \n static void show_unmerge(const char *path)\n@@ -55,6 +56,8 @@ int main(int argc, const char **argv)\n \t\t\tdiff_setup_opt |= DIFF_SETUP_REVERSE;\n \t\telse if (!strncmp(argv[1], \"-S\", 2))\n \t\t\tpickaxe = argv[1] + 2;\n+\t\telse if (!strncmp(argv[1], \"-O\", 2))\n+\t\t\torderfile = argv[1] + 2;\n \t\telse if (!strcmp(argv[1], \"--pickaxe-all\"))\n \t\t\tpickaxe_opts = DIFF_PICKAXE_ALL;\n \t\telse if (!strncmp(argv[1], \"-M\", 2)) {\n@@ -122,6 +125,8 @@ int main(int argc, const char **argv)\n \t\tdiffcore_rename(detect_rename, diff_score_opt);\n \tif (pickaxe)\n \t\tdiffcore_pickaxe(pickaxe, pickaxe_opts);\n+\tif (orderfile)\n+\t\tdiffcore_order(orderfile);\n \tdiff_flush(diff_output_format, 1);\n \treturn 0;\n }\ndiff --git a/diff-tree.c b/diff-tree.c\n--- a/diff-tree.c\n+++ b/diff-tree.c\n@@ -14,6 +14,7 @@ static int diff_setup_opt = 0;\n static int diff_score_opt = 0;\n static const char *pickaxe = NULL;\n static int pickaxe_opts = 0;\n+static const char *orderfile = NULL;\n static const char *header = NULL;\n static const char *header_prefix = \"\";\n \n@@ -269,6 +270,8 @@ static int call_diff_flush(void)\n \t\tdiff_flush(DIFF_FORMAT_NO_OUTPUT, 0);\n \t\treturn 0;\n \t}\n+\tif (orderfile)\n+\t\tdiffcore_order(orderfile);\n \tif (header) {\n \t\tconst char *fmt = \"%s\";\n \t\tif (diff_output_format == DIFF_FORMAT_MACHINE)\n@@ -510,6 +513,10 @@ int main(int argc, const char **argv)\n \t\t\tpickaxe = arg + 2;\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strncmp(arg, \"-O\", 2)) {\n+\t\t\torderfile = arg + 2;\n+\t\t\tcontinue;\n+\t\t}\n \t\tif (!strcmp(arg, \"--pickaxe-all\")) {\n \t\t\tpickaxe_opts = DIFF_PICKAXE_ALL;\n \t\t\tcontinue;\ndiff --git a/diff.h b/diff.h\n--- a/diff.h\n+++ b/diff.h\n@@ -43,6 +43,8 @@ extern void diffcore_pickaxe(const char \n \n extern void diffcore_pathspec(const char **pathspec);\n \n+extern void diffcore_order(const char *orderfile);\n+\n extern int diff_queue_is_empty(void);\n \n #define DIFF_FORMAT_HUMAN\t0\ndiff --git a/diffcore-order.c b/diffcore-order.c\nnew file mode 100644\n--- /dev/null\n+++ b/diffcore-order.c\n@@ -0,0 +1,121 @@\n+/*\n+ * Copyright (C) 2005 Junio C Hamano\n+ */\n+#include \"cache.h\"\n+#include \"diff.h\"\n+#include \"diffcore.h\"\n+#include <fnmatch.h>\n+\n+static char **order;\n+static int order_cnt;\n+\n+static void prepare_order(const char *orderfile)\n+{\n+\tint fd, cnt, pass;\n+\tvoid *map;\n+\tchar *cp, *endp;\n+\tstruct stat st;\n+\n+\tif (order)\n+\t\treturn;\n+\n+\tfd = open(orderfile, O_RDONLY);\n+\tif (fd < 0)\n+\t\treturn;\n+\tif (fstat(fd, &st)) {\n+\t\tclose(fd);\n+\t\treturn;\n+\t}\n+\tmap = mmap(NULL, st.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);\n+\tclose(fd);\n+\tif (-1 == (int)(long)map)\n+\t\treturn;\n+\tendp = map + st.st_size;\n+\tfor (pass = 0; pass < 2; pass++) {\n+\t\tcnt = 0;\n+\t\tcp = map;\n+\t\twhile (cp < endp) {\n+\t\t\tchar *ep;\n+\t\t\tfor (ep = cp; ep < endp && *ep != '\\n'; ep++)\n+\t\t\t\t;\n+\t\t\t/* cp to ep has one line */\n+\t\t\tif (*cp == '\\n' || *cp == '#')\n+\t\t\t\t; /* comment */\n+\t\t\telse if (pass == 0)\n+\t\t\t\tcnt++;\n+\t\t\telse {\n+\t\t\t\tif (*ep == '\\n') {\n+\t\t\t\t\t*ep = 0;\n+\t\t\t\t\torder[cnt] = cp;\n+\t\t\t\t}\n+\t\t\t\telse {\n+\t\t\t\t\torder[cnt] = xmalloc(ep-cp+1);\n+\t\t\t\t\tmemcpy(order[cnt], cp, ep-cp);\n+\t\t\t\t\torder[cnt][ep-cp] = 0;\n+\t\t\t\t}\n+\t\t\t\tcnt++;\n+\t\t\t}\n+\t\t\tif (ep < endp)\n+\t\t\t\tep++;\n+\t\t\tcp = ep;\n+\t\t}\n+\t\tif (pass == 0) {\n+\t\t\torder_cnt = cnt;\n+\t\t\torder = xmalloc(sizeof(*order) * cnt);\n+\t\t}\n+\t}\n+}\n+\n+struct pair_order {\n+\tstruct diff_filepair *pair;\n+\tint orig_order;\n+\tint order;\n+};\n+\n+static int match_order(const char *path)\n+{\n+\tint i;\n+\tchar p[PATH_MAX];\n+\n+\tfor (i = 0; i < order_cnt; i++) {\n+\t\tstrcpy(p, path);\n+\t\twhile (p[0]) {\n+\t\t\tchar *cp;\n+\t\t\tif (!fnmatch(order[i], p, 0))\n+\t\t\t\treturn i;\n+\t\t\tcp = strrchr(p, '/');\n+\t\t\tif (!cp)\n+\t\t\t\tbreak;\n+\t\t\t*cp = 0;\n+\t\t}\n+\t}\n+\treturn order_cnt;\n+}\n+\n+static int compare_pair_order(const void *a_, const void *b_)\n+{\n+\tstruct pair_order const *a, *b;\n+\ta = (struct pair_order const *)a_;\n+\tb = (struct pair_order const *)b_;\n+\tif (a->order != b->order)\n+\t\treturn a->order - b->order;\n+\treturn a->orig_order - b->orig_order;\n+}\n+\n+void diffcore_order(const char *orderfile)\n+{\n+\tstruct diff_queue_struct *q = &diff_queued_diff;\n+\tstruct pair_order *o = xmalloc(sizeof(*o) * q->nr);\n+\tint i;\n+\n+\tprepare_order(orderfile);\n+\tfor (i = 0; i < q->nr; i++) {\n+\t\to[i].pair = q->queue[i];\n+\t\to[i].orig_order = i;\n+\t\to[i].order = match_order(o[i].pair->two->path);\n+\t}\n+\tqsort(o, q->nr, sizeof(*o), compare_pair_order);\n+\tfor (i = 0; i < q->nr; i++)\n+\t\tq->queue[i] = o[i].pair;\n+\treturn;\n+}\n------------------------------------------------\n\n"},{"id":"4132","messageId":"20050528105914.GA8467@cip.informatik.uni-erlangen.de","threadId":"745","inReplyTo":"7vzmufwu8w.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Pickaxe fixes.","fromName":"Thomas Glanzmann","fromEmail":"sithglan@stud.uni-erlangen.de","sentAt":"2005-05-28T10:59:14Z","receivedAt":"2005-05-28T10:59:14Z","isPatch":true,"sender":{"key":"sithglan@stud.uni-erlangen.de","avatar":null},"body":"Hello,\n\n> Also updates the documentation to describe the --pickaxe-all option.\n> A typical orderfile for git project would probably look like this ...\n\nI can't believe it. I began to support pickaxe this morning in my little\ngit frontend and thought about exactly these two questions (patch\nordering and show me all deltas in the matched changeset). Thanks for\nthe patches! Btw. When doing the.  'git-whatchanged drivers/ide' thing\n... does that show only deltas which happened actually in this tree or\nif a changeset contains deltas inside and outside?\n\n\tThomas\n"},{"id":"4133","messageId":"20050528111238.GA1036@pasky.ji.cz","threadId":"745","inReplyTo":"7vzmufwu8w.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add -O<orderfile> option to diff-* brothers.","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-28T11:12:38Z","receivedAt":"2005-05-28T11:12:38Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sat, May 28, 2005 at 11:54:39AM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> told me that...\n> A new diffcore filter diffcore-order is introduced.  This takes\n> a text file each of whose line is a shell glob pattern.  Patches\n> matching the glob pattern on an earlier line in the file are\n> output before patches matching the glob pattern on a later line,\n> and patches not matching any glob pattern is output last.\n> \n> A typical orderfile for git project would probably look like\n> this:\n> \n>     README\n>     Documentation\n>     Makefile\n>     *.h\n>     *.c\n> \n> Signed-off-by: Junio C Hamano <junkio@cox.net>\n\nHmm, is this really useful in practice? diff itself doesn't appear to\nhave it either, and I haven't seen something like this before. So is it\nworth the code?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"4134","messageId":"20050528111959.GA28780@cip.informatik.uni-erlangen.de","threadId":"745","inReplyTo":"20050528111238.GA1036@pasky.ji.cz","subject":"Re: [PATCH] Add -O<orderfile> option to diff-* brothers.","fromName":"Thomas Glanzmann","fromEmail":"sithglan@stud.uni-erlangen.de","sentAt":"2005-05-28T11:19:59Z","receivedAt":"2005-05-28T11:19:59Z","isPatch":true,"sender":{"key":"sithglan@stud.uni-erlangen.de","avatar":null},"body":"Hello,\n\n> Hmm, is this really useful in practice? diff itself doesn't appear to\n> have it either, and I haven't seen something like this before. So is it\n> worth the code?\n\nI think it is. For example on git development it is nice to see the\nDocumentation first. So you know what it is supposed to do and later you\nsee the actual implementation. I think Junio requested this exactly\nbefore.\n\n\tThoms\n"},{"id":"4140","messageId":"7vu0knuy36.fsf@assigned-by-dhcp.cox.net","threadId":"745","inReplyTo":"20050528111238.GA1036@pasky.ji.cz","subject":"Re: [PATCH] Add -O<orderfile> option to diff-* brothers.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-28T16:14:37Z","receivedAt":"2005-05-28T16:14:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"PB\" == Petr Baudis <pasky@ucw.cz> writes:\n\nPB> Hmm, is this really useful in practice? diff itself doesn't appear to\nPB> have it either, and I haven't seen something like this before. So is it\nPB> worth the code?\n\nCVS nor SVN does not do pickaxe as far as I know either, but I\nthink some people in GIT community are already having fun with\npickaxe.\n\nThe amount of the code is small, and it does not impact if you\ndo not use the option.  I am more concerned by (1) the fact that\neach new diffcore filters would carve out its own niche from the\nscarse command option namespace; (2) you have to duplicate the\noption parsing in all three diff-* brothers; and (3) diff-tree\nis sometimes an odd-man-out among those three and it is not so\nsimple to unify the option parsing.  A help in that area is very\nmuch appreciated.\n\n"},{"id":"4141","messageId":"7vpsvbuxzb.fsf@assigned-by-dhcp.cox.net","threadId":"745","inReplyTo":"20050528105914.GA8467@cip.informatik.uni-erlangen.de","subject":"Re: [PATCH] Pickaxe fixes.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-28T16:16:56Z","receivedAt":"2005-05-28T16:16:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"TG\" == Thomas Glanzmann <sithglan@stud.uni-erlangen.de> writes:\n\nTG> Btw. When doing the.  'git-whatchanged drivers/ide' thing\nTG> ... does that show only deltas which happened actually in\nTG> this tree or if a changeset contains deltas inside and\nTG> outside?\n\nThat's up to Linus right now.  The behaviour is different\nbefore and after the 12-part patch I sent out yesterday [*1*].\n\nMy earlier thinking was to use the pathspec (e.g. drivers/ide)\nas the output filter, but Linus corrected me yesterday morning\nthat he wants the pathspec as the input filter.  What this means\nto your question is:\n\n - Under my earlier thinking, if drivers/ide/foo is a rename\n   from drivers/usb/bar, diffcore gets both creation of foo and\n   deletion of bar, diffcore-rename matches them up, and\n   diffcore-pathspec filters the output to drivers/ide tree.\n   Earlier pathspec picked up filepair that had the specified\n   path on either src or dst side, so this would have been shown\n   as a rename from usb/bar to ide/foo.\n\n - After the 12-part patch, the pathspec comes first and\n   establishes a narrowed down world we operate in.  So in the\n   same situation, diffcore is fed only creation of foo but does\n   not see deletion of bar (which happened in drivers/usb, which\n   is outside our world).  Hence diffcore-rename does not have\n   anything to match up and this would be shown as a creation of\n   ide/foo.\n\nI agree with Linus that the latter is the semantics we usually\nwant.  If we make diffcore filters stackable (I mean, the order\nof applications controllable by the program and the user), we\ncould also have the older semantics when the user wants it, but\nI would do that after this series stabilizes.\n\n\n[Footnote]\n\n*1* When I talk about time of the day, it is in US Pacific\ntimezone.\n\n\n\n"},{"id":"4143","messageId":"20050528162257.GE4881@cip.informatik.uni-erlangen.de","threadId":"745","inReplyTo":"7vpsvbuxzb.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Pickaxe fixes.","fromName":"Thomas Glanzmann","fromEmail":"sithglan@stud.uni-erlangen.de","sentAt":"2005-05-28T16:22:57Z","receivedAt":"2005-05-28T16:22:57Z","isPatch":true,"sender":{"key":"sithglan@stud.uni-erlangen.de","avatar":null},"body":"Hello,\n\n> I agree with Linus that the latter is the semantics we usually\n> want.  If we make diffcore filters stackable (I mean, the order\n> of applications controllable by the program and the user), we\n> could also have the older semantics when the user wants it, but\n> I would do that after this series stabilizes.\n\nthanks for the elaboration on this topic. However at the moment I don't\nhave an opinion on this, I have to use it a bit longer. But it is a good\nthing that I know by now that it limits its view to the subdirectory\nafter your patch-train is applied.\n\n\tThomas\n"},{"id":"4142","messageId":"7vk6ljuxlt.fsf@assigned-by-dhcp.cox.net","threadId":"745","inReplyTo":"20050528111959.GA28780@cip.informatik.uni-erlangen.de","subject":"Re: [PATCH] Add -O<orderfile> option to diff-* brothers.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-28T16:25:02Z","receivedAt":"2005-05-28T16:25:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"TG\" == Thomas Glanzmann <sithglan@stud.uni-erlangen.de> writes:\n\nTG> I think it is. For example on git development it is nice to see the\nTG> Documentation first. So you know what it is supposed to do and later you\nTG> see the actual implementation. I think Junio requested this exactly\nTG> before.\n\nWell, yes and no.  I do want to see the patches in the suggested\norder because that would make things easier to understand if\nthey are related.\n\nThe request you are referring to was not about the order of\npatches in one e-mail message.  It was more like \"please show us\ndocumentation first so that we can pick nits in the design (goal\nof implementation) before you start to code\".  That way, if\nthere were a change (like -A flag in checkout-cache) that people\nwould find objectionable, the effort to code the change and\nthe effort to review the code can both be saved.\n\n"},{"id":"4144","messageId":"7vekbruwom.fsf@assigned-by-dhcp.cox.net","threadId":"745","inReplyTo":"7vzmufwu8w.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Fix leak in diffcore-order.c","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-28T16:44:57Z","receivedAt":"2005-05-28T16:44:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"A temporary array used for sorting the filepairs were not freed\nafter use.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\ndiffcore-order.c |    1 +\n1 files changed, 1 insertion(+)\n\ndiff --git a/diffcore-order.c b/diffcore-order.c\n--- a/diffcore-order.c\n+++ b/diffcore-order.c\n@@ -117,5 +117,6 @@ void diffcore_order(const char *orderfil\n \tqsort(o, q->nr, sizeof(*o), compare_pair_order);\n \tfor (i = 0; i < q->nr; i++)\n \t\tq->queue[i] = o[i].pair;\n+\tfree(o);\n \treturn;\n }\n------------------------------------------------\n\n"},{"id":"4187","messageId":"Pine.LNX.4.58.0505291154030.10545@ppc970.osdl.org","threadId":"745","inReplyTo":"7vzmufwu8w.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add -O<orderfile> option to diff-* brothers.","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-29T18:56:10Z","receivedAt":"2005-05-29T18:56:10Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sat, 28 May 2005, Junio C Hamano wrote:\n>\n> A new diffcore filter diffcore-order is introduced.  This takes\n> a text file each of whose line is a shell glob pattern.  Patches\n> matching the glob pattern on an earlier line in the file are\n> output before patches matching the glob pattern on a later line,\n> and patches not matching any glob pattern is output last.\n\nThis smells to me like a \"cool feature, because we can\" rather than a\n\"this is useful because of xxx\".\n\nYou could equally well do it with \n\n\tgit-diff-cache .. | sort-filenames | git-diff-helper\n\nin porcelain, if somebody really wants this (but I can't see people \nclamoring for it, since nobody else has ever done soemthing like this, \nafaik).\n\nIn other words: what is the problem this is trying to solve?\n\n\t\tLinus\n"},{"id":"4194","messageId":"7vll5xkc3a.fsf@assigned-by-dhcp.cox.net","threadId":"745","inReplyTo":"Pine.LNX.4.58.0505291154030.10545@ppc970.osdl.org","subject":"Re: [PATCH] Add -O<orderfile> option to diff-* brothers.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-29T20:32:09Z","receivedAt":"2005-05-29T20:32:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"LT\" == Linus Torvalds <torvalds@osdl.org> writes:\n\nLT> This smells to me like a \"cool feature, because we can\"\nLT> rather than a \"this is useful because of xxx\".\n\nYou could even do the rename/copy detection outside with a\nstandalone diff-raw filter, just like your \"sort-filenames\" pipe\nexample.  Rename/copy is not done that way primarily for the\nperformance reasons.  Pickaxe is not done that way because we\nwanted to conditionally suppress diff-tree headers, and it is\neasier to implement the suppression inside rather than as a\n\"sort-filename\" like filter.\n\nThis diffcore-order is more like \"cool feature, because we can,\n_and_ it is simpler to do it inside rather than outside, now we\nalready have the infrastructure inside to do this kind of thing\nfor other purposes anyway\".\n\n\n\n\n"},{"id":"4221","messageId":"7vekbpftp4.fsf@assigned-by-dhcp.cox.net","threadId":"745","inReplyTo":"Pine.LNX.4.58.0505291154030.10545@ppc970.osdl.org","subject":"Re: [PATCH] Add -O<orderfile> option to diff-* brothers.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-30T00:23:03Z","receivedAt":"2005-05-30T00:23:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"LT\" == Linus Torvalds <torvalds@osdl.org> writes:\n\nI realize I did not answer your question.\n\nLT> In other words: what is the problem this is trying to solve?\n\nTo produce a patch that is easier to review, using customized\npatch order list for projects.  I envision that Porcelain\nnoticing the existence of ${GIT-.git}/patch-order file and\nadding -O to its diff-* argument would make the world a better\nplace.\n\n"},{"id":"4240","messageId":"7vk6lh6u9g.fsf@assigned-by-dhcp.cox.net","threadId":"745","inReplyTo":"20050528162257.GE4881@cip.informatik.uni-erlangen.de","subject":"Re: [PATCH] Pickaxe fixes.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-30T07:35:39Z","receivedAt":"2005-05-30T07:35:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"TG\" == Thomas Glanzmann <sithglan@stud.uni-erlangen.de> writes:\n\nTG> ... However at the moment I don't\nTG> have an opinion on this, I have to use it a bit longer. But it is a good\nTG> thing that I know by now that it limits its view to the subdirectory\nTG> after your patch-train is applied.\n\nYour opinion on this would not count anymore ;-).  Pathspec is now\nat the beginning of the processiong chain.\n\n"}]}