Remove unneeded git update-index call

... detected with TIG_TRACE.
Fix diff display when using --follow by marking it as a rev flag
[GH #93] Reload the current branch name when reloading the status view
[GH #93] Fix compile errors reported on old Solaris systems

 - tig.h:81:1: warning: "__NORETURN" redefined
 - tig.c:2468: error: subscripted value is neither array nor pointer
autogen.sh: Set WARNINGS in a more portable fashion
Don't call string_copy_rev() on empty string

graph_expand() calls graph_insert_column() with the empty string as id,
which in turns leads to string_copy_rev() reading outside the allowed
memory area looking for whitespace.

To avoid this, don't call string_copy_rev() if we know the string is
empty anyway.

Signed-off-by: Romain Francoise <romain@orebokech.com>

Moved the check to string_copy_rev().

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Reload current branch name when reloading the stage view.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Don't clear the status/report line when finishing a piped update

This appears to be no longer necessary, and a hold over from when
updates were more verbose at the start of and during processing and
needed to be cleared when finished (refer to f97f401).

More importantly, the call to report_clear() when the view is done
updating can hide status messages from the beginning of the update which
should remain visible past the end (until some other action clears the
status line).

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Report toggled option *after* refreshing/reloading the view

This ensures that the report is remains visible in all cases, rather
than immediately being cleared in some cases.  In particular, toggling
the diff whitespace behaviour (with W) no longer leaves you unsure of
the current state.

[ Changed to keep redraw logic in view_driver() ]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Added configure

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Main view: fix diff view display for staged/unstaged changes

Shows actual diff of stage/unstaged state instead of just a blank diff
with "[diff] 0000000000000000000000000000000000000000" in the status
bar.

[ Set flags depending on whether the diff view is requested ]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Add a diff-options config, similar to blame-options

This is useful for persistent arguments to the diff view instead of
setting TIG_DIFF_OPTS or always passing them on the command line
invocation.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Allow overwriting of a previously set "argv" option

parse_args() is only used by option_set_command() for the two "argv"
style options: blame-options and diff-options.  Allowing parse_args() to
overwrite the destination enables ":set diff-options = ..." to work more
than once from within the tig prompt (or at all if first set via tigrc).

This is safe since argv_copy() handles the necessary freeing, added as
part of 7dfa0b2.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Refactor the prompt command handling into a separate function

Preparation for running prompt commands from keybindings.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Support refreshing the diff view by reloading the data

This allows new diff-options to take effect.  The diff view is still
unrefreshable when reading data from STDIN.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
After setting an option, refresh the view if possible

Redrawing is not always enough but is still used as a fallback if the
view is unrefreshable.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Return a request from open_run_request()

A boolean return value limits the ability of open_run_request() to
handle more complex run requests in the future.  The "quit, refresh, or
do nothing" logic in view_driver(), based on the boolean return value,
is easily represented by returning REQ_QUIT, REQ_REFRESH, or REQ_NONE
from open_run_request() itself.  Returning a request also seems more in
line with workings of other functions which process requests.

The current view is passed to open_run_request(), which enables it to
return REQ_REFRESH as appropriate.  For the future, this also opens the
door for other queries and actions on the view.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Key bindings which execute tig prompt commands

"Internal" run requests now provide a way to add keybindings for tigrc
and tig prompt commands.  For example:

    bind diff F :set diff-options = --full-diff

Much of the change to open_run_request() is increased indentation;
viewing the diff with whitespace ignored (git show -w or pressing W in
tig) reveals the simplicity of the functional changes.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Document the ability to bind internal commands

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Update NEWS