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

2018-08-28 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 v6. builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 16 ++-- sequencer.c| 30 ++ sequencer.h

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

2018-08-28 Thread Alban Gruin
to use of run_command_silent_on_success(). Signed-off-by: Alban Gruin --- No changes since v6. sequencer.c | 51 +-- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/sequencer.c b/sequencer.c index dd1b060863..eaa1aa7deb 100644

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

2018-08-28 Thread Alban Gruin
or `--onto` to rebase--interactive2. - [18/20] Replace "restrict_revisions" by "restrict_revision" in git-rebase.sh. 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 functi

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

2018-08-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 --- No changes since v6. Makefile | 1 + builtin/rebase--helper.c | 11 -- git-rebase--interactive.sh | 52

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

2018-08-28 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

ag/rebase-i-in-c, was Re: What's cooking in git.git (Aug 2018, #05; Mon, 20)

2018-08-24 Thread Alban Gruin
Hi Junio, Le 21/08/2018 à 00:15, Junio C Hamano a écrit : > * ag/rebase-i-in-c (2018-08-10) 20 commits > - rebase -i: move rebase--helper modes to rebase--interactive > - rebase -i: remove git-rebase--interactive.sh > - rebase--interactive2: rewrite the submodes of interactive rebase in C > -

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

2018-08-13 Thread Alban Gruin
Hi Duy, Le 13/08/2018 à 18:06, Duy Nguyen a écrit : > On Fri, Aug 10, 2018 at 6:54 PM Alban Gruin wrote: > > This patch series rewrite the interactive rebase from shell to C. > > I was running some tests on 'pu' and ran git-rebase--interactive > without arguments because a

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

2018-08-10 Thread Alban Gruin
Le 10/08/2018 à 22:27, Junio C Hamano a écrit : > If we are planning to make all the backend responsible for stashing > away before they run and applying the stash after they are done, > then it might make sense to have the application side on the backend > as the first step. But if what you need

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

2018-08-10 Thread Alban Gruin
Hi Junio, Le 10/08/2018 à 21:25, Junio C Hamano a écrit : > Alban Gruin writes: > >> This rewrites complete_action() from shell to C. >> >> A new mode is added to rebase--helper (`--complete-action`), as well as >> a new flag (`--autosquash`). >> >> F

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

2018-08-10 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 v5. builtin/rebase

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

2018-08-10 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 | 200 + git

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

2018-08-10 Thread Alban Gruin
is changed accordingly. Signed-off-by: Alban Gruin --- No changes since v5. 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 v6 12/20] rebase -i: remove unused modes and functions

2018-08-10 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 v5. builtin/rebase--helper.c | 23 ++ git-rebase--interactive.sh | 50 -- rebase-interactive.c

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

2018-08-10 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 v5

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

2018-08-10 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 v5. builtin/rebase--helper.c | 28

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

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

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

2018-08-10 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 v5. .gitignore| 1

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

2018-08-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 v6 03/20] editor: add a function to launch the sequence editor

2018-08-10 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 v5. cache.h | 1 + editor.c | 27 +-- strbuf.h | 2 ++ 3 files changed, 28

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

2018-08-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 --- No changes since v5. builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 25

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

2018-08-10 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 v6 00/20] rebase -i: rewrite in C

2018-08-10 Thread Alban Gruin
ete_action(). - [11/20] Use error() to show the message "Nothing to do". - [11/20] Typofix. 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

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

2018-08-10 Thread Alban Gruin
in 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 | 27 +++ rebase-interactive.h | 1 + 4 files changed, 37 insertions(+), 15

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

2018-08-10 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 v6 06/20] rebase -i: rewrite setup_reflog_action() in C

2018-08-10 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 v5. builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 16 ++-- sequencer.c| 30 ++ sequencer.h

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

2018-08-10 Thread Alban Gruin
Signed-off-by: Alban Gruin --- No changes since v5. 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 v6 08/20] sequencer: refactor append_todo_help() to write its message to a buffer

2018-08-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 | 43 rebase-interactive.h | 4 +++- 3 files changed

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

2018-08-10 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 v5

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

2018-08-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 --- No changes since v5. Makefile | 1 + builtin/rebase--helper.c | 11 -- git-rebase--interactive.sh | 52

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

2018-08-10 Thread Alban Gruin
to use of run_command_silent_on_success(). Signed-off-by: Alban Gruin --- No changes since v5. sequencer.c | 51 +-- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/sequencer.c b/sequencer.c index dd1b060863..eaa1aa7deb 100644

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

