git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] diffcore-order: Default the order file to .git/info/order.
@ 2009-09-12 23:49 Geoffrey Thomas
  0 siblings, 0 replies; only message in thread
From: Geoffrey Thomas @ 2009-09-12 23:49 UTC (permalink / raw)
  To: git; +Cc: Geoffrey Thomas

Since order files tend to be useful for all operations in the
project/repository, add a default location for the order file, so that
you don't have to specify -O<orderfile> on every diff or similar
operation.

Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
---
 diff.c           |    3 +--
 diffcore-order.c |    6 ++++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/diff.c b/diff.c
index e1be189..148342c 100644
--- a/diff.c
+++ b/diff.c
@@ -3461,8 +3461,7 @@ void diffcore_std(struct diff_options *options)
 		diffcore_merge_broken();
 	if (options->pickaxe)
 		diffcore_pickaxe(options->pickaxe, options->pickaxe_opts);
-	if (options->orderfile)
-		diffcore_order(options->orderfile);
+	diffcore_order(options->orderfile);
 	diff_resolve_rename_copy();
 	diffcore_apply_filter(options->filter);
 
diff --git a/diffcore-order.c b/diffcore-order.c
index 23e9385..d116dc9 100644
--- a/diffcore-order.c
+++ b/diffcore-order.c
@@ -109,6 +109,12 @@ void diffcore_order(const char *orderfile)
 	if (!q->nr)
 		return;
 
+	if (!orderfile) {
+		orderfile = git_path("info/order");
+		if (access(orderfile, R_OK) != 0)
+			return;
+	}
+
 	o = xmalloc(sizeof(*o) * q->nr);
 	prepare_order(orderfile);
 	for (i = 0; i < q->nr; i++) {
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-13  0:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-12 23:49 [PATCH] diffcore-order: Default the order file to .git/info/order Geoffrey Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).