git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* an option to make "git-diff Z A" prints Z's diff before A's
@ 2006-10-25  7:15 Jim Meyering
  2006-10-25 19:16 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Meyering @ 2006-10-25  7:15 UTC (permalink / raw)
  To: git

Hello,

In a recent patch set I prepared, I placed the names of the
more relevant files at the front of the list given to "git-diff".
So I was surprised to see diff output in which the blocks of output
are sorted by file name.  The parts I'd tried to put at the "top"
ended up being buried in the latter part of the patch.

Here's a small test case:

mkdir d && cd d && touch x y && git-init-db
git-add x y && git-commit -m. x y
echo a > x && echo a > y
git-diff y x|grep '^d'

I expected this git-diff output, with "y's" diff first:
diff --git a/y b/y
diff --git a/x b/x

but got this, where x's come first:
diff --git a/x b/x
diff --git a/y b/y

I know about the -O<orderfile> option, and it can make git-diff do
what I want, but only if I first create a separate file containing
the names that I'm already providing to git-diff in the very same order.

Is there an easier way?

If not, would you be amenable to a new option enabling this behavior
without requiring a temporary file?


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-10-26 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25  7:15 an option to make "git-diff Z A" prints Z's diff before A's Jim Meyering
2006-10-25 19:16 ` Junio C Hamano
2006-10-26  8:42   ` Karl Hasselström
2006-10-26 15:16     ` Linus Torvalds

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).