Re: [PATCH v4 42/44] builtin-am: implement legacy -b/--binary option
- From
Stefan Beller <sbeller@google.com>
- Date
- Jun 29, 2015, 20:05 UTC
- Message-ID
- <CAGZ79kaCV-PbMOBKgPAdX0VK3vWVYrJy_gQJF6dxX9JZhatpcg@mail.gmail.com>
- In-Reply-To
- <1435500366-31700-43-git-send-email-pyokagan@gmail.com>
On Sun, Jun 28, 2015 at 7:06 AM, Paul Tan <pyokagan@gmail.com> wrote:
Show 17 quoted lines
> The -b/--binary option was initially implemented in 087b674 (git-am: > --binary; document --resume and --binary., 2005-11-16). The option will > pass the --binary flag to git-apply to allow it to apply binary patches. > > However, in 2b6eef9 (Make apply --binary a no-op., 2006-09-06), --binary > was been made a no-op in git-apply. Following that, since cb3a160 > (git-am: ignore --binary option, 2008-08-09), the --binary option in > git-am is ignored as well. > > In 6c15a1c (am: officially deprecate -b/--binary option, 2012-03-13), > the --binary option was tweaked to its present behavior: when set, the > message: > > The -b/--binary option has been a no-op for long time, and it > will be removed. Please do not use it anymore. > > will be printed.
I wonder if now would be the right time? The rewrite aim's at full feature compatibility, but we may want to revert this commit on top of patch 44 later.
Show 43 quoted lines
>
> Re-implement this in builtin/am.c.
>
> Signed-off-by: Paul Tan <pyokagan@gmail.com>
> ---
> builtin/am.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/builtin/am.c b/builtin/am.c
> index f148f05..a46aa74 100644
> --- a/builtin/am.c
> +++ b/builtin/am.c
> @@ -2148,6 +2148,7 @@ enum resume_mode {
> int cmd_am(int argc, const char **argv, const char *prefix)
> {
> struct am_state state;
> + int binary = -1;
> int keep_cr = -1;
> int patch_format = PATCH_FORMAT_UNKNOWN;
> enum resume_mode resume = RESUME_FALSE;
> @@ -2161,6 +2162,8 @@ int cmd_am(int argc, const char **argv, const char *prefix)
> struct option options[] = {
> OPT_BOOL('i', "interactive", &state.interactive,
> N_("run interactively")),
> + OPT_HIDDEN_BOOL('b', "binary", &binary,
> + N_("(historical option -- no-op")),
> OPT_BOOL('3', "3way", &state.threeway,
> N_("allow fall back on 3way merging if needed")),
> OPT__QUIET(&state.quiet, N_("be quiet")),
> @@ -2261,6 +2264,10 @@ int cmd_am(int argc, const char **argv, const char *prefix)
>
> argc = parse_options(argc, argv, prefix, options, usage, 0);
>
> + if (binary >= 0)
> + fprintf_ln(stderr, _("The -b/--binary option has been a no-op for long time, and\n"
> + "it will be removed. Please do not use it anymore."));
> +
> if (read_index_preload(&the_index, NULL) < 0)
> die(_("failed to read the index"));
>
> --
> 2.5.0.rc0.76.gb2c6e93
>