[PATCH] p3400: replace calls to `git checkout -b' by `git checkout -B'

2018-11-09 Thread Alban Gruin
checkout -B' to force the creation and update of these branches. Signed-off-by: Alban Gruin --- t/perf/p3400-rebase.sh | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/perf/p3400-rebase.sh b/t/perf/p3400-rebase.sh index ce271ca4c1..d202aaed06 100755 --- a/t/perf/p3400

[PATCH v3 02/16] sequencer: make the todo_list structure public

2018-11-09 Thread Alban Gruin
This makes the structures todo_list and todo_item, and the functions todo_list_release() and parse_insn_buffer(), accessible outside of sequencer.c. Signed-off-by: Alban Gruin --- sequencer.c | 67 + sequencer.h | 49

[PATCH v3 09/16] sequencer: change complete_action() to use the refactored functions

2018-11-09 Thread Alban Gruin
the "logic" functions to avoid useless file access. The parsing of the list has to be done by the caller. If the buffer of the todo list provided by the caller is empty, a `noop' command is directly added to the todo list, without touching to the buffer. Signed-off-by: Alban Gruin --- buil

[PATCH v3 01/16] sequencer: changes in parse_insn_buffer()

2018-11-09 Thread Alban Gruin
, the type of the corresponding command is set to a garbage value, and its argument is defined properly. This will allow to recreate the text of a todo list from its commands, even if one of them is incorrect. Signed-off-by: Alban Gruin --- No changes since v2. sequencer.c | 7 ++- 1 file changed

[PATCH v3 13/16] rebase-interactive: rewrite edit_todo_list() to handle the initial edit

2018-11-09 Thread Alban Gruin
list is edited in the middle of a rebase session). Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 23 - rebase-interactive.c | 48 ++- rebase-interactive.h | 4 ++- sequencer.c | 3 +-- sequencer.h

[PATCH v3 08/16] sequencer: make sequencer_make_script() write its script to a strbuf

2018-11-09 Thread Alban Gruin
This makes sequencer_make_script() write its script to a strbuf (ie. the buffer of a todo_list) instead of a FILE. This reduce the amount of read/write made by rebase interactive. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 13 +++- sequencer.c | 38

[PATCH v3 15/16] sequencer: fix a call to error() in transform_todo_file()

2018-11-09 Thread Alban Gruin
This replaces a call to error() by a call to error_errno() after writing the content of the todo list to the disk in transform_todo_file(). Signed-off-by: Alban Gruin --- No changes since v2. sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer.c b

[PATCH v3 16/16] rebase--interactive: move transform_todo_file() to rebase--interactive.c

2018-11-09 Thread Alban Gruin
As transform_todo_file() is only needed inside of rebase--interactive.c, it is moved there from sequencer.c. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 20 sequencer.c | 20 sequencer.h | 1 - 3

[PATCH v3 10/16] sequencer: refactor skip_unnecessary_picks() to work on a todo_list

2018-11-09 Thread Alban Gruin
the list. This also means its buffer cannot be directly written to the disk. rewrite_file() is then removed, as it is now unused. Signed-off-by: Alban Gruin --- sequencer.c | 79 - 1 file changed, 17 insertions(+), 62 deletions(-) diff --git

[PATCH v3 06/16] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list

2018-11-09 Thread Alban Gruin
() still uses sequencer_add_exec_commands() for now. This will be changed in a future commit. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 15 +++-- sequencer.c | 111 +- sequencer.h | 4 +- 3 files changed

[PATCH v3 05/16] sequencer: refactor check_todo_list() to work on a todo_list

2018-11-09 Thread Alban Gruin
-interactive.c, and made static again. Signed-off-by: Alban Gruin --- No changes since v2. builtin/rebase--interactive.c | 2 +- rebase-interactive.c | 90 - rebase-interactive.h | 1 + sequencer.c | 120

[PATCH v3 03/16] sequencer: refactor transform_todos() to work on a todo_list

2018-11-09 Thread Alban Gruin
, but they will be replaced in a future commit. todo_list_transform() is not a static function, because it will be used by edit_todo_list() from rebase-interactive.c in a future commit. Signed-off-by: Alban Gruin --- No changes since v2. builtin/rebase--interactive.c | 2 +- rebase-interactive.c

[PATCH v3 12/16] rebase-interactive: append_todo_help() changes

2018-11-09 Thread Alban Gruin
s. Signed-off-by: Alban Gruin --- rebase-interactive.c | 12 +++- rebase-interactive.h | 3 ++- sequencer.c | 17 - 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/rebase-interactive.c b/rebase-interactive.c index 23569cfa3c..3b7b5e3382 100644 --

[PATCH v3 11/16] rebase-interactive: use todo_list_write_to_file() in edit_todo_list()

2018-11-09 Thread Alban Gruin
Just like complete_action(), edit_todo_list() used a function (transform_todo_file()) that read the todo list from the disk and wrote it back, resulting in useless disk accesses. This changes edit_todo_list() to call directly todo_list_write_to_file() instead. Signed-off-by: Alban Gruin

[PATCH v3 07/16] sequencer: refactor rearrange_squash() to work on a todo_list

2018-11-09 Thread Alban Gruin
(). complete_action() still uses rearrange_squash_in_todo_file() for now. This will be changed in a future commit. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 2 +- sequencer.c | 87 +-- sequencer.h | 2 +- 3

[PATCH v3 04/16] sequencer: introduce todo_list_write_to_file()

2018-11-09 Thread Alban Gruin
. todo_list_write_to_file() can also take care of appending the help text to the buffer before writing it to the disk, or to write only the first n items of the list. This feature will be used by skip_unnecessary_picks(), which has to write done commands in a file. Signed-off-by: Alban Gruin

[PATCH v3 14/16] sequencer: use edit_todo_list() in complete_action()

2018-11-09 Thread Alban Gruin
This changes complete_action() to use edit_todo_list(), now that it can handle the initial edit of the todo list. Signed-off-by: Alban Gruin --- sequencer.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/sequencer.c b/sequencer.c index f04b002e37

[PATCH v3 00/16] sequencer: refactor functions working on a todo_list

2018-11-09 Thread Alban Gruin
- Replacing calls to memcpy() by shallow copies - Applying array.cocci.patch Alban Gruin (16): sequencer: changes in parse_insn_buffer() sequencer: make the todo_list structure public sequencer: refactor transform_todos() to work on a todo_list sequencer: introduce todo_list_write_t

Re: [PATCH v2 06/16] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list

2018-11-02 Thread Alban Gruin
Hi Phillip, Le 02/11/2018 à 11:09, Phillip Wood a écrit : +    struct todo_item *items = NULL, +    base_item = {TODO_EXEC, NULL, 0, 0, commands_len, 0}; + +    strbuf_addstr(buf, commands); +    base_item.offset_in_buf = buf->len - commands_len - 1; +   

Re: [PATCH v2 06/16] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list

2018-11-01 Thread Alban Gruin
Le 30/10/2018 à 17:47, Phillip Wood a écrit : > On 27/10/2018 22:29, Alban Gruin wrote: >> This refactors sequencer_add_exec_commands() to work on a todo_list to >> avoid redundant reads and writes to the disk. >> >> An obvious way to do this would be to insert

Re: [PATCH v2 04/16] sequencer: introduce todo_list_write_to_file()

2018-11-01 Thread Alban Gruin
Hi Phillip, Le 30/10/2018 à 17:28, Phillip Wood a écrit : > Hi Alban > > I like the direction this is going, it is an improvement on re-scanning > the list at the end of each function. > > On 27/10/2018 22:29, Alban Gruin wrote: >> This introduce a new function to rec

Re: [PATCH v2 00/16] sequencer: refactor functions working on a todo_list

2018-10-29 Thread Alban Gruin
Hi Junio, Le 29/10/2018 à 04:05, Junio C Hamano a écrit : > Alban Gruin writes: […] >> It is based onto ag/rebase-i-in-c (34b4731, "rebase -i: move >> rebase--helper modes to rebase--interactive"). > > As there are quite a lot of fixes to the sequencer machinery

[PATCH v2 04/16] sequencer: introduce todo_list_write_to_file()

2018-10-27 Thread Alban Gruin
is unused, and so is dropped. todo_list_write_to_file() can also take care to append the help text to the buffer before writing it to the disk, or to write only the first n items of the list. Signed-off-by: Alban Gruin --- sequencer.c | 59

[PATCH v2 09/16] sequencer: change complete_action() to use the refactored functions

2018-10-27 Thread Alban Gruin
the "logic" functions to avoid useless file access. The parsing of the list has to be done by the caller. If the buffer of the todo list provided by the caller is empty, a `noop' command is directly added to the todo list, without touching to the buffer. Signed-off-by: Alban Gruin --- buil