2018-08-09 Thread Alban Gruin
Le 09/08/2018 à 16:22, Phillip Wood a écrit : >>   +int complete_action(struct replay_opts *opts, unsigned flags, >> +    const char *shortrevisions, const char *onto_name, >> +    const char *onto, const char *orig_head, const char *cmd, >> +    unsigned autosquash) >> +{

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

2018-08-09 Thread Alban Gruin
Hi Phillip, Le 08/08/2018 à 18:04, Phillip Wood a écrit : +int edit_todo_list(unsigned flags) +{ +    struct strbuf buf = STRBUF_INIT; +    const char *todo_file = rebase_path_todo(); +    FILE *todo; + +    if (strbuf_read_file(, todo_file, 0) < 0) +   

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

2018-08-08 Thread Alban Gruin
Hi Phillip, Le 07/08/2018 à 16:00, Phillip Wood a écrit : > On 31/07/18 18:59, Alban Gruin wrote: >> + >> +int edit_todo_list(unsigned flags) >> +{ >> +struct strbuf buf = STRBUF_INIT; >> +const char *todo_file = rebase_path_todo(); >> +FILE *

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

2018-08-08 Thread Alban Gruin
Hi Phillip, Le 07/08/2018 à 15:57, Phillip Wood a écrit : >> +if (ret < 0) >> +error_errno(_("could not append help text to '%s'"), >> rebase_path_todo()); >> + >> +fclose(todo); > > You should definitely check the return value and return an error if > appropriate as fputs()

[GSoC] GSoC with git, week 13

2018-08-02 Thread Alban Gruin
Hi, I am a bit late this week, but here is my blog post: https://blog.pa1ch.fr/posts/2018/08/02/en/gsoc2018-week13.html Cheers, Alban

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

2018-07-31 Thread Alban Gruin
as it is useless now. Signed-off-by: Alban Gruin --- .gitignore | 1 - Makefile | 1 - builtin.h | 1 - builtin/rebase--helper.c | 226 - builtin/rebase--interactive.c | 27 +++- git

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

2018-07-31 Thread Alban Gruin
is changed accordingly. Signed-off-by: Alban Gruin --- No changes since v4. 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 v5 14/20] rebase -i: rewrite the rest of init_revisions_and_shortrevisions() in C

2018-07-31 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 v5 18/20] rebase--interactive2: rewrite the submodes of interactive rebase in C

2018-07-31 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 v4

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

2018-07-31 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 v4. builtin/rebase

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

2018-07-31 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 v4. .gitignore| 1

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

2018-07-31 Thread Alban Gruin
is modified to call git-rebase--interactive2 instead of git-rebase--helper. Signed-off-by: Alban Gruin --- No changes since v4. .gitignore | 1 + Makefile | 1 + builtin.h | 1 + builtin/rebase--interactive2.c | 200

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

2018-07-31 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 --- builtin/rebase--helper.c | 28 +- git-rebase

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

2018-07-31 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 v4. builtin/rebase--helper.c | 2 +- rebase-interactive.c | 45 rebase-interactive.h | 4

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

2018-07-31 Thread Alban Gruin
Signed-off-by: Alban Gruin --- No changes since v4. 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 v5 07/20] rebase -i: rewrite checkout_onto() in C

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

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

2018-07-31 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 v4. builtin/rebase--helper.c | 23 ++ git-rebase--interactive.sh | 50 -- rebase-interactive.c

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

2018-07-31 Thread Alban Gruin
() won’t write "noop", and will abort without starting the editor. Signed-off-by: Alban Gruin --- No changes since v4. builtin/rebase--helper.c | 12 - git-rebase--interactive.sh | 53 ++-- git-rebase.sh | 2 +- sequencer.c| 99 +

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

2018-07-31 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 v4

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

2018-07-31 Thread Alban Gruin
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 --- No changes since v4

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

2018-07-31 Thread Alban Gruin
to use of run_command_silent_on_success(). Signed-off-by: Alban Gruin --- No changes since v4. sequencer.c | 51 +-- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/sequencer.c b/sequencer.c index 8eff526584..6d87f5ae6a 100644

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

2018-07-31 Thread Alban Gruin
, 'jk/empty-pick-fix', and 'as/sequencer-customizable-comment-char', as they modified sequencer.c. Changes since v4: - [15/20] Add a newline char to $state_dir/quiet in write_basic_state(), even if $GIT_QUIET is not set - [20/20] Remove the declaration of cmd_rebase__helper() in builti

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

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

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

2018-07-31 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 v4. builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 16 ++-- sequencer.c| 30 ++ sequencer.h

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

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

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

2018-07-31 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 v4. cache.h | 1 + editor.c | 27 +-- strbuf.h | 2 ++ 3 files changed, 28

Re: [GSoC][PATCH v4] fixup! rebase -i: rewrite write_basic_state() in C

2018-07-31 Thread Alban Gruin
Hi Junio, Le 31/07/2018 à 17:23, Junio C Hamano a écrit : > Alban Gruin writes: > >> As pointed out by SZEDER Gábor, git-rebase.sh wrote to to 'quiet' with >> an `echo`: >> >> echo "$GIT_QUIET" > "$state_dir/quiet" >> >>

[GSoC][PATCH v4] fixup! rebase -i: rewrite write_basic_state() in C

2018-07-31 Thread Alban Gruin
could lead to problems. This patch changes the rewritten version to behave like the shell version. Signed-off-by: Alban Gruin --- Hi Junio, could you apply this patch on top of ag/rebase-i-in-c, please? sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer.c b/seque

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

