Introduce the stash view

This patch adds a new "stash" view, bound to the 'y' key.
This view displays the list of stashes. Pressing Enter on one of them
displays the corresponding change in a split view.

Running 'tig stash' opens directly the stash view.

A new %(stash) variable is added for bindings and commands.

A built-in command to pop the current stash is bound to 'P' in this
view. Other bindings may be added in the ~/.tigrc file, for instance:

    bind stash D !?git stash drop %(stash)
    bind stash A !?git stash apply %(stash)
    bind status S !?git stash save --keep-index %(prompt)

Fixes #169
Closes #174

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Prepend the path to the repository root when editing a diff file

Fixes #165
Scroll diff with arrow keys in log view

This commit introduces the VIEW_NO_PARENT_NAV flag and adds it to the
log view. This allows the scrolling commands to fall through from the
pager to the diff when the diff is viewed in the log mode.

Signed-Off-By: Kumar Appaiah <a.kumar@alumni.iitm.ac.in>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Crop text when title-overflow is enabled

Limit the length of the title text if less columns are available when
drawing the title. This fixes a glitch introduced with the original
title-overflow patch, where the title text would wrap to the next line
when rendered.

Improve the rendering when only part of the "non-overflowing" title text
is displayed by showing the '~' character to indicate that the text was
cropped.

Fixes #166
Only set LINES and COLUMNS environment variables for external commands

Setting the LINES/COLUMNS environment variables to a constant number
breaks ncurses' getmaxyx() logic, so dynamic resizing doesn't work as
pointed out by Marcel Partap in a comment to the fix for issue #151
(https://github.com/jonas/tig/commit/f0ad1f74#commitcomment-3528715).

As a work-around, only set LINES/COLUMNS when forking Git processes. This
way diff stats will still use the whole terminal width and resizing works
as intended.

Fixes #109
iconv: Ignore unrepresentable characters when transliterating

Certain characters where causing iconv() to fail, which resulted in
buggy rendering. By adding "//IGNORE" to the already existing
"//TRANSLIT" flag unrepresentable characters are automatically removed
from the resulting output.

    > echo "Nguyễn Thái Ngọc Duy" | iconv -f UTF-8 -t ASCII//TRANSLIT
    Nguy
    iconv: (stdin):1:4: cannot convert
    > echo "Nguyễn Thái Ngọc Duy" | iconv -f UTF-8 -t ASCII//TRANSLIT//IGNORE
    Nguyn Th'ai Ngc Duy
iconv: Move draw_chars encoding code to IO module
iconv: Convert characters before trimming text before rendering

By first trimming and then transliterating, characters which need two
characters to represent would cause the rendered text to get out of
alignment. An example can be seen by running:

	$ LANG=C ./tig 2324d6120c5de58f63b32b876bd33e99d7375dbb

Fix the misalignment by reversing the operations so that text is trimmed
after it has been transliterated.

Fixes #86
iconv: Remove unnecessary length argument to encoding_iconv
iconv: Consolidate convert methods into one single backend
stash: Use main view infrastructure for the stash view

Change the output to use "--pretty=raw", which is compatible with the
main view. This simplifies the parsing of the 'stash{X}' ID by using the
emitted 'Reflog' line and displays the stash date for free.

The reference to the stash is stored as the commit->id for easy access
when updating the status line (view->ref).

Fixes #169
stash: Refactor ID drawing method

Simpify the main method (draw_id) and add custom method for more
advanced requirements.
stash: Ensure that the whole stash@{_} text is shown

Fixes #169
stash: Highlight the diffstat of combined diffs

Fixes #169
Add utility method to help copy commit ID to revision buffer