Re: [PATCH 8/9] show, log: provide a --remerge-diff capability
flat view
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-12-21 21:28:16
On Tue, Dec 21 2021, Elijah Newren via GitGitGadget wrote:
From: Elijah Newren <redacted>
quoted hunk ↗ jump to hunk
+ if (rev->remerge_diff) { + rev->remerge_objdir = tmp_objdir_create("remerge-diff"); + if (!rev->remerge_objdir) + die(_("unable to create temporary object directory"));
It looks like the tmp_objdir_create() API is rather bad about mixing errors that would come with an errno with others, but shouldn't this be die_errno() in the case where it would fail due to a syscall? Even better would be passing a "gentle" to it and have it emit the appropriate errors.
+ if (rev.remerge_diff)
+ die(_("--remerge_diff does not make sense"));s/_/-/
quoted hunk ↗ jump to hunk
+ struct merge_options o; + struct commit_list *bases; + struct merge_result res;
nit: could use "= { 0 }" instead of memset below.
quoted hunk ↗ jump to hunk
+ /* Re-merge the parents */ + merge_incore_recursive(&o, + bases, parents->item, parents->next->item, + &res);
style: odd not to have arguments that fit on the line on the line, i.e. "&o, bases, ...".
+ /* Clean up the temporary object directory */ + if (opt->remerge_objdir != NULL)
style: if (!x) not if (x != NULL)