Switch to automatically generate dependencies

Can be disabled by (un)setting DEPS_CFLAGS:

	make DEPS_CFLAGS=
Move release scripts, test programs and maintainer files to new tools directory
Pass CFLAGS to linker

It happens that people use flags in CFLAGS that do affect the linking
stage. There is not always a clear distinction which do and which don't
so it's safer to have CFLAGS in linking commands as well.

[ Reworked to make it use generic make rule ]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Improve option toggling to update all displayed view

Use view flags to query which views need to be reloaded. This avoids
custom logic inside toggle_option.
Add toggling for display of files in untracked directories
Use memset to clear the format buffer
Generalize and move parsing of reflog info into main_read
Simplify checking of --stdin argument
Refactor the pager mode handling

Remove the global opt_stdin variable and the VIEW_STDIN flag and move
checking of pager mode options and opening logic into open_pager_mode().
Two new flags (OPEN_PAGER_MODE and OPEN_FORWARD_STDIN) is added to deal
with how the IO for the view needs to be initialized.

Also fixes a bug, where stdin was not closed when pager mode is not
supported. This means that the process writing to stdin would hang until
Tig closes.
Load main view from any --pretty=raw output given on stdin

This allows you to run:

    git log --pretty=raw | tig --pretty=raw
    git reflog --pretty=raw | tig --pretty=raw
    git stash list --pretty=raw | tig --pretty=raw
    git rev-list jonas/code-split --pretty=raw | tig --pretty=raw
    git whatchanged --pretty=raw | tig --pretty=raw

Idea and commit message by Vivien Didelot.
tig(1): document the Git commands supported by the pager mode

Also add some general improvements to the manpage description, add the
stash subcommand and more.

Fixes #1
Fix `make dist` to support versions with more than 2 digit groups

The recent 1.2.1 release ended up having VERSION set to 1.2.1.1 in the
Makefile. With this patch the rebuilt tarball has the correct VERSION
value.

Reported by Sedat Dilek.
Fix regression making the status view inaccessible for new repositories

Commit a11bf779be32ba139e9c0839c50d12475581058c (Load HEAD ID and
symbolic name as part of the repo info) introduced the regression by
passing "HEAD" to git-rev-parse. In new repositories, HEAD does not
resolve to anything and thus caused an error message and no additional
output.

Work-around this issue by moving all reference arguments to the end of
the command.
Move encoding utilities to the io module
Move get_temp_dir to io module
Move error messages to new util module
Move warn and die to the util module
Free all cached list of reference when reloading the references

This fixes a bug where stale reference lists where used after a new
branch was created via the branch view.

Fixes #196
Create a commit view history API based on the tree view stack
Implement navigating back to previous view state in the blame view

Use the new view history API to track the previous blamed revisions when
navigating to the blame information for the current file. Data for the
current blame view is stored inside the view state and pushed onto the
stack when reloading another blamed revision from inside the blame view.

This also improves error messages when trying to reloading the blamed
revision currently displayed as well as navigating back in views that
does not support it.

Note, that the back action (REQ_BACK) acts similar to REQ_PARENT in the
tree view.

Fixes #124
Fixes #139