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

Re: [PATCH v2 8/8] revert/cherry-pick: add --skip option

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 29, 2013, 13:27 UTC
Message-ID
<CAMP44s1i9H9cp_RoOo-rDWL6b76=zxbwC19=DnUayK_Ti2CXFA@mail.gmail.com>
In-Reply-To
<CALkWK0m02XCVnrnFQ+mF8FFZEMD36_J3Tyjh-E4SuZ++xdcXHQ@mail.gmail.com>

On Wed, May 29, 2013 at 7:27 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 7 quoted lines
> 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?
Is there a test-case that triggers this?
I don't see why we shouldn't try to fix this.
Show 12 quoted lines
>> 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.

I thought of switching to bit fields, but then I opened builtin/checkout.c to see how many options were implemented, and I saw more ints, so I left it like that.

Show 11 quoted lines
>> @@ -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?

We are already doing that. And after that we need to continue with the rest of the commits.

Show 6 quoted lines
>> +       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'?
It does, and so does 'git am', so why shouldn't 'git cherry-pick'.
Also, I think the same should happen in --abort.
-- 
Felipe Contreras
Previous: Ramkumar Ramachandra
Message 33 of 33 in “cherry-pick: improvements”
  1. 0/8 cherry-pick: improvementsFelipe Contreras, May 29, 2013
  2. 1/8 sequencer: remove useless indentationFelipe Contreras, May 29, 2013
  3. 2/8 sequencer: trivial fixFelipe Contreras, May 29, 2013
  4. 3/8 cherry-pick: add --skip-empty optionFelipe Contreras, May 29, 2013
  5. Junio C HamanoJun 3, 2013
  6. Junio C HamanoJun 3, 2013
  7. Felipe ContrerasJun 3, 2013
  8. Junio C HamanoJun 3, 2013
  9. Felipe ContrerasJun 4, 2013
  10. Junio C HamanoJun 4, 2013
  11. Felipe ContrerasJun 4, 2013
  12. Junio C HamanoJun 4, 2013
  13. Felipe ContrerasJun 5, 2013
  14. Junio C HamanoJun 5, 2013
  15. Felipe ContrerasJun 6, 2013
  16. Antoine PelisseJun 4, 2013
  17. 4/8 cherry-pick: store rewritten commitsFelipe Contreras, May 29, 2013
  18. Junio C HamanoJun 3, 2013
  19. Felipe ContrerasJun 3, 2013
  20. 5/8 sequencer: run post-rewrite hookFelipe Contreras, May 29, 2013
  21. Junio C HamanoJun 3, 2013
  22. Felipe ContrerasJun 3, 2013
  23. Thomas RastJun 4, 2013
  24. 6/8 cherry-pick: add support to copy notesFelipe Contreras, May 29, 2013
  25. 7/8 revert/cherry-pick: add --quiet optionFelipe Contreras, May 29, 2013
  26. Ramkumar RamachandraMay 29, 2013
  27. Felipe ContrerasMay 29, 2013
  28. Ramkumar RamachandraMay 29, 2013
  29. Felipe ContrerasMay 29, 2013
  30. Junio C HamanoJun 3, 2013
  31. 8/8 revert/cherry-pick: add --skip optionFelipe Contreras, May 29, 2013
  32. Ramkumar RamachandraMay 29, 2013
  33. Felipe ContrerasMay 29, 2013

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.