{"thread":{"id":"20922","subject":"[PATCH] diffcore-order: Default the order file to .git/info/order.","startedAt":"2009-09-12T23:49:48Z","lastAt":"2009-09-12T23:49:48Z","messageCount":1,"participants":["Geoffrey Thomas"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"123015","messageId":"1252799388-16295-1-git-send-email-geofft@mit.edu","threadId":"20922","inReplyTo":null,"subject":"[PATCH] diffcore-order: Default the order file to .git/info/order.","fromName":"Geoffrey Thomas","fromEmail":"geofft@mit.edu","sentAt":"2009-09-12T23:49:48Z","receivedAt":"2009-09-12T23:49:48Z","isPatch":true,"sender":{"key":"geofft@mit.edu","avatar":"https://gravatar.com/avatar/97e2e046698e0410999c17f55c50454e4d6bd1e5091d11beb2ba2c4d8a022fca?d=mp&s=160"},"body":"Since order files tend to be useful for all operations in the\nproject/repository, add a default location for the order file, so that\nyou don't have to specify -O<orderfile> on every diff or similar\noperation.\n\nSigned-off-by: Geoffrey Thomas <geofft@mit.edu>\n---\n diff.c           |    3 +--\n diffcore-order.c |    6 ++++++\n 2 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex e1be189..148342c 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -3461,8 +3461,7 @@ void diffcore_std(struct diff_options *options)\n \t\tdiffcore_merge_broken();\n \tif (options->pickaxe)\n \t\tdiffcore_pickaxe(options->pickaxe, options->pickaxe_opts);\n-\tif (options->orderfile)\n-\t\tdiffcore_order(options->orderfile);\n+\tdiffcore_order(options->orderfile);\n \tdiff_resolve_rename_copy();\n \tdiffcore_apply_filter(options->filter);\n \ndiff --git a/diffcore-order.c b/diffcore-order.c\nindex 23e9385..d116dc9 100644\n--- a/diffcore-order.c\n+++ b/diffcore-order.c\n@@ -109,6 +109,12 @@ void diffcore_order(const char *orderfile)\n \tif (!q->nr)\n \t\treturn;\n \n+\tif (!orderfile) {\n+\t\torderfile = git_path(\"info/order\");\n+\t\tif (access(orderfile, R_OK) != 0)\n+\t\t\treturn;\n+\t}\n+\n \to = xmalloc(sizeof(*o) * q->nr);\n \tprepare_order(orderfile);\n \tfor (i = 0; i < q->nr; i++) {\n-- \n1.5.6.5\n"}]}