[PATCH v2 14/16] sequencer: use edit_todo_list() in complete_action()

2018-10-27 Thread Alban Gruin
This changes complete_action() to use edit_todo_list(), now that it can handle the initial edit of the todo list. Signed-off-by: Alban Gruin --- sequencer.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/sequencer.c b/sequencer.c index a03505f582

[PATCH v2 13/16] rebase-interactive: rewrite edit_todo_list() to handle the initial edit

2018-10-27 Thread Alban Gruin
list is edited in the middle of a rebase session). Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 23 - rebase-interactive.c | 48 ++- rebase-interactive.h | 4 ++- sequencer.c | 3 +-- sequencer.h

[PATCH v2 06/16] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list

2018-10-27 Thread Alban Gruin
in a future commit. Signed-off-by: Alban Gruin --- sequencer.c | 69 + 1 file changed, 49 insertions(+), 20 deletions(-) diff --git a/sequencer.c b/sequencer.c index e12860c047..12a3efeca8 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4216,6

[PATCH v2 10/16] sequencer: refactor skip_unnecessary_picks() to work on a todo_list

2018-10-27 Thread Alban Gruin
the list. This also means its buffer cannot be directly written to the disk. rewrite_file() is then removed, as it is now unused. Signed-off-by: Alban Gruin --- sequencer.c | 80 - 1 file changed, 18 insertions(+), 62 deletions(-) diff --git