2018-07-30 Thread Alban Gruin
Hi, Le 30/07/2018 à 20:25, SZEDER Gábor a écrit : >> diff --git a/sequencer.c b/sequencer.c >> index 1c035ceec7..d257903db0 100644 >> --- a/sequencer.c >> +++ b/sequencer.c > >> +int write_basic_state(struct replay_opts *opts, const char *head_name, >> + const char *onto, const

Re: [PATCH] builtin.h: remove declaration of cmd_rebase__helper

2018-07-30 Thread Alban Gruin
Hi Ramsay, Le 30/07/2018 à 00:44, Ramsay Jones a écrit : > > Commit 94d4e2fb88 ("rebase -i: move rebase--helper modes to > rebase--interactive", 2018-07-24) removed the definition of the > 'cmd_rebase__helper' symbol, but forgot to remove the corresponding > declaration in the 'builtin.h' header

[GSoC] GSoC with git, week 12

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

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

2018-07-24 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 v4 20/20] rebase -i: move rebase--helper modes to rebase--interactive

2018-07-24 Thread Alban Gruin
as it is useless now. Signed-off-by: Alban Gruin --- .gitignore | 1 - Makefile | 1 - builtin/rebase--helper.c | 226 - builtin/rebase--interactive.c | 27 +++- git-rebase--preserve-merges.sh | 10 +- git.c

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

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

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

2018-07-24 Thread Alban Gruin
(), a call to comment_for_reflog() is added at the beginning of this function. Signed-off-by: Alban Gruin --- Dropped the `verbose` variable. builtin/rebase--helper.c | 7 ++- git-rebase--interactive.sh | 16 ++-- sequencer.c| 30

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

2018-07-24 Thread Alban Gruin
to use of run_command_silent_on_success(). Signed-off-by: Alban Gruin --- No changes since v3. sequencer.c | 51 +-- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/sequencer.c b/sequencer.c index 0fc03dfe48..274cddd13f 100644

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

2018-07-24 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 v3. cache.h | 1 + editor.c | 27 +-- strbuf.h | 2 ++ 3 files changed, 28

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

2018-07-24 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 | 200 + git

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

2018-07-24 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 --- builtin/rebase--helper.c | 23 ++ git-rebase--interactive.sh | 50 -- rebase-interactive.c | 22

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

2018-07-24 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 v4 13/20] rebase -i: implement the logic to initialize $revisions in C

2018-07-24 Thread Alban Gruin
is changed accordingly. Signed-off-by: Alban Gruin --- 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 index 6085527b2b

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

2018-07-24 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 --- .gitignore| 1 - Makefile

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

2018-07-24 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 --- All patches from this one are new. builtin/rebase

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

2018-07-24 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 --- builtin/rebase--helper.c | 23

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

2018-07-24 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 --- Dropped the `include` in rebase-interactive.h. builtin/rebase--helper.c | 2 +- rebase-interactive.c | 45 rebase

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

2018-07-24 Thread Alban Gruin
Signed-off-by: Alban Gruin --- New patch. 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 d392160ba9..7755b68092 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-inte

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

2018-07-24 Thread Alban Gruin
() won’t write "noop", and will abort without starting the editor. Signed-off-by: Alban Gruin --- builtin/rebase--helper.c | 12 - git-rebase--interactive.sh | 53 ++-- git-rebase.sh | 2 +- sequencer.c| 99 ++ s

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

2018-07-24 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 --- builtin/rebase--helper.c

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

2018-07-24 Thread Alban Gruin
in favour of a call to the helper. Signed-off-by: Alban Gruin --- No code changes since v3. builtin/rebase--helper.c | 13 - git-rebase--interactive.sh | 11 +-- rebase-interactive.c | 31 +++ rebase-interactive.h | 1 + 4 files changed

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

2018-07-24 Thread Alban Gruin
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 --- No code changes since

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

2018-07-24 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 --- No code changes since v3. Makefile | 1 + builtin/rebase--helper.c | 11 -- git-rebase--interactive.sh | 52

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

2018-07-24 Thread Alban Gruin
as a builtin Alban Gruin (20): sequencer: make two 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 to silence a command

ag/rebase-i-in-c, was Re: What's cooking in git.git (Jul 2018, #02; Wed, 18)

2018-07-20 Thread Alban Gruin
Hi Junio, Le 19/07/2018 à 00:03, Junio C Hamano a écrit : > * ag/rebase-i-in-c (2018-07-10) 13 commits > - rebase -i: rewrite the rest of init_revisions_and_shortrevisions in C > - rebase -i: implement the logic to initialize the variable $revision in C > - rebase--interactive: remove unused

[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: [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 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 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

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

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

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

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

2018-07-10 Thread Alban Gruin
(), a 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 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 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

[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 01/13] sequencer: make two functions and an enum from sequencer.c public

2018-07-10 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 --- 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 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 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

<    1   2   3   4   >