Extract version information from 'git' if possible.

The version number (and date) reported by "wiggle -V" now
includes information from 'git' if the code was build from a
git repo rather than from a tar-ball.

Suggested-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: NeilBrown <neilb@suse.de>
Browser help: add some missing commas.

The missing commas would just to lines into one.

Signed-off-by: NeilBrown <neilb@suse.de>
Unwrap some printf string.

Have long lines is much better than having to break strings in odd places.

Signed-off-by: NeilBrown <neilb@suse.de>
Browser: Don't highlight spaces so much.

Highlighting spaces is very noisy and doesn't help very much.
We only really need to differentiate spaces from tabs and highlighting
tabs is enough for that.

We continue to highlight spaces that are adjacent to tabs, but not
other spaces.

Signed-off-by: NeilBrown <neilb@suse.de>
tests: new test case for stray &&&&&

We sometime get stray empty conflicts, particularly with &&&&&&
even though show-wiggles wasn't requested.

Signed-off-by: NeilBrown <neilb@suse.de>
merge: fix reporting of empty "conflicts".

The important part of this patch is the end in print_merge().
If one conflict follows another with nothing in between,
then we really should try to mark up that 'nothingness' as
a resolved conflict.

The other parts as just cleaning up isolate_conflicts a bit more
as I tried to figure out what was happening.

Signed-off-by: NeilBrown <neilb@suse.de>
vpatch: discard 'ignored' for 'oldtype'.

Rather than 'ignore'ing certain merges, we allow the type
of each merger to be modified.  This feels more flexible and
should be easier to understand.

Signed-off-by: NeilBrown <neilb@suse.de>
merge: fix another bug in isolate_conflicts.

In unusual cases we can fall off the end - better check.

Signed-off-by: NeilBrown <neilb@suse.de>
Add some test after the markers in a merge.

"git rerere" likes to see a space after the "<<<<<<<" and
">>>>>>>".  So put it there and add a vaguely relevant word too.

Signed-off-by: NeilBrown <neilb@suse.de>
Browser: highlight spaces at the end of a line.

Otherwise they are invisible.

Signed-off-by: NeilBrown <neilb@suse.de>
Browse: allow "--replace" to be requested while viewing.

If you type 'S' then on exit the file you are looking at
will be saved.

Signed-off-by: NeilBrown <neilb@suse.de>
Browse: suppress "last-key" debugging.

Only display this if a suitable DEBUG envionment variable is set.

Signed-off-by: NeilBrown <neilb@suse.de>
Allow interactive setting of "--ignore-blanks" flag.

"I" will toggle whether blanks are significant or not
in matching text.

Signed-off-by: NeilBrown <neilb@suse.de>
Browse: make sure 'X' doesn't loop forever searching backwards.

it did once..

Signed-off-by: NeilBrown <neilb@suse.de>
Make some fatal errors more helpful.

Complain sensibly if something is a directory, and
mention that read or malloc failed if it did.

Signed-off-by: NeilBrown <neilb@suse.de>
Browser: add 'c' command to accept a conflict.

'c' will change a 'Conflict' to 'Changed' so we keep the result
even though the 'before' part doesn't match.

Signed-off-by: NeilBrown <neilb@suse.de>
vpatch: simplify display of editted mergers.

Rather than having some special cases, simply use the original 'type'
unless RESULT is requested.  In that case use the new 'type'.

This is much more general and seems to work OK.

Signed-off-by: NeilBrown <neilb@suse.de>
Preserve per-hunk "comment" field.

Each diff/patch hunk can have a comment, often a function
name extract with "diff -p".
Preserver that comment and display it when we print hunk headers,
particularly in the browser.

Signed-off-by: NeilBrown <neilb@suse.de>
Browser: update all of status line in one place.

This removes the need to erase some number of spaces before
the right-justified bit, which was sometimes erasing too much.

Signed-off-by: NeilBrown <neilb@suse.de>
Add --report-wiggles option

This results in 'failure' status if any wiggles were required.

Signed-off-by: NeilBrown <neilb@suse.de>