ls_colors.c: add $LS_COLORS parsing code

Reusing color settings from $LS_COLORS could give a native look and
feel on file coloring.

This code is basically from coreutils.git [1], rewritten to fit Git.

As this is from GNU ls, the environment variable CLICOLOR is not
tested. It is to be decided later whether we should ignore $LS_COLORS
if $CLICOLOR is not set on Mac or FreeBSD.

[1] commit 7326d1f1a67edf21947ae98194f98c38b6e9e527 file
    src/ls.c. This is the last GPL-2 commit before coreutils turns to
    GPL-3.
ls_colors.c: add code for color.ls.*
ls_colors.c: add function to color a file name

Tthe new function is based on print_color_indicator() from commit
7326d1f1a67edf21947ae98194f98c38b6e9e527 in coreutils.git.
ls_colors.c: highlight submodules like directories
ls-files: buffer full item in strbuf before printing
ls-files: add --color to highlight file names

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
ls-files: add --column
ls-files: support --max-depth

The use case in mind is --max-depth=0 to stop recursion. With this we can do

git config --global alias.ls 'ls-files --column --color --max-depth=0'

and have "git ls" with an output very similar to GNU ls. Another
interesting one is

git config --global alias.lso 'ls-files --column --color --max-depth=0 -o --exclude-standard'
ls-files: split main ls-files logic into ls_files() function

This is a preparation step for the introduction of git-ls. "git ls"
has a different set of command line options, but it will eventually
call ls_files().
Add git-ls, a user friendly version of ls-files and more

This is more user friendly version of ls-files:

* it's automatically colored and columnized
* it refreshes the index like all porcelain commands
* it defaults to non-recursive behavior like ls
* :(glob) is on by default so '*.c' means a.c but not a/b.c, use
  '**/*.c' for that.
* auto pager
ls: add -R/--recursive

People can already do "ls --max-depth=-1" but it's probably not as
friendly. One of the use case is "ls -mR" which is basically "git diff
--name-only"
ls: add -t back

Tag "H" (cached) is not shown though because it's usually the majority
and becomes noise. Not showing it makes the other tags stand out.
ls: sort output and remove duplicates

When you mix different file types, with ls-files you may get separate
listing. For example, "ls-files -cm" will show file "abc" twice: one
as part of cached list, one of modified list. With "ls" (and this
patch) they will be in a single sorted list (easier for the eye).

Duplicate entries are also removed. Note that display content is
compared, so if you have "-t" on, or you color file types differently,
you will get duplicate textual entries. This is good imo.
ls: do not show duplicate cached entries

With the current show_files() "ls -tcm" will show

  foo.c
M foo.c

The first item is redundant. If "foo.c" is modified, we know it's in
the cache. Introduce show_files_compact to do that because ls-files is
plumbing and scripts may already depend on current display behavior.
ls: -M aka diff-cached
column: support "denser" mode

Sometimes a few long entries in the listing would stretch out columns,
wasting space. If these entries are cut out, the columns could become
smaller and more columns can be displayed.

This mode checks the shortest and longest entries of a range of
items. If the difference is over a limit, the range is cut out for
displaying. This makes sure a group or long file names won't break
make any columns too wide.

Try "git ls -R t" with --column=denser and --column=dense to see the
difference.