Re: [PATCH 39/83] builtin/apply: move 'ws_error_action' into 'struct apply_state'

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> As I do not expect that cmd_apply() which is a moral equivalent of
> main() will stay to be the only one who wants to see a reasonably
> initialized apply_state(), I think the patch that introduced the
> very first version of "struct apply_state" should also introduce a
> helper function to initialize it, i.e.
>
> 	static void init_apply_state(struct apply_state *s,
>         			     const char *prefix)
>         {
> 		memset(s, '\0', sizeof(*s));
>                 s->prefix = prefix;
>                 s->prefix_length = s->prefix ? strlen(s->prefix) : 0;
> 	}
>
> in [PATCH 7/xx].

Just to avoid misunderstanding, I do not mean to say that the
init-apply-state helper that should have been introduced in 07/xx
would gain a new caller-supplied parameter ws_error_action.  This
step would have a patch to the function that does something like:

 static void init_apply_state(struct apply_state *s,
                                 const char *prefix)
 {
         memset(s, '\0', sizeof(*s));
         s->prefix = prefix;
         s->prefix_length = s->prefix ? strlen(s->prefix) : 0;
         ...
+        s->ws_error_action = warn_on_ws_error;
 }

without having the caller supply what error_action should the state
be initialized with.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]