[PATCH v2 05/16] sequencer: refactor check_todo_list() to work on a todo_list

2018-10-27 Thread Alban Gruin
-interactive.c, and made static again. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 2 +- rebase-interactive.c | 90 - rebase-interactive.h | 1 + sequencer.c | 120 +++--- sequencer.h

[PATCH v2 08/16] sequencer: make sequencer_make_script() write its script to a strbuf

2018-10-27 Thread Alban Gruin
This makes sequencer_make_script() write its script to a strbuf (ie. the buffer of a todo_list) instead of a FILE. This reduce the amount of read/write made by rebase interactive. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 13 +++- sequencer.c | 38

[PATCH v2 12/16] rebase-interactive: append_todo_help() changes

2018-10-27 Thread Alban Gruin
s. Signed-off-by: Alban Gruin --- rebase-interactive.c | 12 +++- rebase-interactive.h | 3 ++- sequencer.c | 16 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/rebase-interactive.c b/rebase-interactive.c index b2be99a900..0643d54b1b 100644 --

[PATCH v2 11/16] rebase-interactive: use todo_list_write_to_file() in edit_todo_list()

2018-10-27 Thread Alban Gruin
Just like complete_action(), edit_todo_list() used a function (transform_todo_file()) that read the todo list from the disk and wrote it back, resulting in useless disk accesses. This changes edit_todo_list() to call directly todo_list_write_to_file() instead. Signed-off-by: Alban Gruin

[PATCH v2 16/16] rebase--interactive: move transform_todo_file() to rebase--interactive.c

2018-10-27 Thread Alban Gruin
As transform_todo_file() is only needed inside of rebase--interactive.c, it is moved there from sequencer.c. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 20 sequencer.c | 20 sequencer.h | 1 - 3

[PATCH v2 15/16] sequencer: fix a call to error() in transform_todo_file()

2018-10-27 Thread Alban Gruin
This replaces a call to error() by a call to error_errno() after writing the content of the todo list to the disk in transform_todo_file(). Signed-off-by: Alban Gruin --- No changes since v1, was commit 14/15. sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 07/16] sequencer: refactor rearrange_squash() to work on a todo_list

2018-10-27 Thread Alban Gruin
(). complete_action() still uses rearrange_squash_in_todo_file() for now. This will be changed in a future commit. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 2 +- sequencer.c | 87 +-- sequencer.h | 2 +- 3

[PATCH v2 01/16] sequencer: changes in parse_insn_buffer()

2018-10-27 Thread Alban Gruin
, the type of the corresponding command is set to a garbage value, and its argument is defined properly. This will allow to recreate the text of a todo list from its commands, even if one of them is incorrect. Signed-off-by: Alban Gruin --- sequencer.c | 7 ++- 1 file changed, 6 insertions(+), 1

[PATCH v2 03/16] sequencer: refactor transform_todos() to work on a todo_list

2018-10-27 Thread Alban Gruin
, but they will be replaced in a future commit. todo_list_transform() is not a static function, because it will be used by edit_todo_list() from rebase-interactive.c in a future commit. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 2 +- rebase-interactive.c | 4

[PATCH v2 00/16] sequencer: refactor functions working on a todo_list

