Thanks for offering.
Jim

-------------------
Here are some guidelines for contributing code to the fileutils,
textutils, and sh-utils packages.

Send patches. (send unified diffs, please -- i.e. diff -u format) If your
changes fix bugs, the bar is quite low in that I don't need much more
than to understand what the original problem was.  However, it helps
a lot if you can give me enough information to reproduce the problem.

On the other hand, if you're adding new features, following certain guidelines
will increase the probability that your enhancements will be integrated.

  - convince me that this is a useful change/addition
      (if you're adding yet another option to ls, the above is pretty hard)

  - convince other people of the same thing
      One way to do that is to post to gnu.bug.utils including as
      much description and justification as you can.  Based on the
      feedback that generates, you may be able to convince me.

Once we agree the change is useful and get around to considering the
actual addition to the code, it helps if you do the following:

  - base your changes on the latest test release -- currently here:
      ftp://alpha.gnu.org/gnu/fetish/

  - follow the guidelines in the GNU Coding Standards (standards.info)
      which is distributed as part of the autoconf package.

  - include changes to the texinfo documentation, and be sure to update
      the --help output.

  - finally, you'll have to send signed copyright assignment papers
      to the FSF

And you'll have to be patient and expect delays on my part.
It is unusual that I spend more than a few hours per week
on the packages I maintain.

Christopher League <[EMAIL PROTECTED]> writes:
|   I added an option `--dirsfirst' to `ls' to output all directories
|   before any regular files.  This works in addition to whatever other
|   search criteria are specified.  For example, if we want the files
|   sorted by last modification time, then we get all the directories
|   first, sorted by mtime, followed by all the files, also sorted by
|   mtime.
|
|   An example:
|
|       $ ls                  $ ls --dirsfirst
|       answers.txt           bin/
|       bin/                  mail/
|       lecture.dvi           projects/
|       lecture.tex           research/
|       mail/                 answers.txt
|       memo.dvi              lecture.dvi
|       projects/             lecture.tex
|       research/             memo.dvi
|
|   I can send or post the patch, if anyone is interested.  The
|   implementation is not particularly pretty.  `sort_files()' (which
|   determines what comparison function to use with `qsort()') now
|   stores the comparison function into a global variable:
|
|       int (*comparison_func) ();
|       sort_files (void) {
|          [determine which function to use, store it in comparison_func]
|          qsort( ..., dirs_comparison );
|       }
|
|       static int
|       dirs_comparison (struct fileinfo *file1, struct fileinfo *file2) {
|          [if directory-ness of files is the same, call *comparison_func]
|          [else make the directory come first]
|       }
|
|   Anyway, I have some other ideas for making the sorting options more
|   general (and meanwhile cleaning up the code), but won't spend time
|   on it unless there is interest.
|
|   For example, consider this generalization, which would subsume my
|   `--dirsfirst' feature.  Allow a sequence of comparison functions to
|   be specified, each of which could be optionally reversed.  The
|   comparison functions are applied in order.  If function i says that
|   two files are equal, then we ask function i+1.
|
|   Some examples:
|
|     # sort by extension, then by size, with smallest files first.
|     ls --sort=extension --sort=size --reverse
|
|     # sort by name, but put files before directories
|     ls --sort=dirs --reverse --sort=name
|
|   The code would be a bit less efficient than in the current version,
|   because there would be more indirect function calls.  But probably
|   it would be acceptable.
|
|   Any interest?  Any suggestions or counter-proposals?
|
|   Thanks,
|  `Chris

Reply via email to