commit 09d38fee11b9a19a2baef6995366389723745baa from: Christian Weisgerber date: Sun Aug 18 13:12:38 2024 UTC tog: show shortened "id1 -> id2" as path in diffstat when diffing blobs This matches the output of "got diff -d". ok jamsek commit - 78a2ad6b7632ff7b206518772a6aa2f1fcfa7f40 commit + 09d38fee11b9a19a2baef6995366389723745baa blob - 528451906a8ec3ab90d51ead482cb3f1dc70fa3e blob + ec0e765b1506e3cbeef47069c0eee3dfc7ee112a --- regress/tog/diff.sh +++ regress/tog/diff.sh @@ -690,13 +690,16 @@ test_diff_blobs() local blob_alpha_head=$(get_blob_id $testroot/repo "" alpha) + local short_alpha_root=$(printf '%.10s' $blob_alpha_root) + local short_alpha_head=$(printf '%.10s' $blob_alpha_head) + cat <$TOG_TEST_SCRIPT SCREENDUMP EOF cat <$testroot/view.expected [1/12] diff $blob_alpha_root $blob_alpha_head -M $blob_alpha_head | 1+ 1- +M $short_alpha_root -> $short_alpha_head | 1+ 1- 1 file changed, 1 insertion(+), 1 deletion(-) blob - 4066c6daccca293de31dc4c0f20604184235fb77 blob + 091072c0d6ba8b4c672d3c4534c282af4f86830b --- tog/tog.c +++ tog/tog.c @@ -5419,7 +5419,7 @@ create_diff(struct tog_diff_view_state *s) /* * The diffstat requires the diff to be built first, but we want the - * diffstat to prepend the diff when displayed. Build the diff first + * diffstat to precede the diff when displayed. Build the diff first * in the temporary file and write the diffstat and/or commit info to * the persistent file (s->f) from which views are drawn, then append * the diff from the temp file to the diffstat/commit info in s->f. @@ -5445,7 +5445,7 @@ create_diff(struct tog_diff_view_state *s) case GOT_OBJ_TYPE_BLOB: err = got_diff_objects_as_blobs(&lines, &nlines, s->f1, s->f2, s->fd1, s->fd2, s->id1, s->id2, - s->label1, s->label2, tog_diff_algo, s->diff_context, + NULL, NULL, tog_diff_algo, s->diff_context, s->ignore_whitespace, s->force_text_diff, &dsa, s->repo, tmp_diff_file); if (err != NULL)