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

Re: [PATCH 0/8] sequencer refactoring

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Apr 6, 2023, 12:09 UTC
Message-ID
<7663c59d-2bdd-56b2-dab9-3011f9398c09@gmail.com>
In-Reply-To
<f72b3820-124c-3e2c-30e2-ca3f46b74dc0@dunelm.org.uk>
On 25/03/2023 11:08, Phillip Wood wrote:
Show 40 quoted lines
> Hi Oswald
> 
> On 23/03/2023 16:22, Oswald Buddenhagen wrote:
>> This is a preparatory series for the separately posted 'rebase 
>> --rewind' patch,
>> but I think it has value in itself.
> 
> I had a hard time applying these patches. In the end I had success with 
> checking out next, applying 
> https://lore.kernel.org/git/20230323162234.995514-1-oswald.buddenhagen@gmx.de and then applying this series. It is very helpful to detail the base commit in the cover letter. A series like this should normally be based on master see Documentation/SubmittingPatches.
> 
> Having applied the patches I'm unable to compile them with DEVELOPER=1 
> (see Documentation/CodingGuidelines)
> 
> In file included from log-tree.c:20:
> sequencer.h:7:6: error: ISO C forbids forward references to ‘enum’ types 
> [-Werror=pedantic]
>      7 | enum rebase_action;
>        |      ^~~~~~~~~~~~~
> sequencer.h:140:34: error: ISO C forbids forward references to ‘enum’ 
> types [-Werror=pedantic]
>    140 |                             enum rebase_action action);
>        |                                  ^~~~~~~~~~~~~
> sequencer.h:196:26: error: ISO C forbids forward references to ‘enum’ 
> types [-Werror=pedantic]
>    196 |                     enum rebase_action action);
>        |                          ^~~~~~~~~~~~~
> 
> In file included from ./cache.h:12,
>                   from ./builtin.h:6,
>                   from builtin/rebase.c:8:
> builtin/rebase.c: In function ‘cmd_rebase’:
> builtin/rebase.c:1246:95: error: left-hand operand of comma expression 
> has no effect [-Werror=unused-value]
>   1246 | (BUILD_ASSERT_OR_ZERO(ARRAY_SIZE(action_names) == ACTION_LAST),
>        |                               ^
> ./trace2.h:158:69: note: in definition of macro ‘trace2_cmd_mode’
>    158 | #define trace2_cmd_mode(sv) trace2_cmd_mode_fl(__FILE__, 
> __LINE__, (sv))
>        |     ^~

I think the errors above are best addressed by dropping patch 3 as I don't think the benefit is worth the churn. You say that the existing code is fragile but it is not that hard to follow and is battle tested and known to work. If you need to change things to support --rewind then it would be better to do so in a series that adds that option.

> sequencer.c: In function ‘todo_list_rearrange_squash’:
> sequencer.c:6346:23: error: operation on ‘items’ may be undefined 
> [-Werror=sequence-point]
>   6346 |                 items = ALLOC_ARRAY(items, todo_list->nr);

This is easily fixed by deleting "items =" as ALLOC_ARRAY() does the assignment for us.

After dropping patches 3 and 7 and fixing the ARROC_ARRAY() above all the rebase tests pass for each commit and the CI passes - https://github.com/phillipwood/git/actions/runs/4627831184

