All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git <git@vger.kernel.org>, "Ævar Arnfjörð" <avarab@gmail.com>,
	"Nguyen Thai Ngoc Duy" <pclouds@gmail.com>,
	"Stefan Beller" <sbeller@google.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Ramsay Jones" <ramsay@ramsayjones.plus.com>,
	"Jeff King" <peff@peff.net>,
	"Karsten Blees" <karsten.blees@gmail.com>,
	"Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>,
	"Christian Couder" <chriscool@tuxfamily.org>
Subject: Re: [PATCH v2 48/94] builtin/apply: rename 'prefix_' parameter to 'prefix'
Date: Tue, 24 May 2016 10:24:30 +0200	[thread overview]
Message-ID: <CAP8UFD0FrK2tL49SLUxX5Zq4PHsmOP3aih9M9VAxw31P9eRH2Q@mail.gmail.com> (raw)
In-Reply-To: <xmqqy47c7awg.fsf@gitster.mtv.corp.google.com>

On Sat, May 14, 2016 at 8:27 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Christian Couder <christian.couder@gmail.com> writes:
>
>> On Thu, May 12, 2016 at 10:43 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Junio C Hamano <gitster@pobox.com> writes:
>>>
>>>> Up to this point, the conversion looks quite sensible, even though I
>>>> think the organization of fields in apply_state do not look logical.
>>>
>>> I'd stop here for now, as everything before this step looks
>>> uncontroversial.  Anybody whose tasked to move the global state for
>>> these variables into a structure would reach the samestate after
>>> applying these 48 patches, modulo minor differences in the way the
>>> comments would say things, how the patches are split and how the
>>> fields in apply_state() are organized.
>>>
>>> One thing that is missing is a counterpart of init_apply_state().
>>> In the early part of patches where it added only "const char *"
>>> borrowed from the caller and fields of intregral type, the lack of
>>> clear_apply_state() did not mattter, but with a few fields with
>>> "string_list" type, anybody who want to make repeated call into the
>>> apply machinery would want a way to release the resource the
>>> structure holds.
>>>
>>> Because 49/94 is a step to add an unfreeable resource, this is a
>>> good place to stop and then add the clean_apply_state() before that
>>> happens, I would think.  After that, I think both the contributor
>>> and the reviewers would benefit if these early patches are merged
>>> early without waiting for the review of the remainder.
>>
>> Ok, I will add add the clean_apply_state() and resend the patches up
>> to that point soon, so that they can be merged early.
>
> Two more comments:
>
>  - Just like the change between v1 and v2, if we were to introduce
>    clear_apply_state(), it would be nicer if it were done early in
>    the series, ideally at the same time as init_apply_state() gets
>    introduced,

Yeah, I have done that in v3.

> or at least no later than the first field that holds
>    resource that needs releasing is added.
>
>  - I didn't double check if 50 and later still had changes that
>    belong to this "early batch that moves things into a struct" (aka
>    cc/apply-introduce-state) topic, as I stopped at 49 and saw the
>    need for clear_apply_state().  So 48 may not be the ideal place
>    to stop.  From a cursory read of their titles, perhaps 49, 50, 56
>    and possibly 60 should be in this early series?  While 60 does
>    sound like an immediate follow-up to 09/94, it depends on a few
>    "die elimination" changes, so I do NOT think it must be in the
>    early batch.

For v3 I stopped at patch 50 from v2.

Patch 56 moves 'struct apply_state' into apply.h and it can logically
belong to another patch series, as anyway 'struct apply_state' is not
usable by other code as long as the related functions
(init_apply_state(), clear_apply_state(), check_apply_state(), ...)
are not also moved to apply.{c,h}.

  reply	other threads:[~2016-05-24  8:24 UTC|newest]

