Re: [PATCH v2 0/5] Use complete_action's todo list to do the rebase

2019-10-08 Thread Alban Gruin
Hi Junio, Le 08/10/2019 à 04:45, Junio C Hamano a écrit : > Alban Gruin writes: > >> This can be seen as a continuation of ag/reduce-rewriting-todo. >> >> Currently, complete_action() releases its todo list before calling >> sequencer_continue(), which reloads the

Re: [PATCH v3 03/13] winansi: use FLEX_ARRAY to avoid compiler warning

2019-10-07 Thread Alban Gruin
Hi Johannes, Le 04/10/2019 à 17:09, Johannes Schindelin via GitGitGadget a écrit : > From: Johannes Schindelin > > MSVC would complain thusly: > > C4200: nonstandard extension used: zero-sized array in struct/union > > Let's just use the `FLEX_ARRAY` constant that we introduced for exactly

Re: GitGUIGadget, was Re: [PATCH] Feature: custom guitool commands can now have custom keyboard shortcuts

2019-10-07 Thread Alban Gruin
Hi Birger, Le 07/10/2019 à 12:43, Birger Skogeng Pedersen a écrit : > It seems this topic has kindof derailed(?). But I feel like voicing my > opinion nonetheless. > > -%<- > > My biggest gripe with not using Github is how to keep track of replies > (comments) to a topic. I have to navigate thro

[PATCH v2 4/5] rebase: fill `squash_onto' in get_replay_opts()

2019-10-07 Thread Alban Gruin
hange that. Signed-off-by: Alban Gruin --- Reworded commit. builtin/rebase.c | 5 + 1 file changed, 5 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index e8319d5946..2097d41edc 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -117,6 +117,11 @@ static struct replay_opts get_r

[PATCH v2 5/5] sequencer: directly call pick_commits() from complete_action()

2019-10-07 Thread Alban Gruin
written() -- this is unnecessary as we're starting a new rebase. This changes complete_action() to directly call pick_commits() to avoid these unnecessary steps. Signed-off-by: Alban Gruin --- Reworded commit. sequencer.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) d

[PATCH v2 0/5] Use complete_action's todo list to do the rebase

2019-10-07 Thread Alban Gruin
1] http://public-inbox.org/git/1732521.CJWHkCQAay@andromeda/ Alban Gruin (5): sequencer: update `total_nr' when adding an item to a todo list sequencer: update `done_nr' when skipping commands in a todo list sequencer: move the code writing total_nr on the disk to a new

[PATCH v2 2/5] sequencer: update `done_nr' when skipping commands in a todo list

2019-10-07 Thread Alban Gruin
ut it would start to matter at the end of this series the same reason. Signed-off-by: Alban Gruin --- Reworded commit. sequencer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sequencer.c b/sequencer.c index 575b852a5a..42313f8de6 100644 --- a/sequencer.c +++ b/sequencer.c @@ -5054,6 +5

[PATCH v2 1/5] sequencer: update `total_nr' when adding an item to a todo list

2019-10-07 Thread Alban Gruin
to matter. Signed-off-by: Alban Gruin --- Reworded commit. sequencer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sequencer.c b/sequencer.c index d648aaf416..575b852a5a 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2070,6 +2070,7 @@ void todo_list_release(struct todo_list *todo_list) sta

[PATCH v2 3/5] sequencer: move the code writing total_nr on the disk to a new function

2019-10-07 Thread Alban Gruin
function so it can be called from complete_action(). Signed-off-by: Alban Gruin --- sequencer.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sequencer.c b/sequencer.c index 42313f8de6..ec7ea8d9e5 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2342,6 +2342,16

Re: [PATCH v1 5/5] sequencer: directly call pick_commits() from complete_action()

2019-10-02 Thread Alban Gruin
Hi Junio, Le 02/10/2019 à 04:38, Junio C Hamano a écrit : > Alban Gruin writes: > >> Currently, complete_action() calls sequencer_continue() to do the >> rebase. Even though the former already has the todo list, the latter >> loads it from the disk and parses it. Calli

