[GSoC][PATCH v3 0/3] rebase -i: rewrite reflog operations in C

2018-06-21 Thread Alban Gruin
/rebase-i-rewrite-todo, and does not conflict with pu (as of 2018-06-21). Changes since v2: - Removing the “verbose” parameter to run_command_silent_on_success() - Rewording some parts of the second commit - Changing the help for the “--verbose” flag Alban Gruin (3): sequencer: add a new

[GSoC][PATCH v3 1/3] sequencer: add a new function to silence a command, except if it fails.

2018-06-21 Thread Alban Gruin
use of run_command_silent_on_success(). Signed-off-by: Alban Gruin --- sequencer.c | 49 - 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/sequencer.c b/sequencer.c index 7cc76332e..51c8ab7ac 100644 --- a/sequencer.c +++ b

[GSoC][PATCH v3 2/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-21 Thread Alban Gruin
comment_for_reflog() is added at the beginning of this function. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 9 +++-- git-rebase--interactive.sh | 16 ++-- sequencer.c| 30 ++ sequencer.h| 3 +++ 4 files

[GSoC][PATCH v3 3/3] rebase -i: rewrite checkout_onto() in C

2018-06-21 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 --- builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 25 - sequencer.c

Re: [GSoC][PATCH v3 1/3] sequencer: add a new function to silence a command, except if it fails.

2018-06-22 Thread Alban Gruin
Hi Junio, Le 22/06/2018 à 00:03, Junio C Hamano a écrit : > Alban Gruin writes: > > This adds a new function, run_command_silent_on_success(), to > > redirect the stdout and stderr of a command to a strbuf, and then to run > > that command. This strbuf is printed only if the

Re: [GSoC][PATCH v3 2/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-22 Thread Alban Gruin
Hi Junio, Le 22/06/2018 à 18:27, Junio C Hamano a écrit : > Alban Gruin writes: > > This rewrites (the misnamed) setup_reflog_action() from shell to C. The > > new version is called checkout_base_commit(). > > ;-) on the "misnamed" part. Indeed, setting up the co

[GSoC][PATCH v4 2/3] rebase -i: rewrite checkout_onto() in C

2018-06-25 Thread Alban Gruin
`run_git_checkout()` will also be used in the next commit, therefore its code is not part of `detach_onto()`. The shell version is then stripped in favour of a call to the helper. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 9 +++-- git-rebase--interactive.sh | 13

[GSoC][PATCH v4 1/3] sequencer: extract a function to silence a command, except if it fails

2018-06-25 Thread Alban Gruin
checkout_onto(). Signed-off-by: Alban Gruin --- sequencer.c | 51 +-- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/sequencer.c b/sequencer.c index 7cc76332e..9a9725e23 100644 --- a/sequencer.c +++ b/sequencer.c @@ -766,6 +766,23

[GSoC][PATCH v4 0/3] rebase -i: rewrite reflog operations in C

2018-06-25 Thread Alban Gruin
() - Renaming checkout_base_commit() (rewrite of setup_reflog_action()) to checkout_onto() - Using the `else` keyword to call run_command_silent_on_success() or run_command() in run_git_commit() and run_git_checkout(). Alban Gruin (3): sequencer: extract a function to silence a command, except if

[GSoC][PATCH v4 3/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-25 Thread Alban Gruin
comment_for_reflog() is added at the beginning of this function. If the commit OID provided to checkout_onto() is empty, nothing happens and no errors are returned, otherwise it would break some tests (t3404.92 and t3404.93). Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 6

Re: [GSoC][PATCH v3 2/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-25 Thread Alban Gruin
Hi Junio, Le 25/06/2018 à 17:34, Junio C Hamano a écrit : > Alban Gruin writes: > >> Hi Junio, >> >> Le 22/06/2018 à 18:27, Junio C Hamano a écrit : >>> Alban Gruin writes: >>>> This rewrites (the misnamed) setup_reflog_action() fr

[GSoC] GSoC with git, week 8

2018-06-25 Thread Alban Gruin
Hi, I published my blog post about last week: https://blog.pa1ch.fr/posts/2018/06/25/en/gsoc2018-week-8.html Cheers, Alban

[GSoC][PATCH 0/1] sequencer: print an error message if append_todo_help() fails

2018-06-26 Thread Alban Gruin
Currently, append_todo_help() does not warn the user if an error occurs when trying to write to the todo file. This patch addresses this problem. This patch is based on ag/rebase-i-append-todo-help. Alban Gruin (1): sequencer: print an error message if append_todo_help() fails sequencer.c

[GSoC][PATCH 1/1] sequencer: print an error message if append_todo_help() fails

2018-06-26 Thread Alban Gruin
This adds an error when append_todo_help() fails to write its message to the todo file. Signed-off-by: Alban Gruin --- sequencer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sequencer.c b/sequencer.c index 7cc76332e..7c4bdbb99 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4380,6

[GSoC][PATCH v4 0/2] rebase -i: rewrite append_todo_help() in C

2018-06-26 Thread Alban Gruin
in C. This is based on next, as of 2018-06-26. Changes since v3: - Show an error message when append_todo_help() fails to edit the todo list. - Introducing rebase-interactive.c to contain functions necessary for interactive rebase. Alban Gruin (2): sequencer: make two functions and

[GSoC][PATCH v4 2/2] rebase--interactive: rewrite append_todo_help() in C

2018-06-26 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 --- Makefile | 1 + builtin/rebase--helper.c | 11 -- git-rebase--interactive.sh | 52 ++--- rebase-interactive.c

[GSoC][PATCH v4 1/2] sequencer: make two functions and an enum from sequencer.c public

2018-06-26 Thread Alban Gruin
This makes rebase_path_todo(), get_missign_commit_check_level() and the enum check_level accessible outside sequencer.c. 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 v3 2/2] rebase-interactive: rewrite the edit-todo functionality in C

2018-06-26 Thread Alban Gruin
favour of a call to the helper. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 13 - git-rebase--interactive.sh | 11 +-- rebase-interactive.c | 31 +++ rebase-interactive.h | 1 + 4 files changed, 41 insertions(+), 15

[GSoC][PATCH v3 0/2] rebase -i: rewrite the edit-todo functionality in C

2018-06-26 Thread Alban Gruin
-rebase.c. Alban Gruin (2): editor: add a function to launch the sequence editor rebase-interactive: rewrite the edit-todo functionality in C builtin/rebase--helper.c | 13 - cache.h| 1 + editor.c | 27 +-- git-rebase

[GSoC][PATCH v3 1/2] editor: add a function to launch the sequence editor

2018-06-26 Thread Alban Gruin
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 --- cache.h | 1 + editor.c | 27 +-- strbuf.h | 2 ++ 3 files changed, 28 insertions(+), 2

Re: [GSoC][PATCH v4 1/2] sequencer: make two functions and an enum from sequencer.c public

2018-06-27 Thread Alban Gruin
Hi Johannes, Le 26/06/2018 à 23:41, Johannes Schindelin a écrit : > Hi Alban, > > On Tue, 26 Jun 2018, Alban Gruin wrote: > >> diff --git a/sequencer.h b/sequencer.h >> index c5787c6b5..08397b0d1 100644 >> --- a/sequencer.h >> +++ b/sequencer.h &g

Re: [GSoC][PATCH v4 0/2] rebase -i: rewrite append_todo_help() in C

2018-06-27 Thread Alban Gruin
Hi Johannes, Le 26/06/2018 à 23:37, Johannes Schindelin a écrit : > Hi Alban, > > On Tue, 26 Jun 2018, Alban Gruin wrote: > >> This patch rewrites append_todo_help() from shell to C. The C version >> covers a bit more than the old shell version. To achieve that, some >

[GSoC][PATCH v5 0/2] rebase -i: rewrite append_todo_help() in C

2018-06-28 Thread Alban Gruin
in C. This is based on next, as of 2018-06-28. Changes since v4: - Renaming enumeration check_level and its values to avoid namespace pollution. Alban Gruin (2): sequencer: make two functions and an enum from sequencer.c public rebase--interactive: rewrite append_todo_help() in C

[GSoC][PATCH v5 1/2] sequencer: make two functions and an enum from sequencer.c public

2018-06-28 Thread Alban Gruin
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 --- sequencer.c | 22 +- sequencer.h | 8 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/sequencer.c b/sequencer.c index

[GSoC][PATCH v5 2/2] rebase--interactive: rewrite append_todo_help() in C

2018-06-28 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 --- Makefile | 1 + builtin/rebase--helper.c | 11 -- git-rebase--interactive.sh | 52 ++--- rebase-interactive.c

ag/rebase-i-append-todo-help, was Re: What's cooking in git.git (Jun 2018, #07; Thu, 28)

2018-06-29 Thread Alban Gruin
Hi Junio, Le 28/06/2018 à 23:40, Junio C Hamano a écrit : > * ag/rebase-i-append-todo-help (2018-06-14) 2 commits > - rebase--interactive: rewrite append_todo_help() in C > - Merge branch 'ag/rebase-p' into ag/rebase-i-append-todo-help > (this branch is used by ag/rebase-i-rewrite-todo.) > >

[GSoC][PATCH v5 2/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-29 Thread Alban Gruin
call to comment_for_reflog() is added at the beginning of this function. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 9 +++-- git-rebase--interactive.sh | 16 ++-- sequencer.c| 31 +++ sequencer.h| 3

[GSoC][PATCH v5 0/3] rebase -i: rewrite reflog operations in C

2018-06-29 Thread Alban Gruin
(), and not to checkout_onto(). Alban Gruin (3): sequencer: add a new function to silence a command, except if it fails. rebase -i: rewrite setup_reflog_action() in C rebase -i: rewrite checkout_onto() in C builtin/rebase--helper.c | 14 - git-rebase--interactive.sh | 39

[GSoC][PATCH v5 3/3] rebase -i: rewrite checkout_onto() in C

2018-06-29 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 --- builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 25 - sequencer.c

[GSoC][PATCH v5 1/3] sequencer: add a new function to silence a command, except if it fails.

2018-06-29 Thread Alban Gruin
use of run_command_silent_on_success(). Signed-off-by: Alban Gruin --- sequencer.c | 51 +-- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/sequencer.c b/sequencer.c index cb7ec9807..d9545b366 100644 --- a/sequencer.c +++ b

Re: [GSoC][PATCH v5 0/3] rebase -i: rewrite reflog operations in C

2018-07-02 Thread Alban Gruin
Hi Junio, Le 29/06/2018 à 20:23, Junio C Hamano a écrit : > Junio C Hamano writes: > >> Let's aggregate these topics into a single topic, and perhaps call >> it ag/rebase-i-in-c or something like that. Pretending as if they >> are separately replaceable does not make much sense, as you are not

[GSoC][PATCH v2 0/7] rebase -i: rewrite some parts in C

2018-07-02 Thread Alban Gruin
when append_todo_help() fails to edit the todo list. - Renaming enumeration check_level and its values to avoid namespace pollution. - Moving append_todo_help() and edit_todo() from sequencer.c to interactive-rebase.c. Alban Gruin (7): sequencer: make two functions and an enum from

[GSoC][PATCH v2 2/7] rebase--interactive: rewrite append_todo_help() in C

2018-07-02 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 --- Makefile | 1 + builtin/rebase--helper.c | 11 -- git-rebase--interactive.sh | 52 ++--- rebase-interactive.c

[GSoC][PATCH v2 1/7] sequencer: make two functions and an enum from sequencer.c public

2018-07-02 Thread Alban Gruin
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 --- sequencer.c | 22 +- sequencer.h | 8 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/sequencer.c b/sequencer.c index

[GSoC][PATCH v2 4/7] rebase-interactive: rewrite the edit-todo functionality in C

2018-07-02 Thread Alban Gruin
favour of a call to the helper. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 13 - git-rebase--interactive.sh | 11 +-- rebase-interactive.c | 31 +++ rebase-interactive.h | 1 + 4 files changed, 41 insertions(+), 15

[GSoC][PATCH v2 3/7] editor: add a function to launch the sequence editor

2018-07-02 Thread Alban Gruin
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 --- cache.h | 1 + editor.c | 27 +-- strbuf.h | 2 ++ 3 files changed, 28 insertions(+), 2

[GSoC][PATCH v2 5/7] sequencer: add a new function to silence a command, except if it fails.

2018-07-02 Thread Alban Gruin
use of run_command_silent_on_success(). Signed-off-by: Alban Gruin --- sequencer.c | 49 - 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/sequencer.c b/sequencer.c index 57fd58bc1..9e2b34a49 100644 --- a/sequencer.c +++ b

[GSoC][PATCH v2 7/7] rebase -i: rewrite checkout_onto() in C

2018-07-02 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 --- builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 25 - sequencer.c

[GSoC][PATCH v2 6/7] rebase -i: rewrite setup_reflog_action() in C

2018-07-02 Thread Alban Gruin
call to comment_for_reflog() is added at the beginning of this function. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 9 +++-- git-rebase--interactive.sh | 16 ++-- sequencer.c| 30 ++ sequencer.h| 3 +++ 4

[GSoC] GSoC with git, week 9

2018-07-02 Thread Alban Gruin
Hi, I just published a blog post about last week: https://blog.pa1ch.fr/posts/2018/07/02/en/gsoc2018-week-9.html Cheers, Alban

Re: [GSoC][PATCH v2 1/7] sequencer: make two functions and an enum from sequencer.c public

2018-07-05 Thread Alban Gruin
Hi Junio, Le 03/07/2018 à 22:20, Junio C Hamano a écrit : > Alban Gruin writes: > >> -enum check_level { >> -CHECK_IGNORE = 0, CHECK_WARN, CHECK_ERROR >> -}; >> - >> -static enum check_level get_missing_commit_check_level(void)

[GSoC][PATCH v3 03/13] editor: add a function to launch the sequence editor

2018-07-10 Thread Alban Gruin
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 --- cache.h | 1 + editor.c | 27 +-- strbuf.h | 2 ++ 3 files changed, 28 insertions(+), 2

[GSoC][PATCH v3 12/13] rebase -i: implement the logic to initialize the variable $revision in C

2018-07-10 Thread Alban Gruin
$squash_onto to the state directory, it’s done by the handler of `--make-script` instead. Finally, this drops the $revision argument passed to `--make-script` in git-rebase--interactive.sh, and rebase--helper is changed accordingly. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 56

[GSoC][PATCH v3 02/13] rebase--interactive: rewrite append_todo_help() in C

2018-07-10 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 --- Unchanged from what have been queued on `pu` (ag/rebase-i-in-c), and from v2. Makefile | 1 + builtin/rebase--helper.c | 11 -- git

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

2018-07-10 Thread Alban Gruin
Instead of skip_unnecessary_picks() printing its result to stdout, it returns it into a const char *, 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 --- builtin/rebase--helper.c | 11

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

2018-07-10 Thread Alban Gruin
use of run_command_silent_on_success(). Signed-off-by: Alban Gruin --- sequencer.c | 51 +-- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/sequencer.c b/sequencer.c index 57fd58bc1..1b5d50298 100644 --- a/sequencer.c +++ b

[GSoC][PATCH v3 01/13] sequencer: make two functions and an enum from sequencer.c public

2018-07-10 Thread Alban Gruin
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 --- Unchanged from

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

2018-07-10 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 --- builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 25 - sequencer.c

[GSoC][PATCH v3 13/13] rebase -i: rewrite the rest of init_revisions_and_shortrevisions in C

2018-07-10 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 v3 00/13] rebase -i: rewrite some parts in C

2018-07-10 Thread Alban Gruin
(). - Dropping the `verbose` parameter in run_git_checkout(), prepare_branch_to_be_rebased(), and checkout_onto(), as the replay_opts structure already has a `verbose` field. - Rewriting complete_action() and init_revisions_and_shortrevisions(). Alban Gruin (13): sequencer: make two functions and an

[GSoC][PATCH v3 11/13] rebase--interactive: remove unused modes and functions

2018-07-10 Thread Alban Gruin
rebase-interactive.c. skip_unnecessary_picks() and checkout_onto() becomes static, as they are only used inside of the sequencer. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 32 +++- git-rebase--interactive.sh | 50 -- rebase

[GSoC][PATCH v3 10/13] rebase--interactive: rewrite complete_action() in C

2018-07-10 Thread Alban Gruin
describing this behaviour in git-rebase.sh is updated to reflect this change. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 13 +- git-rebase--interactive.sh | 53 ++- git-rebase.sh | 2 +- sequencer.c

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

2018-07-10 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 --- builtin/rebase--helper.c | 2 +- rebase-interactive.c | 45 rebase-interactive.h | 7 ++- 3 files changed

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

2018-07-10 Thread Alban Gruin
call to comment_for_reflog() is added at the beginning of this function. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 10 -- git-rebase--interactive.sh | 16 ++-- sequencer.c| 30 ++ sequencer.h| 2 ++ 4

[GSoC][PATCH v3 04/13] rebase-interactive: rewrite the edit-todo functionality in C

2018-07-10 Thread Alban Gruin
favour of a call to the helper. Signed-off-by: Alban Gruin --- Unchanged from v2. builtin/rebase--helper.c | 13 - git-rebase--interactive.sh | 11 +-- rebase-interactive.c | 31 +++ rebase-interactive.h | 1 + 4 files changed, 41

Re: [GSoC][PATCH v3 02/13] rebase--interactive: rewrite append_todo_help() in C

2018-07-10 Thread Alban Gruin
Le 10/07/2018 à 14:15, Alban Gruin a écrit : > This rewrites append_todo_help() from shell to C. It also incorporates > some parts of initiate_action() and complete_action() that also write > help texts to the todo file. > > This also introduces the source file rebase-interacti

Re: [GSoC][PATCH v3 03/13] editor: add a function to launch the sequence editor

2018-07-10 Thread Alban Gruin
Le 10/07/2018 à 14:15, Alban Gruin a écrit : > As part of the rewrite of interactive rebase, the sequencer will need to > open the sequence editor to allow the user to edit the todo list. > Instead of duplicating the existing launch_editor() function, this > refactors it to a

[GSoC] GSoC with git, week 10

2018-07-10 Thread Alban Gruin
Hi, I published a new blog post: https://blog.pa1ch.fr/posts/2018/07/10/en/gsoc2018-week-10.html Cheers, Alban

Re: [GSoC][PATCH v3 10/13] rebase--interactive: rewrite complete_action() in C

2018-07-11 Thread Alban Gruin
Hi Junio, Le 11/07/2018 à 00:33, Junio C Hamano a écrit : > Alban Gruin writes: >> -complete_action >> +exec git rebase--helper --complete-action "$shortrevisions" >> "$onto_name" \ >> +"$shortonto" "$orig_he

[GSoC] GSoC with git, week 11

2018-07-17 Thread Alban Gruin
Hi, I published a new blog post about last week: https://blog.pa1ch.fr/posts/2018/07/17/en/gsoc2018-week11.html Cheers, Alban

Re: [PATCH v6 14/16] rebase-interactive: rewrite edit_todo_list() to handle the initial edit

2019-02-06 Thread Alban Gruin
Hi Phillip, I’ve just reread this message and have a couple of additionnal comments. Le 01/02/2019 à 12:03, Phillip Wood a écrit : > Hi Alban > > This looks good apart from some missing error handling. > > On 29/01/2019 15:01, Alban Gruin wrote: >> edit_todo_list() is

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

2019-02-10 Thread Alban Gruin
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 v6. sequencer.c | 7 ++- 1 file changed

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

2019-02-10 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 v6. sequencer.c | 69 ++--- sequencer.h | 50

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

2019-02-10 Thread Alban Gruin
id' to `base_oid'. - [14/16] Better error handling in edit_todo_list() and edit_todo_file(). - [16/16] Move sequencer_add_exec_commands() and rearrange_squash_in_todo_file() to rebase--interactive.c. The tip of this series is tagged as "refactor-todo-list-v7" in https:/

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

2019-02-10 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 | 109 +- sequencer.h | 5 +- 3 files changed, 82

[PATCH v7 05/16] sequencer: introduce todo_list_write_to_file()

2019-02-10 Thread Alban Gruin
. Signed-off-by: Alban Gruin --- No changes since v6. sequencer.c | 61 +++-- sequencer.h | 11 ++ 2 files changed, 48 insertions(+), 24 deletions(-) diff --git a/sequencer.c b/sequencer.c index 346706029c..4809b22ce4 100644 --- a

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

2019-02-10 Thread Alban Gruin
-interactive.c, and made static again. Signed-off-by: Alban Gruin --- No changes since v6. builtin/rebase--interactive.c | 2 +- rebase-interactive.c | 91 - rebase-interactive.h | 2 + sequencer.c | 121

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

2019-02-10 Thread Alban Gruin
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 v6. builtin/rebase--interactive.c | 2 +- rebase-interactive.c

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

2019-02-10 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 --- No changes since v6. builtin/rebase--interactive.c | 13 ++- sequencer.c

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

2019-02-10 Thread Alban Gruin
list, eliminating the need to reparse 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 | 82 + 1 file changed, 19

[PATCH v7 03/16] sequencer: remove the 'arg' field from todo_item

2019-02-10 Thread Alban Gruin
ing the todo list buffer. Signed-off-by: Alban Gruin --- No changes since v6. sequencer.c | 67 ++--- sequencer.h | 6 +++-- 2 files changed, 42 insertions(+), 31 deletions(-) diff --git a/sequencer.c b/sequencer.c index 25cc7a9a91..c844a9b7f3 10

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

2019-02-10 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 --- No changes since v6. builtin/rebase--interactive.c | 2 +- sequencer.c | 92 ++- sequencer.h

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

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

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

2019-02-10 Thread Alban Gruin
"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 the buffer. Signed-off-by: Alban Gruin ---

[PATCH v7 16/16] rebase--interactive: move several functions to rebase--interactive.c

2019-02-10 Thread Alban Gruin
rearrange_squash_in_todo_file() is slightly improved. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 81 +-- sequencer.c | 79 ++ sequencer.h | 7 ++- 3 files changed, 84 insertions(+), 83 deletions

[PATCH v7 12/16] rebase-interactive: use todo_list_write_to_file() in edit_todo_list()

2019-02-10 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 --- No

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

2019-02-10 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 --- No changes since v6. sequencer.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/sequencer.c b/sequencer.c

[PATCH v7 13/16] rebase-interactive: append_todo_help() changes

2019-02-10 Thread Alban Gruin
todo list, shortrevisions and shortonto are not NULL. Therefore, if shortrevisions or shortonto is NULL, then edit_todo would be true, otherwise it would be false. Thus, edit_todo is removed from the parameters of append_todo_help(). Signed-off-by: Alban Gruin --- No changes since v6. rebase-int

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

2019-02-12 Thread Alban Gruin
Hi Phillip, Le 12/02/2019 à 11:52, Phillip Wood a écrit : > Hi Alban > > I think this is almost there, I've got a couple of small comments below. > > On 10/02/2019 13:26, Alban Gruin wrote: >> -%<- >> diff --git a/builtin/rebase--interactive.c b/builtin/rebase

ag/sequencer-reduce-rewriting-todo, was Re: What's cooking in git.git (Feb 2019, #04; Sun, 24)

2019-02-25 Thread Alban Gruin
Hi Junio, Le 24/02/2019 à 19:18, Junio C Hamano a écrit : > * ag/sequencer-reduce-rewriting-todo (2019-01-29) 16 commits > - rebase--interactive: move transform_todo_file() to rebase--interactive.c > - sequencer: use edit_todo_list() in complete_action() > - rebase-interactive: rewrite edit_tod

[RFC PATCH 4/4] name-rev: avoid naming from a ref if it’s not a descendant of any commit

2019-03-01 Thread Alban Gruin
name_rev(), so we don’t name its parents. The code dealing with stdin after calling for_each_ref() is no longer needed as we already read it. name_rev_line() is renamed name_rev_buf() to reflect its new role better. Signed-off-by: Alban Gruin --- builtin/name-rev.c | 91

[RFC PATCH 1/4] name-rev: improve name_rev() memory usage

2019-03-01 Thread Alban Gruin
current commit and its first parent has not used the name, and that it can be released. However, if the current commit has been named but not its parent, or the reverse, the name will not be released. Signed-off-by: Alban Gruin --- builtin/name-rev.c | 23 ++- 1 file changed

[RFC PATCH 2/4] commit-list: add a function to check if a commit is in a list

2019-03-01 Thread Alban Gruin
To avoid naming some commits, name_rev() will need to check if a commit is part of a commit list. Signed-off-by: Alban Gruin --- commit.c | 12 commit.h | 1 + 2 files changed, 13 insertions(+) diff --git a/commit.c b/commit.c index a5333c7ac6..fcb3e9245f 100644 --- a/commit.c

[RFC PATCH 3/4] name-rev: check if a commit should be named before naming it

2019-03-01 Thread Alban Gruin
freed. If it is not, the commit is left unnamed. In this case, the name can still be used by the first descendant of this commit (or one of its descendants). Signed-off-by: Alban Gruin --- builtin/name-rev.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a

[RFC PATCH 0/4] name-rev: improve memory usage

2019-03-01 Thread Alban Gruin
fc-v1" in https://github.com/agrn/git. Alban Gruin (4): name-rev: improve name_rev() memory usage commit-list: add a function to check if a commit is in a list name-rev: check if a commit should be named before naming it name-rev: avoid naming from a ref if it’s not a descendant of any c

Re: [RFC PATCH 3/4] name-rev: check if a commit should be named before naming it

2019-03-01 Thread Alban Gruin
Hi Eric, Le 01/03/2019 à 19:05, Eric Sunshine a écrit : > On Fri, Mar 1, 2019 at 12:50 PM Alban Gruin wrote: > -%<- > Minor: It would probably be more efficient to check if the count is 0 > first, and only search the list if not. > > By the way, how big is 'commit

Re: [RFC PATCH 0/4] name-rev: improve memory usage

2019-03-01 Thread Alban Gruin
Hi Jeff, Le 01/03/2019 à 19:42, Jeff King a écrit : > On Fri, Mar 01, 2019 at 06:50:20PM +0100, Alban Gruin wrote: > >> rafasc reported on IRC that on a repository with a lot of branches, >> tags, remotes, and commits, name-rev --stdin could use a massive amount >> of

Re: [RFC PATCH 4/4] name-rev: avoid naming from a ref if it’s not a descendant of any commit

2019-03-03 Thread Alban Gruin
Hi Christian, Le 03/03/2019 à 20:33, Christian Couder a écrit : > On Fri, Mar 1, 2019 at 7:11 PM Alban Gruin wrote: >> >> A ref may not be the descendant of all of the commits mentionned in >> stdin. In this case, we want to avoid naming its parents. > > Properly

[PATCH v8 04/18] sequencer: refactor transform_todos() to work on a todo_list

2019-03-05 Thread Alban Gruin
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 v7. builtin/rebase--interactive.c | 2 +- rebase-interactive.c

[PATCH v8 01/18] sequencer: changes in parse_insn_buffer()

2019-03-05 Thread Alban Gruin
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 v7. sequencer.c | 7 ++- 1 file changed

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

2019-03-05 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 v7. sequencer.c | 69 ++--- sequencer.h | 50

[PATCH v8 09/18] sequencer: make sequencer_make_script() write its script to a strbuf

2019-03-05 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 --- No changes since v7. builtin/rebase--interactive.c | 13 ++- sequencer.c

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

2019-03-05 Thread Alban Gruin
move several functions to rebase--interactive.c") into three, one for each function. The tip of this series is tagged as "refactor-todo-list-v8" in https://github.com/agrn/git. The range diff is included below. Alban Gruin (18): sequencer: changes in parse_insn_buffer() sequence

[PATCH v8 03/18] sequencer: remove the 'arg' field from todo_item

2019-03-05 Thread Alban Gruin
ing the todo list buffer. Signed-off-by: Alban Gruin --- No changes since v7. sequencer.c | 67 ++--- sequencer.h | 6 +++-- 2 files changed, 42 insertions(+), 31 deletions(-) diff --git a/sequencer.c b/sequencer.c index 25cc7a9a91..c844a9b7f3 10

[PATCH v8 05/18] sequencer: introduce todo_list_write_to_file()

2019-03-05 Thread Alban Gruin
. Signed-off-by: Alban Gruin --- No changes since v7. sequencer.c | 61 +++-- sequencer.h | 11 ++ 2 files changed, 48 insertions(+), 24 deletions(-) diff --git a/sequencer.c b/sequencer.c index 346706029c..4809b22ce4 100644 --- a

[PATCH v8 07/18] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list

2019-03-05 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 | 18 -- sequencer.c | 114 ++ sequencer.h | 5 +- 3 files changed, 91

[PATCH v8 06/18] sequencer: refactor check_todo_list() to work on a todo_list

2019-03-05 Thread Alban Gruin
-interactive.c, and made static again. Signed-off-by: Alban Gruin --- No changes since v7. builtin/rebase--interactive.c | 2 +- rebase-interactive.c | 91 - rebase-interactive.h | 2 + sequencer.c | 121

[PATCH v8 08/18] sequencer: refactor rearrange_squash() to work on a todo_list

2019-03-05 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 --- No changes since v7. builtin/rebase--interactive.c | 2 +- sequencer.c | 92 ++- sequencer.h

[PATCH v8 13/18] sequencer: refactor skip_unnecessary_picks() to work on a todo_list

2019-03-05 Thread Alban Gruin
list, eliminating the need to reparse 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 --- No changes since v7. sequencer.c | 82 + 1

[PATCH v8 17/18] sequencer: use edit_todo_list() in complete_action()

2019-03-05 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 --- No changes since v7. sequencer.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/sequencer.c b/sequencer.c

<    1   2   3   4   5   >