diff: fix and improve detection of filename

There were a few badly displayed filenames in the diff view:
in case of adding a new empty file, deleting, or copying a file,
the status line displays:

    Diff of '(null)'

This is because there is no diff for a copy or a new empty file,
and because the destination for a deletion is shown as /dev/null.

The code used to get the filename corresponding to the displayed changes
is extracted in its own function. It now retrieves the filename from the
diff header line, which is always present and a more reliable data.

This commit also adds the "deleted mode" line type for better coloring.

Signed-off-by: Vivien Didelot <vivien@didelot.org>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
diff: support editing changed files

This allows editing a file corresponding to the displayed changes,
if it still exists and is readable (it may have be renamed/deleted).

JF: Fixed potential segfault when calling access(). Update NEWS.

Signed-off-by: Vivien Didelot <vivien@didelot.org>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Update AX_WITH_CURSES to build under Cygwin

Serial 13 of AX_WITH_CURSES finds the Cygwin ncursesw package.

This was fixed in: http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commit;h=61c0c244e11d22ed5dc9a03895771309a515e482

This also updates tig.h to use the headers suggested in the
AX_WITH_CURSES documentation.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Allow people to still build without autotools

... assuming their curses installation is easily found. A big warning is
emitted instead of an error encourage the use of autotools or minimal
configuration of the curses location as documented in INSTALL.
Documentation typo and grammar fixes

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
[DEB-682766] Improve tigrc(5) documentation
[GH #39] Add note for packagers to avoid building ncurses --with-shared

Suggested by Roman D. Boiko.
[GH #66] Allow run requests to exit tig after execution

Example: `bind main C !<git commit`.
[GH #70] Fix parent blaming when tig is launched in subdirectory

When running "tig blame" from within a subdirectory of a repository, the
"B" and "," commands will fail with "No blame exist for...". The problem
is that the current directory name gets prepended to the filename if
view->prev == NULL, but it should not be in this case.

Steps to reproduce:
1) checkout a copy of tig
2) cd contrib
3) run "tig blame tig-completion.bash"
4) press B
5) observe "tig: No blame exist for contrib/contrib/tig-completion.bash"

Also fixes another minor bug in an expression.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
[GH #25] Allow to build on Mac OS 10.7 without the configure script
Move horizontal split calculation to separate function
[GH #76] Add option to split views vertically

Fixes issue 76.
[GH #78] tig.spec: add man7 directory to RPM package

Fixes failure when using the packaged tig.spec for building an RPM
package of tig 1.0 due to unpackaged files:

	RPM build errors:
	    Installed (but unpackaged) file(s) found:
	       /usr/share/man/man7/tigmanual.7.gz

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Rename all column variables to end with _width
Sanitize the width argument to draw_field to not include padding

This breaks configurations for author-width and filename-width, which
will now be one character wider than before.
[GH #77] Add options for displaying commit IDs in the main view

'show-id' will make the commit IDs visible, and 'id-width' configures
how many characters to show. The latter is also applied to the blame
view.

Reviewed-by: Vivien Didelot <vivien@didelot.org>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Optionally show commit IDs for branches and tree entries
Remove enforced diff move/copy detection

Signed-off-by: Jiri Jaburek <jiri.jabu@gmail.com>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
fix: reading git colors in rang 0 255

In 'tig' a color from the 256 colors range is specified using the string
'colorN' where N is the integer. In 'git' you can used 256 colors too. However
instead of 'colorN' they are specified using just N. This needs to be taken
into account for using the option 'use-git-colors' which reads options from the
git config for use in tig.
fix: the manpage says 'read-git-colors'

The manpage says the option is called 'read-git-colors', but the code looks for
'use-git-colors'. Fix the code to look for what is described in the manpage.