[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Ordering of output from diff [was: Small nit with svn diff]

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-11-15 20:10:50 CET

Kean Johnston wrote:
>
> I'm using svn 1.2.3, and have a small nit with svn diff. I
> dont know if this is fixed in 1.3 (if it is I'd appreciate
> someone telling me as that would be sufficient motivation
> to change).
>
> When doing an 'svn diff' the results tend to jump around
> the codebase quite a bit. I've been using svn for accessing
> and working on teh gcc repository, and for example, instead
> of showing all the diffs in gcc, then moving on to gcc/config
> and then gcc/config/i386, the diffs kinda jump around. This
> makes producing and documenting patches a little difficult.
> It also makes the process of hand applying diffs from one
> tree to another more difficult.

This would have been easier to understand if you had included an actual
example, but I think I know what you mean. I believe Subversion behaves like this:

   gcc/x
   gcc/a
   gcc/config/f
   gcc/config/y
   gcc/config/b
   gcc/config/i386/z
   gcc/config/i386/a
   gcc/config/q
   gcc/h
   gcc/dir2/a
   gcc/dir2/z
   gcc/dir2/y
   gcc/b

That is: within one directory (say "gcc"), it will diff each contained item
(file or sub-dir) in turn, in an unknown order. At some point it will get to
the sub-dir "gcc/config", and when it does it will diff everything inside
"gcc/config" (in an unknown order) before continuing with the other direct
children of "gcc". So, the files that are direct children of "gcc" are
separated by subdirectories.

I suspect that is what you mean by "the diffs kinda jump around". Is it?

> Is there an option somewhere I can specify that will do
> do all teh diffs in one directory before moving on to the
> next?

No, there is no option, nor is it fixed in v1.3.

I wrote patches to make diffs (and nearly all other operations) happen in a
defined and repeatable order (UTF-8 lexical order) a year or two ago, but there
was only moderate enthusiasm for the idea; some people didn't see the point
unless ALL operations were guaranteed to be in order (mixed repos-and-wc
operations being the most difficult), and I never got that far.

However, although what I did made the output repeatable, it didn't distinguish
files from directories so the output would still "jump around" in terms rather
like it currently does, in the sense that the diffs of sibling files in one
directory would be separated by diffs of subdirectories wherever those appear
in lexical order of their names. The example would like this:

   gcc/a
   gcc/b
   gcc/config/b
   gcc/config/f
   gcc/config/i386/z
   gcc/config/i386/a
   gcc/config/q
   gcc/config/y
   gcc/dir2/a
   gcc/dir2/y
   gcc/dir2/z
   gcc/h
   gcc/x

I would be very interested in seeing this done, for reasons like yours (e.g.
being able to compare one diff with another). I don't know whether it would be
feasible to group all of the subdirectories separately from the files. Is that
important to you?

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 15 20:12:03 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.