Re: [PATCH 8/9] show, log: provide a --remerge-diff capability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 21 2021, Elijah Newren via GitGitGadget wrote:

> From: Elijah Newren <newren@xxxxxxxxx>

> +	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/_/-/


> +	struct merge_options o;
> +	struct commit_list *bases;
> +	struct merge_result res;

nit: could use "= { 0 }" instead of memset below.

> +	/* 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)



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux