[PATCH v8 11/18] rebase--interactive: move sequencer_add_exec_commands()

2019-03-05 Thread Alban Gruin
As sequencer_add_exec_commands() is only needed inside of rebase--interactive.c for `rebase -p', it is moved there from sequencer.c. The parameter r (repository) is dropped along the way. Signed-off-by: Alban Gruin --- New commit, but was a part of "rebase--interactive: move several

[PATCH v8 18/18] rebase--interactive: move transform_todo_file()

2019-03-05 Thread Alban Gruin
As transform_todo_file() is only needed inside of rebase--interactive.c for `rebase -p', it is moved there from sequencer.c. The parameter r (repository) is dropped along the way. Signed-off-by: Alban Gruin --- New commit, but was a part of "rebase--interactive: move several functions

[PATCH v8 12/18] rebase--interactive: move rearrange_squash_in_todo_file()

2019-03-05 Thread Alban Gruin
As rearrange_squash_in_todo_file() is only needed inside of rebase--interactive.c for `rebase -p', it is moved there from sequencer.c. The parameter r (repository) is dropped along the way, and the error handling is slightly improved. Signed-off-by: Alban Gruin --- New commit, but was a pa

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

2019-03-05 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 --- No c

[PATCH v8 14/18] rebase-interactive: use todo_list_write_to_file() in edit_todo_list()

2019-03-05 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 v8 16/18] rebase-interactive: rewrite edit_todo_list() to handle the initial edit

2019-03-05 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 | 53 +++ rebase-interactive.h | 4 ++- sequencer.c | 3 +- sequencer.h

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

2019-03-05 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 v7. rebase-int

Re: [RFC PATCH 08/11] rebase -i: use struct rebase_options to parse args

2019-03-21 Thread Alban Gruin
Hi Phillip, It’s nice to see your work on this on the list. Le 19/03/2019 à 20:03, Phillip Wood a écrit : > From: Phillip Wood > > In order to run `rebase -i` without forking `rebase--interactive` it > will be convenient to use the same structure when parsing the options in > cmd_rebase() and c

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 mo

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

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

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

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

2018-07-24 Thread Alban Gruin
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 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 17/20] rebase -i: implement the main part of interactive rebase as a builtin

2018-07-24 Thread Alban Gruin
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 03/20] editor: add a function to launch the sequence editor

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

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

2018-07-24 Thread Alban Gruin
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 --- a

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

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 c

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][PATCH v4] fixup! rebase -i: rewrite write_basic_state() in C

2018-07-31 Thread Alban Gruin
ich 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

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

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

2018-07-31 Thread Alban Gruin
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 --- a

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

2018-07-31 Thread Alban Gruin
x27;, '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

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

2018-07-31 Thread Alban Gruin
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 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
ite "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 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 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 15/20] rebase -i: rewrite write_basic_state() in C

2018-07-31 Thread Alban Gruin
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 17/20] rebase -i: implement the main part of interactive rebase as a builtin

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

2018-07-31 Thread Alban Gruin
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 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] 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

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()

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 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(&buf, todo_file, 0) < 0) +   

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) >> +{ >

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

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

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

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

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

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 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 bec

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

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

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

2018-08-28 Thread Alban Gruin
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 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 --- No

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

2018-08-28 Thread Alban Gruin
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 --- a

[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 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
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
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 11/20] rebase -i: rewrite complete_action() in C

2018-08-28 Thread Alban Gruin
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

<    1   2   3   4   5   >