Re: [RFC PATCH v5 0/4] add -p: select individual hunk lines

2018-07-28 Thread Phillip Wood
On 27/07/18 19:27, Ævar Arnfjörð Bjarmason wrote: > > On Thu, Jul 26 2018, Phillip Wood wrote: > >> From: Phillip Wood >> >> Unfortuantely v4 had test failures due to a suprious brace from a last >> minute edit to a comment that I forgot to test. This version fi

Re: [RFC PATCH] sequencer: fix quoting in write_author_script

2018-07-30 Thread Phillip Wood
On 27/07/18 13:37, Johannes Schindelin wrote: > Hi Phillip, Junio and Akinori, > > I just noticed that t3404 is broken without my patches (but with Junio's > fixup), on Windows, macOS and Linux. (See log at the end.) > > On Fri, 27 Jul 2018, Phillip Wood wrote: > >

Re: [PATCH 0/2] fix "rebase -i --root" corrupting root commit

2018-07-30 Thread Phillip Wood
On 30/07/18 10:29, Eric Sunshine wrote: > This series fixes bugs causing corruption of the root commit when > "rebase -i --root" is used to swap in a new root commit. In particular, > the "author" header has trailing garbage. Some tools handle the > corruption somewhat gracefully by showing a bogus

Re: [PATCH 2/2] sequencer: fix "rebase -i --root" corrupting author header timezone

2018-07-30 Thread Phillip Wood
Hi Eric On 30/07/18 10:29, Eric Sunshine wrote: > When "git rebase -i --root" creates a new root commit, it corrupts the > "author" header's timezone by repeating the last digit: > > author A U Thor @1112912773 -07000 > > This is due to two bugs. > > First, write_author_script() neglects to

Re: [PATCH v2 2/4] sequencer: fix "rebase -i --root" corrupting author header timezone

2018-07-31 Thread Phillip Wood
On 31/07/18 08:33, Eric Sunshine wrote: When "git rebase -i --root" creates a new root commit, it corrupts the "author" header's timezone by repeating the last digit: author A U Thor @1112912773 -07000 This is due to two bugs. First, write_author_script() neglects to add the closing quot

Re: [PATCH v2 3/4] sequencer: fix "rebase -i --root" corrupting author header timestamp

2018-07-31 Thread Phillip Wood
On 31/07/18 08:33, Eric Sunshine wrote: When "git rebase -i --root" creates a new root commit, it corrupts the "author" header's timestamp by prepending a "@": author A U Thor @1112912773 -0700 The commit parser is very strict about the format of the "author" header, and does not allow a

Re: [PATCH v2 4/4] sequencer: don't die() on bogus user-edited timestamp

2018-07-31 Thread Phillip Wood
On 31/07/18 08:33, Eric Sunshine wrote: read_author_ident() is careful to handle errors "gently" when parsing "rebase-merge/author-script" by printing a suitable warning and returning NULL; it never die()'s. One possible reason that parsing might fail is that "rebase-merge/author-script" has been

Re: [PATCH v2 0/4] fix "rebase -i --root" corrupting root commit

2018-07-31 Thread Phillip Wood
Hi Eric On 31/07/18 08:33, Eric Sunshine wrote: This is a re-roll of [1] which fixes sequencer bugs resulting in commit object corruption when "rebase -i --root" swaps in a new commit as root. Unfortunately, those bugs made it into v2.18.0 and have already corrupted at least one repository (a lo

[PATCH v2 1/2] sequencer: handle errors in read_author_ident()

2018-07-31 Thread Phillip Wood
From: Phillip Wood The calling code treated NULL as a valid return value, so fix this by returning and integer and passing in a parameter to receive the author. Signed-off-by: Phillip Wood --- sequencer.c | 49 ++--- 1 file changed, 26 insertions

[PATCH v2 2/2] sequencer: fix quoting in write_author_script

2018-07-31 Thread Phillip Wood
From: Phillip Wood Single quotes should be escaped as \' not \\'. Note that this only affects authors that contain a single quote and then only external scripts that read the author script and users whose git is upgraded from the shell version of rebase -i while rebase was stoppe

[PATCH v2 0/2] Fix author script quoting

2018-07-31 Thread Phillip Wood
From: Phillip Wood These build on Eric's patches. The first patch would be better if it was integrated into Eric's patches. The second is a rebased version of my previous patch for fixing quoting in the author script with some additions by Johannes and rebased on top of Eric's fix

Re: [PATCH v2 0/4] fix "rebase -i --root" corrupting root commit

2018-07-31 Thread Phillip Wood
Hi Eric On 31/07/18 11:46, Eric Sunshine wrote: > On Tue, Jul 31, 2018 at 6:06 AM Phillip Wood > wrote: >> On 31/07/18 08:33, Eric Sunshine wrote: >>> Patch 2/4 of this series conflicts with Akinori MUSHA's >>> 'am/sequencer-author-script-fix' whi

Re: [PATCH v2 1/2] sequencer: handle errors in read_author_ident()

2018-08-01 Thread Phillip Wood
Hi Eric Thanks for taking a look at this On 31/07/18 21:47, Eric Sunshine wrote: On Tue, Jul 31, 2018 at 7:15 AM Phillip Wood wrote: The calling code treated NULL as a valid return value, so fix this by returning and integer and passing in a parameter to receive the author. It might be

Re: [PATCH v2 2/2] sequencer: fix quoting in write_author_script

2018-08-01 Thread Phillip Wood
Hi Eric On 31/07/18 22:39, Eric Sunshine wrote: On Tue, Jul 31, 2018 at 7:15 AM Phillip Wood wrote: Single quotes should be escaped as \' not \\'. Note that this only affects authors that contain a single quote and then only external scripts that read the author script and users wh

Re: [PATCH v2 2/2] sequencer: fix quoting in write_author_script

2018-08-01 Thread Phillip Wood
On 31/07/18 22:39, Eric Sunshine wrote: On Tue, Jul 31, 2018 at 7:15 AM Phillip Wood wrote: Single quotes should be escaped as \' not \\'. Note that this only affects authors that contain a single quote and then only external scripts that read the author script and users whose git i

[PATCH v3 0/2] Fix author script quoting

2018-08-02 Thread Phillip Wood
From: Phillip Wood Thanks to Eric for his comments on v2. The first patch hasn't changed much, the second one quite a bit. See the individual patches for a list of changes Phillip Wood (2): sequencer: handle errors in read_author_ident() sequencer: fix quoting in write_author_script

[PATCH v3 1/2] sequencer: handle errors in read_author_ident()

2018-08-02 Thread Phillip Wood
From: Phillip Wood The calling code did not treat NULL as an error. Instead NULL caused it to fallback to using the default author when creating the new commit. This changed the date and potentially the author of the commit which corrupted the author data compared to its expected value. Fix this

[PATCH v3 2/2] sequencer: fix quoting in write_author_script

2018-08-02 Thread Phillip Wood
From: Phillip Wood Single quotes should be escaped as \' not \\'. The bad quoting breaks the interactive version of 'rebase --root' (which is used when there is no '--onto' even if the user does not specify --interactive) for authors that contain "'&q

Re: [PATCH v3 2/2] sequencer: fix quoting in write_author_script

2018-08-03 Thread Phillip Wood
Dear Eric and Junio On 03/08/18 08:59, Eric Sunshine wrote: > On Thu, Aug 2, 2018 at 1:27 PM Junio C Hamano wrote: >> Phillip Wood writes: >>> For other interactive rebases this only affects external scripts that >>> read the author script and users whose git

Re: [RFC PATCH v5 0/4] add -p: select individual hunk lines

2018-08-03 Thread Phillip Wood
Hi Ævar Thanks for looking at this. On 28/07/18 13:40, Ævar Arnfjörð Bjarmason wrote: > > On Thu, Jul 26 2018, Phillip Wood wrote: > >> Unfortuantely v4 had test failures due to a suprious brace from a last >> minute edit to a comment that I forgot to test. This vers

Re: [PATCH v3 2/2] sequencer: fix quoting in write_author_script

2018-08-03 Thread Phillip Wood
Hi Eric On 03/08/18 11:02, Eric Sunshine wrote: On Fri, Aug 3, 2018 at 5:33 AM Phillip Wood wrote: If there isn't some backward compatibility then if git gets upgraded while rebase is stopped then the author data will be silently corrupted if it contains "'". read_author_id

Re: [PATCH v2 2/2] rebase --exec: make it work with --rebase-merges

2018-08-06 Thread Phillip Wood
Hi Johannes On 06/08/18 10:52, Johannes Schindelin via GitGitGadget wrote: From: Johannes Schindelin The idea of `--exec` is to append an `exec` call after each `pick`. Since the introduction of fixup!/squash! commits, this idea was extended to apply to "pick, possibly followed by a fixup/squ

Re: [PATCH v2 2/2] rebase --exec: make it work with --rebase-merges

2018-08-06 Thread Phillip Wood
On 06/08/18 16:23, Phillip Wood wrote: Hi Johannes On 06/08/18 10:52, Johannes Schindelin via GitGitGadget wrote: From: Johannes Schindelin The idea of `--exec` is to append an `exec` call after each `pick`. Since the introduction of fixup!/squash! commits, this idea was extended to apply

[PATCH v4 1/2] sequencer: handle errors from read_author_ident()

2018-08-07 Thread Phillip Wood
From: Phillip Wood Check for a NULL return value from read_author_ident() that indicates an error. Previously the NULL author was passed to commit_tree() which would then fallback to using the default author when creating the new commit. This changed the date and potentially the author of the

[PATCH v4 2/2] sequencer: fix quoting in write_author_script

2018-08-07 Thread Phillip Wood
From: Phillip Wood Single quotes should be escaped as \' not \\'. The bad quoting breaks the interactive version of 'rebase --root' (which is used when there is no '--onto' even if the user does not specify --interactive) for authors that contain "'"

[PATCH v4 0/2] fix author-script quoting

2018-08-07 Thread Phillip Wood
From: Phillip Wood I've updated these based on Eric's suggestions, hopefully they're good to go now. Thanks Eric for you help. Phillip Wood (2): sequencer: handle errors from read_author_ident() sequencer: fix quoting in write_author_script sequencer.c

Re: [PATCH v4 2/2] sequencer: fix quoting in write_author_script

2018-08-07 Thread Phillip Wood
Hi Eric On 07/08/18 11:23, Eric Sunshine wrote: > On Tue, Aug 7, 2018 at 5:35 AM Phillip Wood wrote: >> - Reverted the implementation to v2 with more robust detection of the >>missing "'" on the last line of the author script based on a >>

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

2018-08-07 Thread Phillip Wood
Hi Alban On 31/07/18 18:59, Alban Gruin wrote: > 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-interactive.c. This file >

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

2018-08-07 Thread Phillip Wood
On 31/07/18 18:59, Alban Gruin wrote: > This rewrites the edit-todo functionality from shell to C. > > To achieve that, a new command mode, `edit-todo`, is added, and the > `write-edit-todo` flag is removed, as the shell script does not need to > write the edit todo help message to the todo list a

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

2018-08-07 Thread Phillip Wood
Hi Christian On 07/08/18 16:25, Christian Couder wrote: Hi Phillip, On Tue, Aug 7, 2018 at 3:57 PM, Phillip Wood wrote: On 31/07/18 18:59, Alban Gruin wrote: + + ret = fputs(buf.buf, todo); It is not worth changing the patch just for this but strbuf_write() might be clearer (you use

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

2018-08-07 Thread Phillip Wood
Hi Christian On 07/08/18 17:28, Christian Couder wrote: > On Tue, Aug 7, 2018 at 6:15 PM, Phillip Wood > wrote: >> On 07/08/18 16:25, Christian Couder wrote: >>> >>> I agree about checking the return value from fputs(), but it seems to >>> me that we

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

2018-08-08 Thread Phillip Wood
Hi Alban On 08/08/18 16:16, Alban Gruin wrote: 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 che

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

2018-08-08 Thread Phillip Wood
On 08/08/18 16:17, Alban Gruin wrote: 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 *todo

Re: [PATCH v2 2/2] rebase --exec: make it work with --rebase-merges

2018-08-09 Thread Phillip Wood
On 09/08/18 10:22, Johannes Schindelin wrote: > Hi Phillip, > > On Mon, 6 Aug 2018, Phillip Wood wrote: > >> On 06/08/18 10:52, Johannes Schindelin via GitGitGadget wrote: >>> >>> From: Johannes Schindelin >>> >>> The idea of `--exec` is to

Re: [PATCH v4 2/2] sequencer: fix quoting in write_author_script

2018-08-09 Thread Phillip Wood
Hi Junio On 08/08/18 17:01, Junio C Hamano wrote: > Eric Sunshine writes: > >> What does concern me is that read_env_script() doesn't seem to care >> about such a malformed file; it doesn't do any validation at all. >> Contrast that with read_author_ident() which is pretty strict about >> the con

Re: [PATCH v4 2/2] sequencer: fix quoting in write_author_script

2018-08-09 Thread Phillip Wood
Hi Eric On 08/08/18 09:43, Eric Sunshine wrote: > On Tue, Aug 7, 2018 at 9:54 AM Phillip Wood wrote: >> On 07/08/18 11:23, Eric Sunshine wrote: >>> On Tue, Aug 7, 2018 at 5:35 AM Phillip Wood >>> wrote: >>>> + if (n > 0 && s[n] !=

Re: [PATCH v4 2/2] sequencer: fix quoting in write_author_script

2018-08-09 Thread Phillip Wood
On 08/08/18 10:39, Eric Sunshine wrote: > On Tue, Aug 7, 2018 at 5:35 AM Phillip Wood wrote: >> Single quotes should be escaped as \' not \\'. The bad quoting breaks >> the interactive version of 'rebase --root' (which is used when there >> is no &

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

2018-08-09 Thread Phillip Wood
Hi Alban Its nice to see things coming together so that the rebase happens in the same process as the some of the todo file preparation. I've ended up making quite a few comments on the new implementation, but they're all little things, the basic idea looks sound to me. On 31/07/18 18:59, Al

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

2018-08-09 Thread Phillip Wood
Hi Alban On 09/08/18 14:30, Alban Gruin wrote: 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_

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

2018-08-09 Thread Phillip Wood
Hi Alban On 09/08/18 16:35, Phillip Wood wrote: Hi Alban On 09/08/18 14:30, Alban Gruin wrote: 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

Re: Bug? Git won't apply a split hunk that went through a text editor

2018-08-10 Thread Phillip Wood
Hi Philip Thanks for CC'ing me Peff. On 10/08/18 19:27, Jeff King wrote: On Thu, Aug 09, 2018 at 08:17:36PM -0700, Philip White wrote: I’d like to report what I suspect is a bug in Git, tested in 2.18 and 2.14. (I’d be delighted to be corrected if it is my own misunderstanding.) I’m reporting

[PATCH 2/2] rebase -i: fix SIGSEGV when 'merge ' fails

2018-08-15 Thread Phillip Wood
From: Phillip Wood If a merge command in the todo list specifies just a branch to merge with no -C/-c argument then item->commit is NULL. This means that if there are merge conflicts error_with_patch() is passed a NULL commit which causes a segmentation fault when make_patch() tries to look

[PATCH 0/2] rebase -i: fix SIGSEGV when 'merge ' fails

2018-08-15 Thread Phillip Wood
From: Phillip Wood As they fix a bug these patches are based on maint. Unfortunately the second patch has semantic conflicts with master s/git_path_merge_msg()/git_path_merge_msg(the_repository)/ There are additional textual conflicts with pu/next due to some messages being marked for

[PATCH 1/2] t3430: add conflicting commit

2018-08-15 Thread Phillip Wood
From: Phillip Wood Move the creation of conflicting-G from a test to the setup so that it can be used in subsequent tests without creating the kind of implicit dependencies that plague t3404. While we're at it simplify the arguments to the test_commit() call the creates the conflicting c

[PATCH] rebase -i: fix numbering in squash message

2018-08-15 Thread Phillip Wood
From: Phillip Wood Commit e12a7ef597 ("rebase -i: Handle "combination of commits" with GETTEXT_POISON", 2018-04-27) changed the way that individual commit messages are labelled when squashing commits together. In doing so a regression was introduced where the numbering of th

Re: [PATCH] rebase -i: fix numbering in squash message

2018-08-15 Thread Phillip Wood
Hi Junio On 15/08/2018 19:05, Junio C Hamano wrote: > > Phillip Wood writes: > >> From: Phillip Wood >> >> Commit e12a7ef597 ("rebase -i: Handle "combination of commits" with >> GETTEXT_POISON", 2018-04-27) changed the way that indi

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

2018-08-17 Thread Phillip Wood
Hi Alban The interdiff from v5 to v6 looks good, I think the changes you have made the the other patches in this series are fine, I've just got a couple of small comments below about this one. Best Wishes Phillip On 10/08/2018 17:51, Alban Gruin wrote: > > This rewrites complete_action() from

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

2018-08-17 Thread Phillip Wood
On 10/08/2018 17:51, Alban Gruin wrote: > This rewrites write_basic_state() from git-rebase.sh in C. This is the > first step in the conversion of init_basic_state(), hence the mode in > rebase--helper.c is called INIT_BASIC_STATE. init_basic_state() will be > converted in the next commit. > > T

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

2018-08-20 Thread Phillip Wood
On 17/08/2018 23:44, Junio C Hamano wrote: > Here are the topics that have been cooking. Commits prefixed with > '-' are only in 'pu' (proposed updates) while commits prefixed with > '+' are in 'next'. The ones marked with '.' do not appear in any of > the integration branches, but I am still hol

Re: Do not raise conflict when a code in a patch was already added

2018-08-20 Thread Phillip Wood
On 20/08/2018 11:22, Konstantin Kharlamov wrote: > So, steps-to-reproduce below rather full of trivia like setting up a > repo, but the TL;DR is: > > Upon using `git rebase -i HEAD~1` and then `git add -p` to add part of a > "hunk" as one commit, and then using `git rebase --continue` so the > oth

Re: Would a config var for --force-with-lease be useful?

2018-08-28 Thread Phillip Wood
Hi Johannes On 27/08/18 22:21, Johannes Schindelin wrote: Hi, On Sat, 25 Aug 2018, Constantin Weißer wrote: I think there are two aspects to using "force with lease". There is a third, very, very important aspect. When you use --force-with-lease (and I, for one, do, all the time), keep in

Re: [PATCH] add -p: coalesce hunks before testing applicability

2018-08-30 Thread Phillip Wood
Dear Jochen/Junio On 28/08/18 19:07, Junio C Hamano wrote: Jochen Sprickerhof writes: When a hunk was split before being edited manually, it does not apply anymore cleanly. Apply coalesce_overlapping_hunks() first to make it work. Enable test for it as well. Signed-off-by: Jochen Sprickerhof

Re: [GSoC][PATCHl 3/6] rebase -i: support --committer-date-is-author-date

2019-08-08 Thread Phillip Wood
Hi Rohit On 06/08/2019 18:36, Rohit Ashiwal wrote: rebase am already has this flag to "lie" about the committer date by changing it to the author date. Let's add the same for interactive machinery. Signed-off-by: Rohit Ashiwal --- Documentation/git-rebase.txt| 8 +++- builtin/r

Re: [GSoC][PATCHl 4/6] sequencer: rename amend_author to author_to_rename

2019-08-08 Thread Phillip Wood
Hi Rohit On 06/08/2019 18:36, Rohit Ashiwal wrote: The purpose of amend_author was to free() the malloc()'d string obtained from get_author(). But the name does not actually convey this purpose. Rename it to something meaningful. The name was intended to covey that it was only used when amendi

Re: [GSoC][PATCHl 6/6] rebase: add --author-date-is-committer-date

2019-08-08 Thread Phillip Wood
Hi Rohit On 06/08/2019 18:36, Rohit Ashiwal wrote: The previous commit introduced --ignore-date flag to interactive rebase, but the name is actually very vague in context of rebase -i since there are two dates we can work with. Add an alias to convey the precise purpose. That's an excellent id

Re: [GSoC][PATCHl 5/6] rebase -i: support --ignore-date

2019-08-08 Thread Phillip Wood
On 06/08/2019 18:36, Rohit Ashiwal wrote: rebase am already has this flag to "lie" about the author date by changing it to the committer (current) date. Let's add the same for interactive machinery. Signed-off-by: Rohit Ashiwal --- Documentation/git-rebase.txt| 6 ++-- builti

Re: [GSoC][PATCHl 1/6] rebase -i: add --ignore-whitespace flag

2019-08-08 Thread Phillip Wood
Hi Rohit On 06/08/2019 18:36, Rohit Ashiwal wrote: There are two backends available for rebasing, viz, the am and the interactive. Naturally, there shall be some features that are implemented in one but not in the other. One such flag is --ignore-whitespace which indicates merge mechanism to tre

Re: [GSoC][PATCHl 5/6] rebase -i: support --ignore-date

2019-08-08 Thread Phillip Wood
On 08/08/2019 12:42, Phillip Wood wrote: On 06/08/2019 18:36, Rohit Ashiwal wrote: rebase am already has this flag to "lie" about the author date by changing it to the committer (current) date. Let's add the same for interactive machinery. Signed-off-by: Rohit Ashiwal --- >

Re: Incorrect behavior from git checkout --patch

2019-08-11 Thread Phillip Wood
Hi Dave Thanks for the bug report. I've tried to reproduce it on the latest master, version 2.22.0 and 2.20.1 and am unable to do so. I thought it might be related to a bug I recently fixed[1] but it does not appear to be. I've appended the files I used below just in case I made a mistake tra

Re: Incorrect behavior from git checkout --patch

2019-08-11 Thread Phillip Wood
Hi Dave On 11/08/2019 10:54, Phillip Wood wrote: Hi Dave Thanks for the bug report. I've tried to reproduce it on the latest master, version 2.22.0 and 2.20.1 and am unable to do so. Doh, I was doing 'git checkout -p HEAD', when I checkout from the index I can reproduce th

Re: minor interactive rebase regression: HEAD points to wrong commit while rewording

2019-08-12 Thread Phillip Wood
On 12/08/2019 18:50, SZEDER Gábor wrote: When running interactive rebase to reword a commit message, I would expect that the commit whose message I'm rewording is checked out. This is not quite the case when rewording multiple subsequent commit messages. Let's start with four commits, and start

Re: [GSoC][PATCH v2 3/6] rebase -i: support --committer-date-is-author-date

2019-08-13 Thread Phillip Wood
Hi Rohit This is looking good, I think it is almost there now On 12/08/2019 20:42, Rohit Ashiwal wrote: rebase am already has this flag to "lie" about the committer date by changing it to the author date. Let's add the same for interactive machinery. Signed-off-by: Rohit Ashiwal --- Documen

Re: [GSoC][PATCH v2 1/6] rebase -i: add --ignore-whitespace flag

2019-08-13 Thread Phillip Wood
Hi Rohit Thanks for the re-roll On 12/08/2019 20:42, Rohit Ashiwal wrote: There are two backends available for rebasing, viz, the am and the interactive. Naturally, there shall be some features that are implemented in one but not in the other. One such flag is --ignore-whitespace which indicate

Re: [GSoC][PATCH v2 3/6] rebase -i: support --committer-date-is-author-date

2019-08-13 Thread Phillip Wood
On 13/08/2019 11:38, Phillip Wood wrote: Hi Rohit [...] @@ -964,6 +976,25 @@ static int run_git_commit(struct repository *r,   {   struct child_process cmd = CHILD_PROCESS_INIT; +    if (opts->committer_date_is_author_date) { +    size_t len; +    int res = -1; +    str

Re: [GSoC][PATCH v2 5/6] rebase -i: support --ignore-date

2019-08-13 Thread Phillip Wood
Hi Rohit This is looking better - there are a couple of memory management issues and minor nit-picks but apart from that it looks good. On 12/08/2019 20:42, Rohit Ashiwal wrote: rebase am already has this flag to "lie" about the author date by changing it to the committer (current) date. Let'

Re: [GSoC][PATCH v2 4/6] sequencer: rename amend_author to author_to_rename

2019-08-13 Thread Phillip Wood
Hi Rohit On 12/08/2019 20:42, Rohit Ashiwal wrote: The purpose of amend_author was to free() the malloc()'d string obtained from get_author() while amending a commit. But we can also use the variable to free() the author at our convenience. Rename it to convey this meaning. Thanks for rewordin

Re: [GSoC][PATCH v2 3/6] rebase -i: support --committer-date-is-author-date

2019-08-13 Thread Phillip Wood
On 12/08/2019 20:42, Rohit Ashiwal wrote: rebase am already has this flag to "lie" about the committer date by changing it to the author date. Let's add the same for interactive machinery. Signed-off-by: Rohit Ashiwal --- Documentation/git-rebase.txt| 8 +++- builtin/rebase.c

Re: [GSoC][PATCH v2 3/6] rebase -i: support --committer-date-is-author-date

2019-08-14 Thread Phillip Wood
On 13/08/2019 18:06, Junio C Hamano wrote: Phillip Wood writes: [...] + + strbuf_addf(&date, "@%s",ident.date_begin); I think we should use %s.* and ident.date_end to be sure we getting what we want. Your version is OK if the author is formatted correctly but I&

Re: [GSoC][PATCH v2 5/6] rebase -i: support --ignore-date

2019-08-14 Thread Phillip Wood
Hi Junio & Rohit On 13/08/2019 18:21, Junio C Hamano wrote: Phillip Wood writes: +static void push_dates(struct child_process *child) +{ + time_t now = time(NULL); + struct strbuf date = STRBUF_INIT; + + strbuf_addf(&date, "@%"PRIuM

Re: [GSoC][PATCH v2 5/6] rebase -i: support --ignore-date

2019-08-14 Thread Phillip Wood
On 13/08/2019 22:45, Junio C Hamano wrote: Rohit Ashiwal writes: --ignore-date:: - This flag is passed to 'git am' to change the author date - of the rebased commits (see linkgit:git-am[1]). + Instead of using the given author date, re-set it to the value + same as co

Re: minor interactive rebase regression: HEAD points to wrong commit while rewording

2019-08-15 Thread Phillip Wood
On 14/08/2019 22:20, SZEDER Gábor wrote: On Mon, Aug 12, 2019 at 09:28:52PM +0100, Phillip Wood wrote: Save the updated commit message, and after the editor opens up the third commit's log message, check again where HEAD is pointing to now: ~/tmp/reword (master +|REBASE-i 2/3)$ hea

Re: [GSoC][PATCH v2 5/6] rebase -i: support --ignore-date

2019-08-17 Thread Phillip Wood
On 14/08/2019 20:33, Junio C Hamano wrote: Phillip Wood writes: That's an important distinction, particularly if GIT_COMMITTER_DATE is set in the environment - are we aiming to have the author and committer dates match or are we just resetting the author date to now? Rohit - do you know

Re: [PATCH 0/2] git rebase: Make sure upstream branch is left alone.

2019-08-19 Thread Phillip Wood
Hi Ben On 18/08/2019 10:53, Ben Wijen wrote: I found an issue with git rebase --autostash with an dirty worktree/index. It seems the currently active branch is moved, which is not correct. I'm not sure I understand what you mean by "the currently active branch is moved". 'git rebase --auto

Re: [PATCH v4 2/2] apply: reload .gitattributes after patching it

2019-08-19 Thread Phillip Wood
Hi Brian On 18/08/2019 19:44, brian m. carlson wrote: When applying multiple patches with git am, or when rebasing using the am backend, it's possible that one of our patches has updated a gitattributes file. Currently, we cache this information, so if a file in a subsequent patch has attributes

Re: [PATCH v4 2/2] apply: reload .gitattributes after patching it

2019-08-19 Thread Phillip Wood
On 19/08/2019 10:41, Phillip Wood wrote: [...] diff --git a/convert.c b/convert.c index 94ff837649..030e9b81b9 100644 --- a/convert.c +++ b/convert.c @@ -1293,10 +1293,11 @@ struct conv_attrs {   const char *working_tree_encoding; /* Supported encoding or default encoding if NULL

Re: [PATCH v4 2/2] apply: reload .gitattributes after patching it

2019-08-20 Thread Phillip Wood
Hi Brian On 20/08/2019 03:45, brian m. carlson wrote: On 2019-08-19 at 09:41:42, Phillip Wood wrote: Hi Brian On 18/08/2019 19:44, brian m. carlson wrote: When applying multiple patches with git am, or when rebasing using the am backend, it's possible that one of our patches has upda

Re: [PATCH v4 2/2] apply: reload .gitattributes after patching it

2019-08-20 Thread Phillip Wood
On 20/08/2019 04:05, brian m. carlson wrote: On 2019-08-19 at 09:55:27, Phillip Wood wrote: On 19/08/2019 10:41, Phillip Wood wrote: [...] diff --git a/convert.c b/convert.c index 94ff837649..030e9b81b9 100644 --- a/convert.c +++ b/convert.c @@ -1293,10 +1293,11 @@ struct conv_attrs

Re: [PATCH 1/2] t3420: never change upstream branch

2019-08-20 Thread Phillip Wood
Hi Ben On 18/08/2019 10:53, Ben Wijen wrote: When using `git rebase --autostash ` and the workarea is dirty, the active branch is incorrectly reset to the rebase branch. This test will check for such behavior. Signed-off-by: Ben Wijen --- t/t3420-rebase-autostash.sh | 9 + 1 file

Re: [PATCH 2/2] rebase.c: make sure current branch isn't moved when autostashing

2019-08-20 Thread Phillip Wood
Hi Ben I need to have a longer look at this (I don't understand why we're calling reset --hard after we've stashed the changes) but I notice that the test lines you're changing predate the switch to the builtin rebase so those changes are not related to the branch switching problem. Best Wis

Re: [PATCH v3 3/6] rebase -i: support --committer-date-is-author-date

2019-08-20 Thread Phillip Wood
Hi Rohit One thing that struck we was that we should support this with rebase -r which means setting GIT_COMMITTER_DATE when we fork 'git merge'. I've got a couple of other comments below On 20/08/2019 04:45, Rohit Ashiwal wrote: rebase am already has this flag to "lie" about the committer d

Re: [PATCH v3 5/6] rebase -i: support --ignore-date

2019-08-20 Thread Phillip Wood
Hi Rohit On 20/08/2019 04:45, Rohit Ashiwal wrote: rebase am already has this flag to "lie" about the author date by changing it to the committer (current) date. Let's add the same for interactive machinery. Signed-off-by: Rohit Ashiwal --- Documentation/git-rebase.txt| 6 +--

Re: [PATCH v3 0/6] rebase -i: support more options

2019-08-20 Thread Phillip Wood
Hi Rohit On 20/08/2019 04:45, Rohit Ashiwal wrote: I've tries to incorporated all the suggestions. It is helpful if you can list the changes to remind us all what we said. (as a patch author I find composing that is helpful to remind me if there's anything I've forgotten to address) Also t

Re: [PATCH v3 5/6] rebase -i: support --ignore-date

2019-08-20 Thread Phillip Wood
On 20/08/2019 18:42, Junio C Hamano wrote: Rohit Ashiwal writes: +/* Construct a free()able author string with current time as the author date */ +static char *ignore_author_date(const char *author) +{ + int len = strlen(author); Mental note: ignore_author_date() would not allow author

Re: [PATCH v4 2/2] apply: reload .gitattributes after patching it

2019-08-20 Thread Phillip Wood
On 20/08/2019 19:24, Junio C Hamano wrote: Phillip Wood writes: Do you know why -m and -i aren't affected? I had to look, but I believe the answer is because they use the sequencer, and the sequencer calls git merge-recursive as a separate process, and so the writing of the tree is

Re: [PATCH v3 0/6] rebase -i: support more options

2019-08-20 Thread Phillip Wood
On 20/08/2019 18:53, Junio C Hamano wrote: Phillip Wood writes: Hi Rohit On 20/08/2019 04:45, Rohit Ashiwal wrote: I've tries to incorporated all the suggestions. It is helpful if you can list the changes to remind us all what we said. (as a patch author I find composing that is he

Re: [PATCH v3 1/6] rebase -i: add --ignore-whitespace flag

2019-08-20 Thread Phillip Wood
Hi Rohit On 20/08/2019 04:45, Rohit Ashiwal wrote: There are two backends available for rebasing, viz, the am and the interactive. Naturally, there shall be some features that are implemented in one but not in the other. One such flag is --ignore-whitespace which indicates merge mechanism to tre

Re: [PATCH 3/3] sequencer: simplify root commit creation

2019-08-22 Thread Phillip Wood
On 19/08/2019 17:09, Eric Sunshine wrote: On Mon, Aug 19, 2019 at 5:18 AM Phillip Wood via GitGitGadget wrote: Adapt try_to_commit() to create a new root commit rather than special casing this in run_git_commit(). The significantly reduces the amount of s/The/This/ Thanks Eric - well

Re: [PATCH v4 2/2] apply: reload .gitattributes after patching it

2019-08-26 Thread Phillip Wood
On 20/08/2019 19:32, Phillip Wood wrote: On 20/08/2019 19:24, Junio C Hamano wrote: Phillip Wood writes: Do you know why -m and -i aren't affected? I had to look, but I believe the answer is because they use the sequencer, and the sequencer calls git merge-recursive as a separate pr

Re: [PATCH v5 0/2] Honor .gitattributes with rebase --am

2019-08-26 Thread Phillip Wood
Hi Brian On 26/08/2019 00:33, brian m. carlson wrote: This series makes rebase --am honor the .gitattributes file for subsequent patches when a patch changes it. Note that there are two places we load attributes in ll-merge.c, but this code only handles the one that git am uses. The two cannot

Re: [PATCH 04/11] hashmap_entry: detect improper initialization

2019-08-28 Thread Phillip Wood
Hi Eric On 27/08/2019 10:49, Eric Wong wrote: Johannes Schindelin wrote: Hi Eric, On Mon, 26 Aug 2019, Eric Wong wrote: By renaming the "hash" field to "_hash", it's easy to spot improper initialization of hashmap_entry structs which can leave "hashmap_entry.next" uninitialized. Would you

Re: [PATCH 10/11] introduce container_of macro

2019-08-28 Thread Phillip Wood
On 27/08/2019 15:49, Derrick Stolee wrote: On 8/25/2019 10:43 PM, Eric Wong wrote: This macro is popular within the Linux kernel for supporting intrusive data structures such as linked lists, red-black trees, and chained hash tables while allowing the compiler to do type checking. I intend to u

Re: error: cannot cherry-pick during a revert

2019-08-29 Thread Phillip Wood
Hi Mike On 29/08/2019 00:25, Mike Hommey wrote: Hi, This just happened to me while cherry-pick'ing: $ git cherry-pick HEAD@{1} error: could not apply 614fe5e629b84... try hint: after resolving the conflicts, mark the corrected paths hint: with 'git add ' or 'git rm ' hint: and commit the resul

Re: [PATCH 1/1] checkout: add simple check for 'git checkout -b'

2019-08-29 Thread Phillip Wood
Hi Stolee On 29/08/2019 18:01, Derrick Stolee via GitGitGadget wrote: From: Derrick Stolee The 'git switch' command was created to separate half of the behavior of 'git checkout'. It specifically has the mode to do nothing with the index and working directory if the user only specifies to crea

Re: git-diff passes : args to GIT_EXTERNAL_DIFF incorrectly?

2019-08-30 Thread Phillip Wood
Hi Dmitry On 29/08/2019 15:36, Dmitry Nikulin wrote: Thank you for the reply. [...] However, for the original repository where I first faced this problem (https://github.com/yandexdataschool/Practical_RL), Git passes a very weird set of args to the external diff: $ env GIT_EXTERNAL_DIFF=./print

Re: git-diff passes : args to GIT_EXTERNAL_DIFF incorrectly?

2019-08-30 Thread Phillip Wood
On 30/08/2019 14:23, Dmitry Nikulin wrote: On Fri, 30 Aug 2019 at 13:16, Phillip Wood wrote: I'm not sure why the last argument is being split in your example. It is not split in the example below I have replicated the splitting issue on my small demo repo [1]: $ env GIT_EXTERNAL

Re: [PATCH 1/1] rebase -r: let `label` generate safer labels

2019-09-02 Thread Phillip Wood
Hi Matt This is definitely worth fixing, I've got a couple of comments below On 02/09/2019 15:01, Matt R via GitGitGadget wrote: From: Matt R The `label` todo command in interactive rebases creates temporary refs in the `refs/rewritten/` namespace. These refs are stored as loose refs, i.e. as

Re: [PATCH] rebase: introduce --update-branches option

2019-09-03 Thread Phillip Wood
Hi Warren On 03/09/2019 00:41, Warren He wrote: Sometimes people have to rebase multiple related branches. One way to do that quickly, when there are branches pointing to ancestors of a later branch (which happens a lot if you try hard to pad your PR count on GitHub--I mean if you try to make sm

Re: [PATCH v2] rebase: introduce --update-branches option

2019-09-09 Thread Phillip Wood
Hi Warren On 08/09/2019 00:44, Warren He wrote: Everyone in this thread, thanks for your support and encouragement. [...] It should not really imply `--interactive`, but `--rebase-merges`. `imply_interactive` doesn't fully switch on `--interactive`, i.e., causing the editor to open. It only s

Re: [PATCH v4 0/6] rebase -i: support more options

2019-09-09 Thread Phillip Wood
On 09/09/2019 19:02, Junio C Hamano wrote: Rohit Ashiwal writes: Following the suggestion of Phillip I've rebased my patch on master (745f681289) and cherry-picking b0a3186140. Sorry, but that's horrible. The latter does not even cleanly apply on the former. Yes I had assumed that the che

Re: [PATCH] name-rev: avoid cutoff timestamp underflow

2019-09-22 Thread Phillip Wood
Hi Gábor On 22/09/2019 19:01, SZEDER Gábor wrote: When 'git name-rev' is invoked with commit-ish parameters, it tries to save some work, and doesn't visit commits older than the committer date of the oldest given commit minus a one day worth of slop. Since our 'timestamp_t' is an unsigned type,

<    1   2   3   4   5   6   7   8   9   10   >