Re: [PATCH v2 5/9] commit: use enum value for multiple cherry-picks

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

 



Phillip Wood <phillip.wood123@xxxxxxxxx> writes:

> From: Phillip Wood <phillip.wood@xxxxxxxxxxxxx>
>
> Add FROM_CHERRY_PICK_MULTI for a sequence of cherry-picks rather than
> using a separate variable.
>
> Signed-off-by: Phillip Wood <phillip.wood@xxxxxxxxxxxxx>
> ---
>  builtin/commit.c | 25 +++++++++++--------------
>  wt-status.h      |  9 ++++++++-
>  2 files changed, 19 insertions(+), 15 deletions(-)

Makes sense.  The checks have become quite pleasant to read, thanks
to the new helper function.

> ...
> -	if (whence == FROM_CHERRY_PICK && !renew_authorship) {
> +	if (is_from_cherry_pick(whence) && !renew_authorship) {
>  		author_message = "CHERRY_PICK_HEAD";
>  		author_message_buffer = read_commit_message(author_message);
>  	}
> diff --git a/wt-status.h b/wt-status.h
> index 64f1ddc9fd..0098fdb0b5 100644
> --- a/wt-status.h
> +++ b/wt-status.h
> @@ -39,9 +39,16 @@ enum show_ignored_type {
>  enum commit_whence {
>  	FROM_COMMIT,     /* normal */
>  	FROM_MERGE,      /* commit came from merge */
> -	FROM_CHERRY_PICK /* commit came from cherry-pick */
> +	FROM_CHERRY_PICK_SINGLE, /* commit came from cherry-pick */
> +	FROM_CHERRY_PICK_MULTI /* commit came from a sequence of cherry-picks */
>  };

It might be worth to end PICK_MULTI with a trailing comma to
future-proof, but not worth a reroll for this alone.




[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