Re: [PATCH v1 5/5] sequencer: directly call pick_commits() from complete_action()

2019-10-02 Thread Alban Gruin
Hi Johannes, Le 02/10/2019 à 10:20, Johannes Schindelin a écrit : > Hi, > > On Fri, 27 Sep 2019, Phillip Wood wrote: > >> Hi Alban >> >> Thanks for removing some more unnecessary work reloading the the todo list. >> >> On 25/09/2019 21:13, Alban G

Re: [PATCH v1 1/5] sequencer: update `total_nr' when adding an item to a todo list

2019-10-02 Thread Alban Gruin
Hi Junio and Johannes, Le 02/10/2019 à 10:59, Junio C Hamano a écrit : > Johannes Schindelin writes: > >> Hi Junio, >> >> On Wed, 2 Oct 2019, Junio C Hamano wrote: >> >>> Alban Gruin writes: >>> >>>> `total_nr' is the total a

[PATCH v1 0/5] Use complete_action's todo list to do the rebase

2019-09-25 Thread Alban Gruin
4c86140027, "Third batch"). The tip of this series is tagged as "reduce-todo-list-cont-v1" at https://github.com/agrn/git. [0] http://public-inbox.org/git/20190717143918.7406-1-alban.gr...@gmail.com/ [1] http://public-inbox.org/git/1732521.CJWHkCQAay@andromeda/ Alban

[PATCH v1 5/5] sequencer: directly call pick_commits() from complete_action()

2019-09-25 Thread Alban Gruin
Currently, complete_action() calls sequencer_continue() to do the rebase. Even though the former already has the todo list, the latter loads it from the disk and parses it. Calling directly pick_commits() from complete_action() avoids this unnecessary round trip. Signed-off-by: Alban Gruin

[PATCH v1 1/5] sequencer: update `total_nr' when adding an item to a todo list

2019-09-25 Thread Alban Gruin
`total_nr' is the total amount of items, done and toto, that are in a todo list. But unlike `nr', it was not updated when an item was appended to the list. This variable is mostly used by command prompts (ie. git-prompt.sh and the like). Signed-off-by: Alban Gruin --- sequencer.

[PATCH v1 4/5] rebase: fill `squash_onto' in get_replay_opts()

2019-09-25 Thread Alban Gruin
Signed-off-by: Alban Gruin --- builtin/rebase.c | 5 + 1 file changed, 5 insertions(+) diff --git a/builtin/rebase.c b/builtin/rebase.c index e8319d5946..2097d41edc 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -117,6 +117,11 @@ static struct replay_opts get_replay_op

[PATCH v1 3/5] sequencer: move the code writing total_nr on the disk to a new function

2019-09-25 Thread Alban Gruin
function so it can be called from complete_action(). Signed-off-by: Alban Gruin --- sequencer.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sequencer.c b/sequencer.c index 42313f8de6..ec7ea8d9e5 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2342,6 +2342,16

[PATCH v1 2/5] sequencer: update `done_nr' when skipping commands in a todo list

2019-09-25 Thread Alban Gruin
In a todo list, `done_nr' is the amount of commands that were executed or skipped, but skip_unnecessary_picks() did not update it. This variable is mostly used by command prompts (ie. git-prompt.sh and the like). Signed-off-by: Alban Gruin --- sequencer.c | 1 + 1 file changed, 1 inse

Re: [RFC PATCH 0/9] rebase -i: extend rebase.missingCommitsCheck to `--edit-todo' and co.

2019-09-24 Thread Alban Gruin
Hi, This has been a long time since I have not given an update on this -- sorry about that. I think it’s time to do it. Le 29/07/2019 à 11:38, Phillip Wood a écrit : > Hi Alban > > -%<- > > That's an interesting point about `--continue`. Perhaps if `--edit-todo` > detects deleted lines in erro

Re: [PATCH v2] userdiff: Add a builtin pattern for dts files

