You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2006/08/03 10:46:30 UTC

DO NOT REPLY [Bug 40175] New: - filesets are always sorted

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40175

           Summary: filesets are always sorted
           Product: Ant
           Version: 1.6.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: luca.distefano@wuerth-phoenix.com


if you use 
<fileset dir=".." includesfile="includes.txt"/>
includes.txt contains for example:

file1.xml
file4.xml
file2.xml
file3.xml

getting the included files they will be returned sorted by name

file1.xml
file2.xml
file3.xml
file4.xml

this behaviour is not expected and should be at least switchable.
this problem force the use of hardcoded (in the build.xml) list of files when a
particular order is needed

the sorting is performed in 
org.apache.tools.ant.DirectoryScanner.getIncludedFiles() and
.getIncludedDirectories()
performs an Arrays.sort()

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40175] - filesets are always sorted

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40175





------- Additional Comments From gudnabrsam@yahoo.com  2006-08-04 14:32 -------
(In reply to comment #6)
> hey man be quiet.
> 

I assume you were speaking to Ben (Burgess).  He is a valued member of the Ant
and wider Apache communities and it does your case no good by reacting in such a
way to him.  No one but yourself, likely, saw his response as rudeness, although
your "hey man be quiet" could hardly be construed otherwise.

> as I said I understand the reasons.
> 
> Anyway, there is no reason to be rude, we are professional workers not a street
> gang (nothing against street gangs) and if you will be polemic then:
> 
> >A set by definition has no guarentee in order.
> 
> where are those definitions?

Here is something found by a quick google of the words 'mathematics' and 'set':

    Bolzano was a philosopher and mathematician of great depth of thought.
    In 1847 he considered sets with the following definition

        an embodiment of the idea or concept which we conceive when we
        regard the arrangement of its parts as a matter of indifference. 

Additionally, a google of the words 'set' and 'equality' yields such results as
http://www.cs.odu.edu/~toida/nerzic/content/set/basics.html :

    Definition (Equality of sets): Two sets are equal if and only if they have
    the same elements.  More formally, for any sets A and B,  A = B if and only
    if x [ x A      x B ] . (ed: mathematics characters lost here)

    Thus for example {1, 2, 3} = {3, 2, 1} , that is the order of elements does
    not matter

I think these results vindicate Ben's characterization of a set as being
unordered by definition.

[SNIP]
> supposing I use filelist there is no way to use an external file that contains
> the list of files...
> 
> but I will close this useless discussion here
>

I said above that we might add an includesfile to filelist for 1.7 (which is to
be released in the near future).  Fortunately, this idea has enough merit to
stand on its own so you will be likely to have it despite your behavior here.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40175] - filesets are always sorted

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40175





------- Additional Comments From gudnabrsam@yahoo.com  2006-08-04 16:43 -------
(In reply to comment #8)
> It is getting personal.

If I have presented a negative face here, I apologize, although the only
"personal" thing I feel I possibly brought to the discussion was the "your
behavior" comment.  It has been pointed out to me that certain statements on
this thread may or may not have had rude intent but in the interest of ending
this facet of the discussion I'll say no more on the subject.

> In a perfect world all sets would be unsorted, but in
> the real world sorted and ordered sets are needed and that is why there are
> LinkedHashSet and TreeSet in Java. The main difference between all these
> collections is a predictable order of navigation. There is nothing wrong with it.
> 
> There is an example - to achieve the best compression ratio for solid archives
> (for example, tgz), the files should be sorted by extension -> increasing file
> size -> file name, but not how ANT filesets are sorted. I do not say that it
> would be better to change resource collections to be sortable (maybe it is), but
> the original point is valid.

1.7's resource collections can do pretty much whatever is needed of them, since
RC is just an interface and therefore fully open to custom implementations.  Ant
1.7 will ship with the <sort> collection that allows the use and/or combination
of a number of included resourceComparators as well as the possibility for
custom ResourceComparator implementations.  With this, and the proposed
includesfile attribute of <filelist> it seems that all bases would be covered.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40175] - filesets are always sorted

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40175


stevel@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




------- Additional Comments From stevel@apache.org  2006-08-03 11:58 -------
Luca,

Filesets explicitly say "no guarantees of ordering". Which means that you cannot
expect filesets to be driven by an includes file to match what you list in the file.

There is a <filelist> list which is explictly ordered. 
1. I dont know if it can be driven off a file; we could fix that
2. not that many tasks in ant1.6 use it

Ant1.7 has a broader model of resources, so any ant task uprated to support
resource collections will take filelists alongside filesets. When the beta comes
out this month, please pull it down and see if this works for you. if not, then
file a bugrep about how the resource stuff doesnt meet your needs.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40175] - filesets are always sorted

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40175





------- Additional Comments From luca.distefano@wuerth-phoenix.com  2006-08-04 07:48 -------
I understand your comments and is acceptable to keep the default behavior with sort.
What is not smart is that if you give a set of files (not patterns) this set
will be reordered.
That force to specify the set of files hardcoded in the build xml and not
configurable from outside or dynamically

What would be needed is a flag for to say sorted="no"

if you accept this kind of changes I would be glad to submit to you the needed
changes

anyway,
 thanks for your help

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40175] - filesets are always sorted

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40175





------- Additional Comments From BBurgess@tiaa-cref.org  2006-08-04 13:09 -------
Steve made it clear why this change is a WONTFIX:

A set by definition has no guarentee in order.

A list by definition is an ordered collection.

Bringing order to a set makes it stop being a set; it would then be a list.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40175] - filesets are always sorted

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40175





------- Additional Comments From alexeys@inventigo.com  2006-08-03 16:02 -------
Actually it makes sense to sort files in some ways, for example, in tar+gzip, to
achieve better compression.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40175] - filesets are always sorted

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40175





------- Additional Comments From luca.distefano@wuerth-phoenix.com  2006-08-04 13:58 -------
hey man be quiet.

as I said I understand the reasons.

Anyway, there is no reason to be rude, we are professional workers not a street
gang (nothing against street gangs) and if you will be polemic then:

>A set by definition has no guarentee in order.

where are those definitions?
here the links to your doc:
http://ant.apache.org/manual/CoreTypes/fileset.html
http://ant.apache.org/manual/CoreTypes/filelist.html
or looking in java
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html

or maybe you need to find your definition here:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/SortedSet.html

supposing I use filelist there is no way to use an external file that contains
the list of files...

but I will close this useless discussion here

thanks Steve and Alexey 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40175] - filesets are always sorted

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40175





------- Additional Comments From alexeys@inventigo.com  2006-08-04 16:23 -------
It is getting personal. In a perfect world all sets would be unsorted, but in
the real world sorted and ordered sets are needed and that is why there are
LinkedHashSet and TreeSet in Java. The main difference between all these
collections is a predictable order of navigation. There is nothing wrong with it.

There is an example - to achieve the best compression ratio for solid archives
(for example, tgz), the files should be sorted by extension -> increasing file
size -> file name, but not how ANT filesets are sorted. I do not say that it
would be better to change resource collections to be sortable (maybe it is), but
the original point is valid.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40175] - filesets are always sorted

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40175





------- Additional Comments From gudnabrsam@yahoo.com  2006-08-04 13:55 -------
Thinking... we could add an includesfile to filelist for 1.7 .

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org