All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Christian Couder <chriscool@tuxfamily.org>,
	Thomas Rast <trast@inf.ethz.ch>
Subject: Re: [PATCH v2 8/8] revert/cherry-pick: add --skip option
Date: Wed, 29 May 2013 17:57:57 +0530	[thread overview]
Message-ID: <CALkWK0m02XCVnrnFQ+mF8FFZEMD36_J3Tyjh-E4SuZ++xdcXHQ@mail.gmail.com> (raw)
In-Reply-To: <1369799788-24803-9-git-send-email-felipe.contreras@gmail.com>

Felipe Contreras wrote:
> Akin to 'am --skip' and 'rebase --skip'.

This ranged-cherry-pick can be useful for small ranges.  As pointed
out by others on the list, it hemorrhages memory quite horribly (and
this problem is non-trivial to fix).  Perhaps we should document this
in limitations or bugs if we intend to make it more useful?

> diff --git a/builtin/revert.c b/builtin/revert.c
> index d63b4a6..6afd990 100644
> --- a/builtin/revert.c
> +++ b/builtin/revert.c
> @@ -99,11 +99,13 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)
>         int remove_state = 0;
>         int contin = 0;
>         int rollback = 0;
> +       int skip = 0;

Ugh, one more integer.  Can't we use an OPT_BIT and store the action
in one variable? No hurry ofcourse: just asking.

> @@ -1201,7 +1203,7 @@ static int sequencer_continue(struct replay_opts *opts)
>         }
>         if (index_differs_from("HEAD", 0))
>                 return error_dirty_index(opts);
> -       {
> +       if (!skip) {
>                 unsigned char to[20];
>                 if (!read_ref("HEAD", to))
>                         add_rewritten(todo_list->item->object.sha1, to);

Couldn't you just say if (skip) todo_list = todo_list -> next?

> +       if (setup_rerere(&merge_rr, 0) >= 0) {
> +               rerere_clear(&merge_rr);
> +               string_list_clear(&merge_rr, 1);
> +       }

Why exactly?  Why doesn't rebase --skip 'rerere clear'?

> +       argv[0] = "reset";
> +       argv[1] = "--hard";
> +       argv[2] = "HEAD";
> +       argv[3] = NULL;
> +       ret = run_command_v_opt(argv, RUN_GIT_CMD);

Unrelated to your patch, but any clue why reset doesn't have an api
yet?  Does it leak memory too?

  reply	other threads:[~2013-05-29 12:28 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29  3:56 [PATCH v2 0/8] cherry-pick: improvements Felipe Contreras
2013-05-29  3:56 ` [PATCH v2 1/8] sequencer: remove useless indentation Felipe Contreras
2013-05-29  3:56 ` [PATCH v2 2/8] sequencer: trivial fix Felipe Contreras
2013-05-29  3:56 ` [PATCH v2 3/8] cherry-pick: add --skip-empty option Felipe Contreras
2013-06-03 18:40   ` Junio C Hamano
2013-06-03 19:21     ` Junio C Hamano
2013-06-03 21:10     ` Felipe Contreras
2013-06-03 21:45       ` Junio C Hamano
2013-06-04 17:10         ` Felipe Contreras
2013-06-04 17:35           ` Junio C Hamano
2013-06-04 17:40             ` Felipe Contreras
2013-06-04 18:30               ` Junio C Hamano
2013-06-05 14:52                 ` Felipe Contreras
2013-06-05 18:13                   ` Junio C Hamano
2013-06-06  5:01                     ` Felipe Contreras
2013-06-04  6:31       ` Antoine Pelisse
2013-05-29  3:56 ` [PATCH v2 4/8] cherry-pick: store rewritten commits Felipe Contreras
2013-06-03 18:49   ` Junio C Hamano
2013-06-03 20:55     ` Felipe Contreras
2013-05-29  3:56 ` [PATCH v2 5/8] sequencer: run post-rewrite hook Felipe Contreras
2013-06-03 18:57   ` Junio C Hamano
2013-06-03 21:01     ` Felipe Contreras
2013-06-04  9:03     ` Thomas Rast
2013-05-29  3:56 ` [PATCH v2 6/8] cherry-pick: add support to copy notes Felipe Contreras
2013-05-29  3:56 ` [PATCH v2 7/8] revert/cherry-pick: add --quiet option Felipe Contreras
2013-05-29 12:33   ` Ramkumar Ramachandra
2013-05-29 13:28     ` Felipe Contreras
2013-05-29 13:32       ` Ramkumar Ramachandra
2013-05-29 13:40         ` Felipe Contreras
2013-06-03 18:59   ` Junio C Hamano
2013-05-29  3:56 ` [PATCH v2 8/8] revert/cherry-pick: add --skip option Felipe Contreras
2013-05-29 12:27   ` Ramkumar Ramachandra [this message]
2013-05-29 13:27     ` Felipe Contreras

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=CALkWK0m02XCVnrnFQ+mF8FFZEMD36_J3Tyjh-E4SuZ++xdcXHQ@mail.gmail.com \
    --to=artagnon@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=trast@inf.ethz.ch \
    /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.