2019-08-17 Thread Alban Gruin
Hi Stephen, Le 17/08/2019 à 00:56, Stephen Boyd a écrit : > The Linux kernel receives many patches to the devicetree files each > release. The hunk header for those patches typically show nothing, > making it difficult to figure out what node is being modified without > applying the patch or openi

Re: [RFC PATCH 0/9] rebase -i: extend rebase.missingCommitsCheck to `--edit-todo' and co.

2019-07-25 Thread Alban Gruin
e early bug fix > patches are useful in their own right) > > On 17/07/2019 15:39, Alban Gruin wrote: >> To prevent mistakes when editing a branch, rebase features a knob, >> rebase.missingCommitsCheck, to warn the user if a commit was dropped. >> Unfortunately, this

Re: [RFC PATCH 4/9] sequencer: update `done_nr' when skipping commands in a todo list

2019-07-19 Thread Alban Gruin
Hi, Le 18/07/2019 à 21:55, Junio C Hamano a écrit : > Alban Gruin writes: > > In a todo list, `done_nr' is the amount of commands that were executed > > or skipped, but skip_unnecessary_picks() did not update it. > > OK. Together with 3/9 and this one, any increment

Re: [RFC PATCH 5/9] sequencer: move the code writing total_nr on the disk to a new function

2019-07-19 Thread Alban Gruin
Hi, Le 18/07/2019 à 22:04, Junio C Hamano a écrit : > Alban Gruin writes: > > The total amount of commands can be used to show the progression of the > > rebasing in a shell. This number is written to the disk by > > read_populate_todo() when the todo list is loaded from &

Re: [RFC PATCH 3/9] sequencer: update `total_nr' when adding an item to a todo list

2019-07-19 Thread Alban Gruin
Hi, Le 18/07/2019 à 21:52, Junio C Hamano a écrit : > Alban Gruin writes: > > `total_nr' is the total amount of items, done and toto, that are in a > > "amount" -> "number" perhaps. Also s/toto/todo/ perhaps but I am > not sure what you wanted to s

Re: [RFC PATCH 1/9] t3404: demonstrate that --edit-todo does not check for dropped commits

2019-07-19 Thread Alban Gruin
Hi Junio, Le 18/07/2019 à 20:31, Junio C Hamano a écrit : > Alban Gruin writes: > > When set to "warn" or "error", `rebase.missingCommitCheck' would make > > rebase -i warn if the user removed commits from the todo list to prevent > > mistakes.

[RFC PATCH 8/9] rebase-interactive: warn if commit is dropped with --edit-todo

2019-07-17 Thread Alban Gruin
This adds the ability for --edit-todo to check if commits were dropped by the user using todo_list_check_against_backup(). Signed-off-by: Alban Gruin --- rebase-interactive.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rebase-interactive.c b/rebase

[RFC PATCH 7/9] rebase-interactive: todo_list_check() also uses the done list

2019-07-17 Thread Alban Gruin
(), to load the done list and the backup list, and call todo_list_check(). Signed-off-by: Alban Gruin --- rebase-interactive.c | 57 ++-- rebase-interactive.h | 6 - sequencer.c | 4 ++-- 3 files changed, 57 insertions(+), 10 deleti

[RFC PATCH 9/9] sequencer: have read_populate_todo() check for dropped commits

