Unexpected diff
(1) By jamsek on 2021-12-20 15:07:44 [source]
The problem appears to occur in diff_step()
and longestCommonSequence()
,
which produces a triple of 24 deletions and 26 insertions from line 3313, rather
than the expected two hunks of 1 deletion and 2 insertions diff(1) produces. But
it could result from an earlier problem in break_into_lines()
or even
compare_dline()
because passing the -w
flag produces the correct output (but
there are no whitespace changes between the misreported lines). Interestingly,
Fossil's side-by-side diff -y
(or --tk
) produces the correct diff too.
- from file: https://fnc.bsdbox.org/file?name=src/fnc.c&ci=5dddbafd09d144c3
- to file: https://itac.bsdbox.org/fnc.c
Below are the relevant hunks from the diff.
fossil diff
:
@@ -3309,34 +3306,36 @@
return RC(FSL_RC_ERROR, "%s", "view_open");
rc = open_timeline_view(new, 0, "/", glob);
if (rc) {
if (rc != FSL_RC_BREAK)
return rc;
- fnc_print_msg(view, "-- no matching commits --", true);
- fcli_err_reset();
- rc = 0;
- break;
- }
- view->active = false;
- new->active = true;
- if (view_is_parent(view)) {
- rc = view_close_child(view);
- if (rc)
- return rc;
- view_set_child(view, new);
- view->focus_child = true;
- } else
- *new_view = new;
- break;
- }
- case 't':
- if (s->selected_commit == NULL)
- break;
- if (!fsl_rid_is_a_checkin(fcli_cx(),
- s->selected_commit->commit->rid)) {
- fnc_print_msg(view,
- "-- tree requires check-in artifact --", true);
+ fnc_print_msg(view, "-- no matching commits --", true,
+ true, true);
+ fcli_err_reset();
+ rc = 0;
+ break;
+ }
+ view->active = false;
+ new->active = true;
+ if (view_is_parent(view)) {
+ rc = view_close_child(view);
+ if (rc)
+ return rc;
+ view_set_child(view, new);
+ view->focus_child = true;
+ } else
+ *new_view = new;
+ break;
+ }
+ case 't':
+ if (s->selected_commit == NULL)
+ break;
+ if (!fsl_rid_is_a_checkin(fcli_cx(),
+ s->selected_commit->commit->rid)) {
+ fnc_print_msg(view,
+ "-- tree requires check-in artifact --", true,
+ true, true);
fcli_err_reset();
rc = 0;
break;
}
rc = request_new_view(&tree_view, view, FNC_VIEW_TREE);
@@ -3749,12 +3748,11 @@
diff(1): diff -U5
^
@@ -3309,11 +3306,12 @@
return RC(FSL_RC_ERROR, "%s", "view_open");
rc = open_timeline_view(new, 0, "/", glob);
if (rc) {
if (rc != FSL_RC_BREAK)
return rc;
- fnc_print_msg(view, "-- no matching commits --", true);
+ fnc_print_msg(view, "-- no matching commits --", true,
+ true, true);
fcli_err_reset();
rc = 0;
break;
}
view->active = false;
@@ -3332,11 +3330,12 @@
if (s->selected_commit == NULL)
break;
if (!fsl_rid_is_a_checkin(fcli_cx(),
s->selected_commit->commit->rid)) {
fnc_print_msg(view,
- "-- tree requires check-in artifact --", true);
+ "-- tree requires check-in artifact --", true,
+ true, true);
fcli_err_reset();
rc = 0;
break;
}
rc = request_new_view(&tree_view, view, FNC_VIEW_TREE);
@@ -3749,12 +3748,11 @@
^for consistency with Fossil's default 5 context line unified diff
(2) By Richard Hipp (drh) on 2021-12-20 17:03:13 in reply to 1 [link] [source]
Should now be fixed on trunk.