git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v6 02/11] trailer: process trailers from stdin and arguments

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 5, 2014, 22:52 UTC
Message-ID
<xmqqiors1cn4.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140304194810.14249.7378.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 11 quoted lines
> Implement the logic to process trailers from stdin and arguments.
>
> At the beginning trailers from stdin are in their own in_tok
> doubly linked list, and trailers from arguments are in their own
> arg_tok doubly linked list.
>
> The lists are traversed and when an arg_tok should be "applied",
> it is removed from its list and inserted into the in_tok list.
>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
Thanks.

This round is marked as the sixth, but I still see quite a many style issues, which I expect not to see from long timers without being told. Somewhat disappointing...

Show 10 quoted lines
>  trailer.c | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 197 insertions(+)
>
> diff --git a/trailer.c b/trailer.c
> index db93a63..a0124f2 100644
> --- a/trailer.c
> +++ b/trailer.c
> @@ -47,3 +47,200 @@ static size_t alnum_len(const char *buf, size_t len)
> ...
> +			if ((where == WHERE_AFTER ? in_tok->next : in_tok->previous) == arg_tok)
Overlong line that does not have to be.
			if ((where == WHERE_AFTER
                             ? in_tok->next : in_tok->previous) == arg_tok)
or something?
> +static void update_last(struct trailer_item **last)
> +{
> +	if (*last)
> +		while((*last)->next != NULL)
Style.  SP between control keyword and the expression.
Show 7 quoted lines
> +			*last = (*last)->next;
> +}
> +
> +static void update_first(struct trailer_item **first)
> +{
> +	if (*first)
> +		while((*first)->previous != NULL)
Ditto.
Show 6 quoted lines
> +static void process_trailers_lists(struct trailer_item **in_tok_first,
> ...
> +	/* Process input from end to start */
> +	for (in_tok = *in_tok_last; in_tok; in_tok = in_tok->previous) {
> +		process_input_token(in_tok, arg_tok_first, WHERE_AFTER);
> +	}
Needless brace pair.
> +	/* Process input from start to end */
> +	for (in_tok = *in_tok_first; in_tok; in_tok = in_tok->next) {
> +		process_input_token(in_tok, arg_tok_first, WHERE_BEFORE);
> +	}
Ditto.
Previous: Christian CouderNext: Christian Couder
Message 4 of 21 in “Add interpret-trailers builtin”
  1. 00/11 Add interpret-trailers builtinChristian Couder, Mar 4, 2014
  2. 01/11 Add data structures and basic functions for commit trailersChristian Couder, Mar 4, 2014
  3. 02/11 trailer: process trailers from stdin and argumentsChristian Couder, Mar 4, 2014
  4. Junio C HamanoMar 5, 2014
  5. Christian CouderMar 7, 2014
  6. Dan CarpenterMar 7, 2014
  7. Christian CouderMar 7, 2014
  8. 03/11 trailer: read and process config informationChristian Couder, Mar 4, 2014
  9. 04/11 trailer: process command line trailer argumentsChristian Couder, Mar 4, 2014
  10. Junio C HamanoMar 5, 2014
  11. 05/11 trailer: parse trailers from stdinChristian Couder, Mar 4, 2014
  12. Junio C HamanoMar 5, 2014
  13. 06/11 trailer: put all the processing together and printChristian Couder, Mar 4, 2014
  14. 07/11 trailer: add interpret-trailers commandChristian Couder, Mar 4, 2014
  15. 08/11 trailer: add tests for "git interpret-trailers"Christian Couder, Mar 4, 2014
  16. Junio C HamanoMar 5, 2014
  17. 09/11 trailer: execute command from 'trailer.<name>.command'Christian Couder, Mar 4, 2014
  18. Junio C HamanoMar 5, 2014
  19. 10/11 trailer: add tests for commands in config fileChristian Couder, Mar 4, 2014
  20. 11/11 Documentation: add documentation for 'git interpret-trailers'Christian Couder, Mar 4, 2014
  21. Ramsay JonesMar 6, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.