commit 07d8d6083dc8bd84b2c7ca96068ce3c35f8c1dbf from: Mark Jamsek date: Mon Aug 07 07:10:28 2023 UTC fix 'got log -dPp' diffstat duplication bug Only collect changed paths once if both -d and -P are specified; we already checked for -d and -p. Reported by Lucas on IRC. Regress for this and the previous (got log -x keyword) commit still due. ok stsp@ and op@ commit - 93c250cd168c2e1d2f9997774c87cc2718373404 commit + 07d8d6083dc8bd84b2c7ca96068ce3c35f8c1dbf blob - 3ca38bd57684cbbf48e72c190d7346237ec825ed blob + 29feb8935ab716a9191034d2ebede3da7cea1f73 --- got/got.c +++ got/got.c @@ -4460,7 +4460,8 @@ print_commits(struct got_object_id *root_id, struct go if (err) break; - if ((show_changed_paths || (show_diffstat && !show_patch)) + if (((show_changed_paths && !show_diffstat) || + (show_diffstat && !show_patch)) && !reverse_display_order) { err = get_changed_paths(&changed_paths, commit, repo, show_diffstat ? &dsa : NULL); @@ -4526,7 +4527,7 @@ print_commits(struct got_object_id *root_id, struct go &qid->id); if (err) break; - if (show_changed_paths || + if ((show_changed_paths && !show_diffstat) || (show_diffstat && !show_patch)) { err = get_changed_paths(&changed_paths, commit, repo, show_diffstat ? &dsa : NULL);