2018-10-27 Thread Alban Gruin
ion() no longer writes "noop\n" to the todo list buffer if it is empty. Instead, it appends a `noop' command to the item list. Alban Gruin (16): sequencer: changes in parse_insn_buffer() sequencer: make the todo_list structure public sequencer: refactor transform_todos() to wo

[PATCH v2 02/16] sequencer: make the todo_list structure public

2018-10-27 Thread Alban Gruin
This makes the structures todo_list and todo_item, and the functions todo_list_release() and parse_insn_buffer(), accessible outside of sequencer.c. Signed-off-by: Alban Gruin --- No changes since v1. sequencer.c | 66 + sequencer.h | 48

Re: [PATCH v2 3/3] rebase (autostash): use an explicit OID to apply the stash

2018-10-23 Thread Alban Gruin
Hi Johannes, this looks good to me, too! Cheers, Alban

Re: What's cooking in git.git (Oct 2018, #04; Fri, 19)

2018-10-20 Thread Alban Gruin
Le 19/10/2018 à 20:05, Alban Gruin a écrit : > Le 19/10/2018 à 14:46, SZEDER Gábor a écrit : >> On Fri, Oct 19, 2018 at 03:02:22PM +0900, Junio C Hamano wrote: >>> Two large set of topics on "rebase in C" and "rebase -i in C" are >>> now in 'next'. &g

Re: What's cooking in git.git (Oct 2018, #04; Fri, 19)

2018-10-19 Thread Alban Gruin
Hi, Le 19/10/2018 à 14:46, SZEDER Gábor a écrit : > On Fri, Oct 19, 2018 at 03:02:22PM +0900, Junio C Hamano wrote: >> Two large set of topics on "rebase in C" and "rebase -i in C" are >> now in 'next'. > > I see occasional failures in 't5520-pull.sh': > > […] > > When running t5520 in a loop,

Re: [PATCH 04/15] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list

2018-10-12 Thread Alban Gruin
Le 12/10/2018 à 11:54, Phillip Wood a écrit : > On 11/10/2018 17:57, Alban Gruin wrote: > > Hi Phillip, > > > > thanks for taking the time to review my patches. > > > > Le 11/10/2018 à 13:25, Phillip Wood a écrit : > >> On 07/10/2018 20:54, Alban Grui

Re: [PATCH 10/15] rebase-interactive: use todo_list_transform() in edit_todo_list()

2018-10-11 Thread Alban Gruin
Le 11/10/2018 à 17:16, Phillip Wood a écrit : > On 07/10/2018 20:54, Alban Gruin wrote: >> Just like complete_action(), edit_todo_list() used a >> function (transform_todo_file()) that read the todo-list from the disk >> and wrote it back, resulting in useless disk accesse

Re: [PATCH 08/15] sequencer: change complete_action() to use the refactored functions

2018-10-11 Thread Alban Gruin
Le 11/10/2018 à 15:51, Phillip Wood a écrit : > On 07/10/2018 20:54, Alban Gruin wrote: >> +    if (rewrite_file(todo_file, new_todo.buf.buf, new_todo.buf.len) < >> 0) { >> +    todo_list_release(_todo); >> +    return error_errno(_(&quo

Re: [PATCH 04/15] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list

2018-10-11 Thread Alban Gruin
Hi Phillip, thanks for taking the time to review my patches. Le 11/10/2018 à 13:25, Phillip Wood a écrit : > On 07/10/2018 20:54, Alban Gruin wrote: >> @@ -4419,15 +4406,38 @@ int sequencer_add_exec_commands(const char >> *commands) >>   } >>  

Re: [PATCH 00/15] sequencer: refactor functions working on a todo_list

2018-10-07 Thread Alban Gruin
Le 07/10/2018 à 21:54, Alban Gruin a écrit : > At the center of the "interactive" part of the interactive rebase lies > the todo list. When the user starts an interactive rebase, a todo list > is generated, presented to the user (who then edits it using a text &

[PATCH 07/15] sequencer: make sequencer_make_script() write its script to a strbuf

2018-10-07 Thread Alban Gruin
This makes sequencer_make_script() write its script to a strbuf (ie. the buffer of a todo_list) instead of a FILE. This reduce the amount of read/write made by rebase interactive. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 13 +++- sequencer.c | 38

[PATCH 06/15] sequencer: refactor transform_todos() to work on a todo_list

2018-10-07 Thread Alban Gruin
by edit_todo_list() from rebase-interactive.c in a future commit. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 2 +- rebase-interactive.c | 4 +-- sequencer.c | 46 +++ sequencer.h | 3 ++- 4 files

[PATCH 15/15] rebase--interactive: move transform_todo_file() to rebase--interactive.c

2018-10-07 Thread Alban Gruin
As transform_todo_file() is only needed inside of rebase--interactive.c, it is moved there from sequencer.c. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 21 + sequencer.c | 21 - sequencer.h | 1 - 3

[PATCH 08/15] sequencer: change complete_action() to use the refactored functions

2018-10-07 Thread Alban Gruin
the "logic" functions to avoid useless file access. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 13 +- sequencer.c | 76 +-- sequencer.h | 2 +- 3 files changed, 38 insertions(+), 53 deletions(-)

[PATCH 03/15] sequencer: refactor check_todo_list() to work on a todo_list

2018-10-07 Thread Alban Gruin
the disk, parses it, pass the todo_list to todo_list_check(), and writes it back to the disk. As get_missing_commit_check_level() and the enum missing_commit_check_level are no longer needed inside of sequencer.c, they are moved to rebase-interactive.c, and made static again. Signed-off-by: Alban

[PATCH 09/15] sequencer: refactor skip_unnecessary_picks() to work on a todo_list

2018-10-07 Thread Alban Gruin
This refactors skip_unnecessary_picks() to work on a todo_list. The file-handling logic is completely dropped here, as its only usage is made by complete_action(). Signed-off-by: Alban Gruin --- sequencer.c | 56 +++-- 1 file changed, 16

[PATCH 02/15] sequencer: make the todo_list structure public

2018-10-07 Thread Alban Gruin
This makes the structures todo_list and todo_item, and the functions todo_list_release() and parse_insn_buffer(), accessible outside of sequencer.c. Signed-off-by: Alban Gruin --- sequencer.c | 66 + sequencer.h | 48

[PATCH 10/15] rebase-interactive: use todo_list_transform() in edit_todo_list()

2018-10-07 Thread Alban Gruin
Just like complete_action(), edit_todo_list() used a function (transform_todo_file()) that read the todo-list from the disk and wrote it back, resulting in useless disk accesses. This changes edit_todo_list() to call directly todo_list_transform() instead. Signed-off-by: Alban Gruin --- rebase

[PATCH 01/15] sequencer: clear the number of items of a todo_list before parsing

2018-10-07 Thread Alban Gruin
This clears the number of items of a todo_list before parsing it to allow to parse the same list multiple times without issues. As its items are not dynamically allocated, or don’t need to allocate memory, no additionnal memory management is required here. Signed-off-by: Alban Gruin

[PATCH 14/15] sequencer: fix a call to error() in transform_todo_file()

2018-10-07 Thread Alban Gruin
This replaces a call to error() by a call to error_errno() after writing the content of the todo list to the disk in transform_todo_file(). Signed-off-by: Alban Gruin --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer.c b/sequencer.c index 93b9b40f66

[PATCH 00/15] sequencer: refactor functions working on a todo_list

2018-10-07 Thread Alban Gruin
s refactor the functions that processes the todo list to work on a todo_list structure instead of reading it from the disk. Some commits consists in modifying edit_todo_list() (initially used by --edit-todo) to handle the initial edition of the todo list, to increase code sharing. Alban Gruin (15): sequen

[PATCH 11/15] rebase-interactive: append_todo_help() changes

2018-10-07 Thread Alban Gruin
s. Signed-off-by: Alban Gruin --- rebase-interactive.c | 14 -- rebase-interactive.h | 3 ++- sequencer.c | 8 ++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/rebase-interactive.c b/rebase-interactive.c index f42d48e192..7168d56d17 100644 --

[PATCH 04/15] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list

2018-10-07 Thread Alban Gruin
it at the end. Signed-off-by: Alban Gruin --- sequencer.c | 56 +++-- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/sequencer.c b/sequencer.c index 8dda61927c..6d998f21a4 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4370,34 +4370,21

[PATCH 05/15] sequencer: refactor rearrange_squash() to work on a todo_list

2018-10-07 Thread Alban Gruin
This refactors rearrange_squash() to work on a todo_list to avoid redundant reads and writes. The function is renamed todo_list_rearrange_squash(). As rebase -p still need to check the todo list from the disk, a new function is introduced, rearrange_squash_in_todo_file(). Signed-off-by: Alban

[PATCH 13/15] sequencer: use edit_todo_list() in complete_action()

2018-10-07 Thread Alban Gruin
This changes complete_action() to use edit_todo_list(), now that it can handle the initial edit of the todo list. Signed-off-by: Alban Gruin --- sequencer.c | 27 +++ 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/sequencer.c b/sequencer.c index

[PATCH 12/15] rebase-interactive: rewrite edit_todo_list() to handle the initial edit

2018-10-07 Thread Alban Gruin
edit_todo_list() is changed to work on a todo_list, and to handle the initial edition of the todo list (ie. making a backup of the todo list). It does not check for dropped commits yet, as todo_list_check() does not work if the old todo list has invalid commands. Signed-off-by: Alban Gruin

[GSoC][PATCH v8 10/20] t3404: todo list with commented-out commands only aborts

2018-09-27 Thread Alban Gruin
Signed-off-by: Alban Gruin --- No changes since v7. t/t3404-rebase-interactive.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index ff89b6341a..a7fc3cd5be 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3

[GSoC][PATCH v8 18/20] rebase--interactive2: rewrite the submodes of interactive rebase in C

2018-09-27 Thread Alban Gruin
This rewrites the submodes of interactive rebase (`--continue`, `--skip`, `--edit-todo`, and `--show-current-patch`) in C. git-rebase.sh is then modified to call directly git-rebase--interactive2 instead of git-rebase--interactive.sh. Signed-off-by: Alban Gruin --- No changes since v7

[GSoC][PATCH v8 11/20] rebase -i: rewrite complete_action() in C

2018-09-27 Thread Alban Gruin
seem useless as we write "noop" to the todo list if it is empty. Actually, the todo list might contain commented commands (ie. empty commits). In this case, complete_action() won’t write "noop", and will abort without starting the editor. Signed-off-by: Alban Gruin --- The chang

[GSoC][PATCH v8 09/20] sequencer: change the way skip_unnecessary_picks() returns its result

2018-09-27 Thread Alban Gruin
Instead of skip_unnecessary_picks() printing its result to stdout, it returns it into a struct object_id, as the rewrite of complete_action() (to come in the next commit) will need it. rebase--helper then is modified to fit this change. Signed-off-by: Alban Gruin --- The changes are due

[GSoC][PATCH v8 13/20] rebase -i: implement the logic to initialize $revisions in C

2018-09-27 Thread Alban Gruin
is changed accordingly. Signed-off-by: Alban Gruin --- No changes since v7. builtin/rebase--helper.c | 56 -- git-rebase--interactive.sh | 4 ++- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/builtin/rebase--helper.c b/builtin/rebase--helper.c

[GSoC][PATCH v8 14/20] rebase -i: rewrite the rest of init_revisions_and_shortrevisions() in C

2018-09-27 Thread Alban Gruin
commit and `head` is not really meaningful, `onto` is not used to initialize `shortrevisions` in this case. The corresponding arguments passed to `--complete-action` are then dropped, and init_revisions_and_shortrevisions() is stripped from git-rebase--interactive.sh Signed-off-by: Alban Gruin

[GSoC][PATCH v8 15/20] rebase -i: rewrite write_basic_state() in C

2018-09-27 Thread Alban Gruin
the stategy options is moved to a new function to allow its use in rebase--helper.c. Finally, the call to write_basic_state() is removed from git-rebase--interactive.sh, replaced by a call to `--init-basic-state`. Signed-off-by: Alban Gruin --- No changes since v7. builtin/rebase--helper.c | 28

[GSoC][PATCH v8 17/20] rebase -i: implement the main part of interactive rebase as a builtin

2018-09-27 Thread Alban Gruin
is modified to call git-rebase--interactive2 instead of git-rebase--helper. Signed-off-by: Alban Gruin --- .gitignore | 1 + Makefile | 1 + builtin.h | 1 + builtin/rebase--interactive2.c | 207 + git

[GSoC][PATCH v8 16/20] rebase -i: rewrite init_basic_state() in C

2018-09-27 Thread Alban Gruin
This rewrites init_basic_state() from shell to C. The call to write_basic_state() in cmd_rebase__helper() is replaced by a call to the new function. The shell version is then stripped from git-rebase--interactive.sh. Signed-off-by: Alban Gruin --- No changes since v7. builtin/rebase

[GSoC][PATCH v8 20/20] rebase -i: move rebase--helper modes to rebase--interactive

2018-09-27 Thread Alban Gruin
as it is useless now. Signed-off-by: Alban Gruin --- The changes are due to the rebase, no real changes otherwise. .gitignore | 1 - Makefile | 1 - builtin.h | 1 - builtin/rebase--helper.c | 226

[GSoC][PATCH v8 19/20] rebase -i: remove git-rebase--interactive.sh

2018-09-27 Thread Alban Gruin
This removes git-rebase--interactive.sh, as its functionnality has been replaced by git-rebase--interactive2. git-rebase--interactive2.c is then renamed to git-rebase--interactive.c. Signed-off-by: Alban Gruin --- The changes are due to the rebase, no real changes otherwise. .gitignore

[GSoC][PATCH v8 12/20] rebase -i: remove unused modes and functions

2018-09-27 Thread Alban Gruin
. skip_unnecessary_picks() and checkout_onto() becomes static, as they are only used inside of the sequencer. Signed-off-by: Alban Gruin --- No changes since v7. builtin/rebase--helper.c | 23 ++ git-rebase--interactive.sh | 50 -- rebase-interactive.c

[GSoC][PATCH v8 07/20] rebase -i: rewrite checkout_onto() in C

2018-09-27 Thread Alban Gruin
This rewrites checkout_onto() from shell to C. A new command (“checkout-onto”) is added to rebase--helper.c. The shell version is then stripped. Signed-off-by: Alban Gruin --- No changes since v7. builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 25

[GSoC][PATCH v8 04/20] rebase -i: rewrite the edit-todo functionality in C

2018-09-27 Thread Alban Gruin
in favour of a call to the helper. Signed-off-by: Alban Gruin --- No changes since v7. builtin/rebase--helper.c | 13 - git-rebase--interactive.sh | 11 +-- rebase-interactive.c | 27 +++ rebase-interactive.h | 1 + 4 files changed, 37

[GSoC][PATCH v8 06/20] rebase -i: rewrite setup_reflog_action() in C

2018-09-27 Thread Alban Gruin
(), a call to comment_for_reflog() is added at the beginning of this function. Signed-off-by: Alban Gruin --- No changes since v7. builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 16 ++-- sequencer.c| 30 ++ sequencer.h

[GSoC][PATCH v8 02/20] rebase -i: rewrite append_todo_help() in C

2018-09-27 Thread Alban Gruin
, append_todo_help() is removed from git-rebase--interactive.sh to use `rebase--helper --append-todo-help` instead. Signed-off-by: Alban Gruin --- The changes are due to the rebase, no real changes otherwise. Makefile | 1 + builtin/rebase--helper.c | 11 -- git-rebase

[GSoC][PATCH v8 08/20] sequencer: refactor append_todo_help() to write its message to a buffer

2018-09-27 Thread Alban Gruin
function, append_todo_help_to_file(). This function will go away after the rewrite of complete_action(). Signed-off-by: Alban Gruin --- No changes since v7. builtin/rebase--helper.c | 2 +- rebase-interactive.c | 43 rebase-interactive.h | 4

[GSoC][PATCH v8 03/20] editor: add a function to launch the sequence editor

2018-09-27 Thread Alban Gruin
as a parameter, in addition to the path, the buffer and the environment variables. launch_sequence_editor() is then added to launch the sequence editor. Signed-off-by: Alban Gruin --- No changes since v7. cache.h | 1 + editor.c | 27 +-- strbuf.h | 2 ++ 3 files changed, 28

[GSoC][PATCH v8 05/20] sequencer: add a new function to silence a command, except if it fails

2018-09-27 Thread Alban Gruin
to use of run_command_silent_on_success(). Signed-off-by: Alban Gruin --- The changes are due to the rebase, no real changes otherwise. sequencer.c | 51 +-- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/sequencer.c b/sequencer.c

[GSoC][PATCH v8 00/20] rebase -i: rewrite in C

2018-09-27 Thread Alban Gruin
20] Conflict solving. Alban Gruin (20): sequencer: make three functions and an enum from sequencer.c public rebase -i: rewrite append_todo_help() in C editor: add a function to launch the sequence editor rebase -i: rewrite the edit-todo functionality in C sequencer: add a new function

[GSoC][PATCH v8 01/20] sequencer: make three functions and an enum from sequencer.c public

2018-09-27 Thread Alban Gruin
will eventually be moved to rebase-interactive.c and become static again, so no special attention was given to the naming. This will be needed for the rewrite of append_todo_help() from shell to C, as it will be in a new library source file, rebase-interactive.c. Signed-off-by: Alban Gruin

[GSoC][PATCH v7 10/20] t3404: todo list with commented-out commands only aborts

2018-08-28 Thread Alban Gruin
Signed-off-by: Alban Gruin --- No changes since v6. t/t3404-rebase-interactive.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 01616901bd..496d88d7d6 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3

[GSoC][PATCH v7 03/20] editor: add a function to launch the sequence editor

2018-08-28 Thread Alban Gruin
as a parameter, in addition to the path, the buffer and the environment variables. launch_sequence_editor() is then added to launch the sequence editor. Signed-off-by: Alban Gruin --- No changes since v6. cache.h | 1 + editor.c | 27 +-- strbuf.h | 2 ++ 3 files changed, 28

[GSoC][PATCH v7 04/20] rebase -i: rewrite the edit-todo functionality in C

2018-08-28 Thread Alban Gruin
in favour of a call to the helper. Signed-off-by: Alban Gruin --- No changes since v6. builtin/rebase--helper.c | 13 - git-rebase--interactive.sh | 11 +-- rebase-interactive.c | 27 +++ rebase-interactive.h | 1 + 4 files changed, 37

[GSoC][PATCH v7 20/20] rebase -i: move rebase--helper modes to rebase--interactive

2018-08-28 Thread Alban Gruin
as it is useless now. Signed-off-by: Alban Gruin --- No changes since v6. .gitignore | 1 - Makefile | 1 - builtin.h | 1 - builtin/rebase--helper.c | 226 - builtin/rebase--interactive.c

[GSoC][PATCH v7 08/20] sequencer: refactor append_todo_help() to write its message to a buffer

2018-08-28 Thread Alban Gruin
function, append_todo_help_to_file(). This function will go away after the rewrite of complete_action(). Signed-off-by: Alban Gruin --- No changes since v6. builtin/rebase--helper.c | 2 +- rebase-interactive.c | 43 rebase-interactive.h | 4

[GSoC][PATCH v7 11/20] rebase -i: rewrite complete_action() in C

2018-08-28 Thread Alban Gruin
seem useless as we write "noop" to the todo list if it is empty. Actually, the todo list might contain commented commands (ie. empty commits). In this case, complete_action() won’t write "noop", and will abort without starting the editor. Signed-off-by: Alban Gruin --- bu

[GSoC][PATCH v7 15/20] rebase -i: rewrite write_basic_state() in C

2018-08-28 Thread Alban Gruin
the stategy options is moved to a new function to allow its use in rebase--helper.c. Finally, the call to write_basic_state() is removed from git-rebase--interactive.sh, replaced by a call to `--init-basic-state`. Signed-off-by: Alban Gruin --- No changes since v6. builtin/rebase--helper.c | 28

[GSoC][PATCH v7 12/20] rebase -i: remove unused modes and functions

2018-08-28 Thread Alban Gruin
. skip_unnecessary_picks() and checkout_onto() becomes static, as they are only used inside of the sequencer. Signed-off-by: Alban Gruin --- No changes since v6. builtin/rebase--helper.c | 23 ++ git-rebase--interactive.sh | 50 -- rebase-interactive.c

[GSoC][PATCH v7 18/20] rebase--interactive2: rewrite the submodes of interactive rebase in C

2018-08-28 Thread Alban Gruin
This rewrites the submodes of interactive rebase (`--continue`, `--skip`, `--edit-todo`, and `--show-current-patch`) in C. git-rebase.sh is then modified to call directly git-rebase--interactive2 instead of git-rebase--interactive.sh. Signed-off-by: Alban Gruin --- builtin/rebase--interactive2

[GSoC][PATCH v7 16/20] rebase -i: rewrite init_basic_state() in C

2018-08-28 Thread Alban Gruin
This rewrites init_basic_state() from shell to C. The call to write_basic_state() in cmd_rebase__helper() is replaced by a call to the new function. The shell version is then stripped from git-rebase--interactive.sh. Signed-off-by: Alban Gruin --- No changes since v6. builtin/rebase

[GSoC][PATCH v7 13/20] rebase -i: implement the logic to initialize $revisions in C

2018-08-28 Thread Alban Gruin
is changed accordingly. Signed-off-by: Alban Gruin --- No changes since v6. builtin/rebase--helper.c | 56 -- git-rebase--interactive.sh | 4 ++- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/builtin/rebase--helper.c b/builtin/rebase--helper.c

[GSoC][PATCH v7 17/20] rebase -i: implement the main part of interactive rebase as a builtin

2018-08-28 Thread Alban Gruin
is modified to call git-rebase--interactive2 instead of git-rebase--helper. Signed-off-by: Alban Gruin --- .gitignore | 1 + Makefile | 1 + builtin.h | 1 + builtin/rebase--interactive2.c | 206 + git

[GSoC][PATCH v7 19/20] rebase -i: remove git-rebase--interactive.sh

2018-08-28 Thread Alban Gruin
This removes git-rebase--interactive.sh, as its functionnality has been replaced by git-rebase--interactive2. git-rebase--interactive2.c is then renamed to git-rebase--interactive.c. Signed-off-by: Alban Gruin --- No changes since v6. .gitignore| 1

[GSoC][PATCH v7 14/20] rebase -i: rewrite the rest of init_revisions_and_shortrevisions() in C

2018-08-28 Thread Alban Gruin
commit and `head` is not really meaningful, `onto` is not used to initialize `shortrevisions` in this case. The corresponding arguments passed to `--complete-action` are then dropped, and init_revisions_and_shortrevisions() is stripped from git-rebase--interactive.sh Signed-off-by: Alban Gruin

[GSoC][PATCH v7 09/20] sequencer: change the way skip_unnecessary_picks() returns its result

2018-08-28 Thread Alban Gruin
Instead of skip_unnecessary_picks() printing its result to stdout, it returns it into a struct object_id, as the rewrite of complete_action() (to come in the next commit) will need it. rebase--helper then is modified to fit this change. Signed-off-by: Alban Gruin --- No changes since v6

[GSoC][PATCH v7 07/20] rebase -i: rewrite checkout_onto() in C

2018-08-28 Thread Alban Gruin
This rewrites checkout_onto() from shell to C. A new command (“checkout-onto”) is added to rebase--helper.c. The shell version is then stripped. Signed-off-by: Alban Gruin --- No changes since v6. builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 25

  1   2   3   4   >