2019-07-17 Thread Alban Gruin
This adds the ability to check if commits were dropped when resuming a rebase (with `--continue') or when reloading the todo list after an `exec' command. Tests added previously should work now. Signed-off-by: Alban Gruin --- sequencer.c | 5 - t/t3

[RFC PATCH 6/9] sequencer: add a parameter to sequencer_continue() to accept a todo list

2019-07-17 Thread Alban Gruin
sequencer_continue() to accept a todo list. If a valid list is provided, read_populate_todo() won't be called. complete_action() is modified to pass its todo list to sequencer_continue(). This also avoids reloading the todo list from the disk just after releasing it. Signed-off-by: Alban

[RFC PATCH 5/9] sequencer: move the code writing total_nr on the disk to a new function

2019-07-17 Thread Alban Gruin
can be called by complete_action(). Signed-off-by: Alban Gruin --- sequencer.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sequencer.c b/sequencer.c index ec9c3d4dc5..d66b80d49f 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2343,6 +2343,16 @@ void

[RFC PATCH 4/9] sequencer: update `done_nr' when skipping commands in a todo list

2019-07-17 Thread Alban Gruin
In a todo list, `done_nr' is the amount of commands that were executed or skipped, but skip_unnecessary_picks() did not update it. Signed-off-by: Alban Gruin --- sequencer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sequencer.c b/sequencer.c index e61ae75451..ec9c3d4dc5 100644

[RFC PATCH 0/9] rebase -i: extend rebase.missingCommitsCheck to `--edit-todo' and co.

2019-07-17 Thread Alban Gruin
er (9d418600f4, "The fifth batch"). The tip of this series is tagged as "edit-todo-drop-rfc" in https://github.com/agrn/git. Alban Gruin (9): t3404: demonstrate that --edit-todo does not check for dropped commits t3429: demonstrate that rebase exec does not check for dropp

[RFC PATCH 1/9] t3404: demonstrate that --edit-todo does not check for dropped commits

2019-07-17 Thread Alban Gruin
3404 to demonstrate this. The first one is not broken, as when `rebase.missingCommitsCheck' is not set, nothing in particular must be done towards dropped commits. The two others are broken, demonstrating the problem. Signed-off-by: Alban Gruin --- t/t3404-rebase-interactive.sh | 82

[RFC PATCH 2/9] t3429: demonstrate that rebase exec does not check for dropped commits

2019-07-17 Thread Alban Gruin
thing should be done for dropped commits. The last two are, demonstrating the problem. Signed-off-by: Alban Gruin --- t/t3429-rebase-edit-todo.sh | 44 +++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/t/t3429-rebase-edit-todo.sh b/t/t3429-rebase

[RFC PATCH 3/9] sequencer: update `total_nr' when adding an item to a todo list

2019-07-17 Thread Alban Gruin
`total_nr' is the total amount of items, done and toto, that are in a todo list. But unlike `nr', it was not updated when an item was appended to the list. Signed-off-by: Alban Gruin --- sequencer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sequencer.c b/sequencer.c index

Why is there still git-rebase--am.sh?

2019-06-02 Thread Alban Gruin
Hi, I was wandering in rebase’s source code, and found out that even though run_specific_rebase() no longer calls git-rebase--am.sh since 21853626ea ("built-in rebase: call `git am` directly", 2019-01-18), this commit did not remove the code to call it. I guess it was an oversight. Now that g

Re: [PATCH 2/2] mingw: enable DEP and ASLR

2019-05-01 Thread Alban Gruin
Hi Johannes, Le 01/05/2019 à 00:41, Johannes Schindelin a écrit : > Hi Hannes, > > On Tue, 30 Apr 2019, Johannes Sixt wrote: > >> [had to add Dscho as recipient manually, mind you] > > I usually pick up responses to GitGitGadget patch series even if I am not > on explicit Cc: (but it might take

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

[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

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

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

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

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

[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

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

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

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

[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

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

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

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

2019-02-02 Thread Alban Gruin
Le 01/02/2019 à 15:51, Phillip Wood a écrit : >>> @@ -4473,38 +4475,62 @@ int sequencer_add_exec_commands(struct >>> repository *r, >>>   * those chains if there are any. >>>   */ >>> insert = -1; >>> -    for (i = 0; i < todo_list.nr; i++) { >>> -    enum todo_command command = to

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

2019-02-02 Thread Alban Gruin
Hi Phillip, Le 01/02/2019 à 12:15, Phillip Wood a écrit : > Hi Alban > > On 29/01/2019 15:01, Alban Gruin wrote: >> As transform_todo_file() is only needed inside of rebase--interactive.c, >> it is moved there from sequencer.c. > > I think I'd prefer to minimize

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

2019-02-02 Thread Alban Gruin
Hi Phillip, Le 01/02/2019 à 12:03, Phillip Wood a écrit : >>   } >>   -    strbuf_reset(&todo_list.buf); >> -    if (launch_sequence_editor(todo_file, &todo_list.buf, NULL)) { >> -    todo_list_release(&todo_list); >> -    return -1; >> -    } >> +    if (launch_sequence_editor(todo_fi

Re: Broken interactive rebase text after some UTF-8 characters

2019-02-01 Thread Alban Gruin
Hi Michal, Le 01/02/2019 à 10:06, Michal Nowak a écrit : > Johannes, > > On Friday, February 1, 2019 at 8:38 AM, Johannes Schindelin > wrote: >> Hi, >> >> On Thu, 31 Jan 2019, Junio C Hamano wrote: >> >>> Phillip Wood writes: >>> > Are we misusing C formats? The C standard and PO

Re: Broken interactive rebase text after some UTF-8 characters

2019-02-01 Thread Alban Gruin
Hi Johannes, Le 01/02/2019 à 08:38, Johannes Schindelin a écrit : > Hi, > > On Thu, 31 Jan 2019, Junio C Hamano wrote: > >> Phillip Wood writes: >> Are we misusing C formats? >>> >>> The C standard and POSIX both say that the * refers to the maximum >>> number of bytes to print but it look

Re: Broken interactive rebase text after some UTF-8 characters

2019-01-31 Thread Alban Gruin
Hi Phillip, Le 31/01/2019 à 21:40, Phillip Wood a écrit : > Hi Alban > > On 31/01/2019 17:43, Alban Gruin wrote: >> Hi Phillip and Michal, >> >> I think I found the bug. > > Good find! Which os are you on? I’m on Linux, but I found this on OpenIndiana running under QEMU. -- Alban

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

2019-01-31 Thread Alban Gruin
Hi Phillip, Le 31/01/2019 à 15:30, Phillip Wood a écrit : > Hi Alban > > On 29/01/2019 15:01, Alban Gruin wrote: >> This refactors sequencer_add_exec_commands() to work on a todo_list to >> avoid redundant reads and writes to the disk. >> >> Instead of insertin

Re: Broken interactive rebase text after some UTF-8 characters

2019-01-31 Thread Alban Gruin
Hi Phillip and Michal, I think I found the bug. If you look at .git/rebase-merge/git-rebase-todo.backup, which is created before the editor is opened, you can see that it does not have this problem. In between, transform_todos() is called and causes the problem reported by Michal. This seems to

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

2019-01-29 Thread Alban Gruin
Hi Junio, Le 29/01/2019 à 21:14, Junio C Hamano a écrit : > Alban Gruin writes: > >> if (opts->allow_ff && skip_unnecessary_picks(r, &oid)) >> return error(_("could not skip unnecessary pick commands")); >> >>

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

2019-01-29 Thread Alban Gruin
This changes complete_action() to use edit_todo_list(), now that it can handle the initial edit of the todo list. Signed-off-by: Alban Gruin --- sequencer.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/sequencer.c b/sequencer.c index 8f47f0cf39

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

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

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

2019-01-29 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 v6 05/16] sequencer: introduce todo_list_write_to_file()

2019-01-29 Thread Alban Gruin
. Signed-off-by: Alban Gruin --- sequencer.c | 61 +++-- sequencer.h | 11 ++ 2 files changed, 48 insertions(+), 24 deletions(-) diff --git a/sequencer.c b/sequencer.c index 7a295cbd3f..87b43994ff 100644 --- a/sequencer.c +++ b/sequencer.c

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

2019-01-29 Thread Alban Gruin
As transform_todo_file() is only needed inside of rebase--interactive.c, it is moved there from sequencer.c. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 26 +- sequencer.c | 23 --- sequencer.h

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

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

  1   2   3   4   5   >