Thread overview: 148+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11 13:16 [PATCH v2 00/94] libify apply and use lib in am Christian Couder
2016-05-11 13:16 ` [PATCH v2 01/94] builtin/apply: make gitdiff_verify_name() return void Christian Couder
2016-05-12 19:06   ` Junio C Hamano
2016-05-11 13:16 ` [PATCH v2 02/94] builtin/apply: avoid parameter shadowing 'p_value' global Christian Couder
2016-05-12 19:09   ` Junio C Hamano
2016-05-11 13:16 ` [PATCH v2 03/94] builtin/apply: avoid parameter shadowing 'linenr' global Christian Couder
2016-05-12 19:11   ` Junio C Hamano
2016-05-11 13:16 ` [PATCH v2 04/94] builtin/apply: avoid local variable shadowing 'len' parameter Christian Couder
2016-05-11 13:16 ` [PATCH v2 05/94] builtin/apply: extract line_by_line_fuzzy_match() from match_fragment() Christian Couder
2016-05-12 19:20   ` Junio C Hamano
2016-05-11 13:16 ` [PATCH v2 06/94] builtin/apply: move 'options' variable into cmd_apply() Christian Couder
2016-05-11 13:16 ` [PATCH v2 07/94] builtin/apply: move 'read_stdin' global " Christian Couder
2016-05-11 13:16 ` [PATCH v2 08/94] builtin/apply: introduce 'struct apply_state' to start libifying Christian Couder
2016-05-11 13:16 ` [PATCH v2 09/94] builtin/apply: move 'state' init into init_apply_state() Christian Couder
2016-05-12 19:25   ` Junio C Hamano
2016-05-11 13:16 ` [PATCH v2 10/94] builtin/apply: move 'unidiff_zero' global into 'struct apply_state' Christian Couder
2016-05-12 19:28   ` Junio C Hamano
2016-05-12 20:18     ` Christian Couder
2016-05-11 13:16 ` [PATCH v2 11/94] builtin/apply: move 'check' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 12/94] builtin/apply: move 'check_index' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 13/94] builtin/apply: move 'apply_in_reverse' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 14/94] builtin/apply: move 'apply_with_reject' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 15/94] builtin/apply: move 'apply_verbosely' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 16/94] builtin/apply: move 'update_index' " Christian Couder
2016-05-12 19:31   ` Junio C Hamano
2016-05-11 13:16 ` [PATCH v2 17/94] builtin/apply: move 'allow_overlap' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 18/94] builtin/apply: move 'cached' " Christian Couder
2016-05-12 19:33   ` Junio C Hamano
2016-05-11 13:16 ` [PATCH v2 19/94] builtin/apply: move 'diffstat' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 20/94] builtin/apply: move 'numstat' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 21/94] builtin/apply: move 'summary' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 22/94] builtin/apply: move 'threeway' " Christian Couder
2016-05-12 19:41   ` Junio C Hamano
2016-05-12 20:26     ` Christian Couder
2016-05-12 21:21       ` Junio C Hamano
2016-05-11 13:16 ` [PATCH v2 23/94] builtin/apply: move 'no_add' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 24/94] builtin/apply: move 'unsafe_paths' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 25/94] builtin/apply: move 'line_termination' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 26/94] builtin/apply: move 'fake_ancestor' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 27/94] builtin/apply: move 'p_context' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 28/94] builtin/apply: move 'apply' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 29/94] builtin/apply: move 'patch_input_file' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 30/94] builtin/apply: move 'limit_by_name' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 31/94] builtin/apply: move 'has_include' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 32/94] builtin/apply: move 'p_value' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 33/94] builtin/apply: move 'p_value_known' " Christian Couder
2016-05-12 19:43   ` Junio C Hamano
2016-05-11 13:16 ` [PATCH v2 34/94] builtin/apply: move 'root' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 35/94] builtin/apply: move 'whitespace_error' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 36/94] builtin/apply: move 'whitespace_option' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 37/94] builtin/apply: remove whitespace_option arg from set_default_whitespace_mode() Christian Couder
2016-05-11 13:16 ` [PATCH v2 38/94] builtin/apply: move 'squelch_whitespace_errors' into 'struct apply_state' Christian Couder
2016-05-11 13:16 ` [PATCH v2 39/94] builtin/apply: move 'applied_after_fixing_ws' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 40/94] builtin/apply: move 'ws_error_action' " Christian Couder
2016-05-12 19:48   ` Junio C Hamano
2016-05-11 13:16 ` [PATCH v2 41/94] builtin/apply: move 'ws_ignore_action' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 42/94] builtin/apply: move 'max_change' and 'max_len' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 43/94] builtin/apply: move 'state_linenr' global " Christian Couder
2016-05-11 13:16 ` [PATCH v2 44/94] builtin/apply: move 'fn_table' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 45/94] builtin/apply: move 'symlink_changes' " Christian Couder
2016-05-11 13:16 ` [PATCH v2 46/94] builtin/apply: move 'state' check into check_apply_state() Christian Couder
2016-05-11 13:16 ` [PATCH v2 47/94] builtin/apply: move applying patches into apply_all_patches() Christian Couder
2016-05-11 13:16 ` [PATCH v2 48/94] builtin/apply: rename 'prefix_' parameter to 'prefix' Christian Couder
2016-05-12 19:56   ` Junio C Hamano
2016-05-12 20:43     ` Junio C Hamano
2016-05-13 19:45       ` Christian Couder
2016-05-14 18:27         ` Junio C Hamano
2016-05-24  8:24           ` Christian Couder [this message]
2016-05-13 19:42     ` Christian Couder
2016-05-24  8:15       ` Christian Couder
2016-05-11 13:17 ` [PATCH v2 49/94] builtin/apply: move 'lock_file' global into 'struct apply_state' Christian Couder
2016-05-11 13:17 ` [PATCH v2 50/94] builtin/apply: move 'newfd' " Christian Couder
2016-05-11 13:17 ` [PATCH v2 51/94] builtin/apply: make apply_patch() return -1 instead of die()ing Christian Couder
2016-05-11 13:17 ` [PATCH v2 52/94] builtin/apply: read_patch_file() " Christian Couder
2016-05-16  1:56   ` Eric Sunshine
2016-05-16 17:19     ` Christian Couder
2016-05-11 13:17 ` [PATCH v2 53/94] builtin/apply: make find_header() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 54/94] builtin/apply: make parse_chunk() return a negative integer on error Christian Couder
2016-05-16  3:04   ` Eric Sunshine
2016-05-16 18:19     ` Christian Couder
2016-06-08 15:14     ` Christian Couder
2016-05-11 13:17 ` [PATCH v2 55/94] builtin/apply: make parse_single_patch() return -1 " Christian Couder
2016-05-11 13:17 ` [PATCH v2 56/94] apply: move 'struct apply_state' to apply.h Christian Couder
2016-05-16  3:10   ` Eric Sunshine
2016-05-16 16:03     ` Junio C Hamano
2016-06-08 15:25       ` Christian Couder
2016-05-11 13:17 ` [PATCH v2 57/94] builtin/apply: make parse_whitespace_option() return -1 instead of die()ing Christian Couder
2016-05-11 13:17 ` [PATCH v2 58/94] builtin/apply: make parse_ignorewhitespace_option() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 59/94] builtin/apply: move init_apply_state() to apply.c Christian Couder
2016-05-16  3:16   ` Eric Sunshine
2016-05-11 13:17 ` [PATCH v2 60/94] apply: make init_apply_state() return -1 instead of exit()ing Christian Couder
2016-05-16  3:37   ` Eric Sunshine
2016-05-11 13:17 ` [PATCH v2 61/94] builtin/apply: make check_apply_state() return -1 instead of die()ing Christian Couder
2016-05-11 13:17 ` [PATCH v2 62/94] builtin/apply: move check_apply_state() to apply.c Christian Couder
2016-05-11 13:17 ` [PATCH v2 63/94] builtin/apply: make apply_all_patches() return -1 on error Christian Couder
2016-05-16  3:44   ` Eric Sunshine
2016-06-08 16:37     ` Christian Couder
2016-06-08 17:44       ` Eric Sunshine
2016-06-09 22:01         ` Christian Couder
2016-05-11 13:17 ` [PATCH v2 64/94] builtin/apply: make parse_traditional_patch() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 65/94] builtin/apply: make gitdiff_*() return 1 at end of header Christian Couder
2016-05-11 13:17 ` [PATCH v2 66/94] builtin/apply: make gitdiff_*() return -1 on error Christian Couder
2016-05-11 13:17 ` [PATCH v2 67/94] builtin/apply: change die_on_unsafe_path() to check_unsafe_path() Christian Couder
2016-05-11 13:17 ` [PATCH v2 68/94] builtin/apply: make build_fake_ancestor() return -1 on error Christian Couder
2016-05-11 13:17 ` [PATCH v2 69/94] builtin/apply: make remove_file() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 70/94] builtin/apply: make add_conflicted_stages_file() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 71/94] builtin/apply: make add_index_file() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 72/94] builtin/apply: make create_file() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 73/94] builtin/apply: make write_out_one_result() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 74/94] builtin/apply: make write_out_results() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 75/94] builtin/apply: make try_create_file() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 76/94] builtin/apply: make create_one_file() " Christian Couder
2016-05-11 13:17 ` [PATCH v2 77/94] builtin/apply: rename option parsing functions Christian Couder
2016-05-11 13:17 ` [PATCH v2 78/94] apply: rename and move opt constants to apply.h Christian Couder
2016-05-11 13:17 ` [PATCH v2 80/94] apply: make some parsing functions static again Christian Couder
2016-05-11 13:17 ` [PATCH v2 81/94] run-command: make dup_devnull() non static Christian Couder
2016-05-11 13:17 ` [PATCH v2 82/94] apply: roll back index lock file in case of error Christian Couder
2016-05-11 13:17 ` [PATCH v2 83/94] environment: add set_index_file() Christian Couder
2016-05-11 13:17 ` [PATCH v2 84/94] builtin/am: use apply api in run_apply() Christian Couder
2016-05-11 13:17 ` [PATCH v2 85/94] write_or_die: use warning() instead of fprintf(stderr, ...) Christian Couder
2016-05-11 13:17 ` [PATCH v2 86/94] apply: add 'be_silent' variable to 'struct apply_state' Christian Couder
2016-05-11 13:17 ` [PATCH v2 87/94] apply: make 'be_silent' incomatible with 'apply_verbosely' Christian Couder
2016-05-11 13:17 ` [PATCH v2 88/94] apply: don't print on stdout when be_silent is set Christian Couder
2016-05-11 13:17 ` [PATCH v2 89/94] usage: add set_warn_routine() Christian Couder
2016-05-11 13:17 ` [PATCH v2 90/94] usage: add get_error_routine() and get_warn_routine() Christian Couder
2016-05-11 13:17 ` [PATCH v2 91/94] apply: change error_routine when be_silent is set Christian Couder
2016-05-11 13:17 ` [PATCH v2 92/94] am: use be_silent in 'struct apply_state' to shut up applying patches Christian Couder
2016-05-11 13:17 ` [PATCH v2 93/94] run-command: make dup_devnull() static again Christian Couder
2016-05-11 13:17 ` [PATCH v2 94/94] builtin/apply: add a cli option for be_silent Christian Couder
2016-05-12 17:06 ` [PATCH v2 00/94] libify apply and use lib in am Johannes Sixt
2016-05-12 18:02   ` Christian Couder
2016-06-09 21:10     ` Johannes Sixt
2016-06-10  6:40       ` Christian Couder
2016-06-10  7:01       ` Johannes Schindelin
2016-06-10  8:59         ` Christian Couder
2016-06-10 11:11           ` Johannes Schindelin
2016-06-10 17:04             ` Johannes Sixt
2016-06-10 20:31               ` Christian Couder
2016-06-11  7:02               ` Johannes Schindelin
2016-05-12 19:04   ` Junio C Hamano
2016-05-12 20:05     ` Christian Couder
2016-05-13  6:32 ` Johannes Schindelin
2016-05-13 18:49   ` Christian Couder
2016-05-14  6:26     ` Johannes Schindelin
2016-05-14  9:19       ` Christian Couder
2016-05-14 18:31         ` Junio C Hamano
2016-05-14 19:37           ` Christian Couder
2016-05-15 18:30             ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP8UFD0FrK2tL49SLUxX5Zq4PHsmOP3aih9M9VAxw31P9eRH2Q@mail.gmail.com \
    --to=christian.couder@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=avarab@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karsten.blees@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=ramsay@ramsayjones.plus.com \
    --cc=sbeller@google.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.