Best Wishes
Phillip
Show 26 quoted lines
> 
> Best Wishes
> 
> Phillip
> 
>>
>> Oswald Buddenhagen (8):
>>    rebase: simplify code related to imply_merge()
>>    rebase: move parse_opt_keep_empty() down
>>    sequencer: pass around rebase action explicitly
>>    sequencer: create enum for edit_todo_list() return value
>>    rebase: preserve interactive todo file on checkout failure
>>    sequencer: simplify allocation of result array in
>>      todo_list_rearrange_squash()
>>    sequencer: pass `onto` to complete_action() as object-id
>>    rebase: improve resumption from incorrect initial todo list
>>
>>   builtin/rebase.c              |  63 +++++++--------
>>   builtin/revert.c              |   3 +-
>>   rebase-interactive.c          |  36 ++++-----
>>   rebase-interactive.h          |  27 ++++++-
>>   sequencer.c                   | 139 +++++++++++++++++++---------------
>>   sequencer.h                   |  15 ++--
>>   t/t3404-rebase-interactive.sh |  34 ++++++++-
>>   7 files changed, 196 insertions(+), 121 deletions(-)
>>
Previous: Phillip WoodNext: Phillip Wood
Message 48 of 49 in “sequencer refactoring”
  1. 0/8 sequencer refactoringOswald Buddenhagen, Mar 23, 2023
  2. 8/8 rebase: improve resumption from incorrect initial todo listOswald Buddenhagen, Mar 23, 2023
  3. Phillip WoodMar 26, 2023
  4. Oswald BuddenhagenApr 26, 2023
  5. Phillip WoodMay 17, 2023
  6. Oswald BuddenhagenAug 24, 2023
  7. 1/8 rebase: simplify code related to imply_merge()Oswald Buddenhagen, Mar 23, 2023
  8. Phillip WoodMar 23, 2023
  9. Junio C HamanoMar 23, 2023
  10. Felipe ContrerasMar 23, 2023
  11. 0/3 rebase refactoringOswald Buddenhagen, Aug 9, 2023
  12. 1/3 rebase: simplify code related to imply_merge()Oswald Buddenhagen, Aug 9, 2023
  13. 2/3 rebase: handle --strategy via imply_merge() as wellOswald Buddenhagen, Aug 9, 2023
  14. 3/3 rebase: move parse_opt_keep_empty() downOswald Buddenhagen, Aug 9, 2023
  15. Phillip WoodAug 15, 2023
  16. 0/3 rebase refactoringOswald Buddenhagen, Oct 20, 2023
  17. 2/3 rebase: handle --strategy via imply_merge() as wellOswald Buddenhagen, Oct 20, 2023
  18. Junio C HamanoOct 20, 2023
  19. 3/3 rebase: move parse_opt_keep_empty() downOswald Buddenhagen, Oct 20, 2023
  20. 1/3 rebase: simplify code related to imply_merge()Oswald Buddenhagen, Oct 20, 2023
  21. Junio C HamanoOct 20, 2023
  22. Phillip WoodOct 23, 2023
  23. Junio C HamanoOct 23, 2023
  24. 2/8 rebase: move parse_opt_keep_empty() downOswald Buddenhagen, Mar 23, 2023
  25. Phillip WoodMar 23, 2023
  26. 4/8 sequencer: create enum for edit_todo_list() return valueOswald Buddenhagen, Mar 23, 2023
  27. Phillip WoodMar 23, 2023
  28. 5/8 rebase: preserve interactive todo file on checkout failureOswald Buddenhagen, Mar 23, 2023
  29. Phillip WoodMar 23, 2023
  30. Oswald BuddenhagenMar 23, 2023
  31. Phillip WoodMar 24, 2023
  32. Oswald BuddenhagenMar 24, 2023
  33. Junio C HamanoMar 23, 2023
  34. Oswald BuddenhagenMar 23, 2023
  35. Junio C HamanoMar 24, 2023
  36. 3/8 sequencer: pass around rebase action explicitlyOswald Buddenhagen, Mar 23, 2023
  37. Phillip WoodMar 23, 2023
  38. Oswald BuddenhagenMar 23, 2023
  39. 6/8 sequencer: simplify allocation of result array in todo_list_rearrange_squash()Oswald Buddenhagen, Mar 23, 2023
  40. Phillip WoodMar 23, 2023
  41. Oswald BuddenhagenMar 23, 2023
  42. 7/8 sequencer: pass `onto` to complete_action() as object-idOswald Buddenhagen, Mar 23, 2023
  43. Phillip WoodMar 23, 2023
  44. Oswald BuddenhagenMar 23, 2023
  45. Phillip WoodMar 24, 2023
  46. Phillip WoodMar 23, 2023
  47. Phillip WoodMar 25, 2023
  48. Phillip WoodApr 6, 2023
  49. Phillip WoodMay 17, 2023

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.