Re: [RFC PATCH 0/5] Add option to autostage changes when continuing a rebase

2017-07-27 Thread Phillip Wood
On 27/07/17 11:36, Phillip Wood wrote: On 26/07/17 23:12, Junio C Hamano wrote: Junio C Hamano <gits...@pobox.com> writes: Hmph, this is interesting. "git rebase" does take "--rerere-autoupdate" option from the command line, and propagates it to a later invoca

Re: [RFC PATCH 0/5] Add option to autostage changes when continuing a rebase

2017-07-27 Thread Phillip Wood
On 26/07/17 23:12, Junio C Hamano wrote: > Junio C Hamano writes: > >> Hmph, this is interesting. >> >> "git rebase" does take "--rerere-autoupdate" option from the command >> line, and propagates it to a later invocation of "rebase --continue" >> by storing the value to

Re: [PATCH/RFC] rebase: make resolve message clearer for inexperienced users

2017-07-26 Thread Phillip Wood
On 24/07/17 21:53, Junio C Hamano wrote: Phillip Wood <phillip.w...@talktalk.net> writes: git rebase --continue requiring one to git add first confuses/annoys me too. I started a patch to autostage unstaged changes if they don't contain conflict markers a couple of weeks ago, I'll clean

[RFC PATCH 0/5] Add option to autostage changes when continuing a rebase

2017-07-26 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> These patches add an '--autostage' option (and corresponding config variable) to 'rebase --continue' that will stage any unstaged changes before continuing. This saves the user having to type 'git add' before running 'git rebase --co

[RFC PATCH 5/5] Add rebase.continue.autostage config setting

2017-07-26 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> This enables the user to always specify --autostage with --continue The tests check that setting rebase.continue.autostage=true results in 'git rebase --continue' autostaging unstaged changes and that '--no-autostage' overrides it. Sign

[RFC PATCH 4/5] Add tests for rebase --continue --autostage

2017-07-26 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Make sure that --autostage stages any changes and fails if there are merge markers in the file to be staged. Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- t/t3418-rebase-continue.sh | 35 +++

[RFC PATCH 2/5] rebase -i: improve --continue --autostage

2017-07-26 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> If HEAD has changed since the rebase stopped or rebase stopped due to a failed exec then 'git rebase --continue --autostage' will autostage changes that cannot be commited. Fix this by reordering some of the checks so that 'git rebase --co

[RFC PATCH 1/5] rebase --continue: add --autostage to stage unstaged changes

2017-07-26 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> After resolving conflicts during a rebase it is a pain to have to run 'git add' before 'git rebase --continue'. Passing --autostage to 'git rebase --continue' will stage them automatically so long as 'git diff --check' says they

[RFC PATCH 3/5] Unify rebase amend message when HEAD has changed

2017-07-26 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> If rebase --interactive is unable to commit staged changes because HEAD has changed since rebase stopped the user gets different messages depending on whether they specified --autostage or not. Update the messages in the other code paths to

Re: [PATCH/RFC] rebase: make resolve message clearer for inexperienced users

2017-07-24 Thread Phillip Wood
On 16/07/17 12:39, Philip Oakley wrote: > > From: "Junio C Hamano" > Sent: Wednesday, July 12, 2017 10:29 PM >> William Duclot writes: >> - The original said "When you have resolved this problem", without giving a guidance how to

Re: [PATCH 0/5] Move unquote_path() from git-add--interactive.perl to Git.pm

2017-06-30 Thread Phillip Wood
On 23/06/17 00:18, Jeff King wrote: > On Thu, Jun 22, 2017 at 11:26:17AM +0100, Phillip Wood wrote: > >> From: Phillip Wood <phillip.w...@dunelm.org.uk> >> >> I'm using this in some scripts and it would be more convenient to have >> it available from Git.pm rat

[PATCH 0/4] Move unquote_path from git-add--interactive.perl to Git.pm

2017-06-30 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Thanks for the review Junio, I've amended the patches as you suggested. The first patch now removes unquote_path() from add -i as well as adding it to Git.pm. I've fixed the naming issues (the version I sent previously was copied from a

[PATCH 2/4] Git::unquote_path() Handle '\a'

2017-06-30 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> The version copied from git-add--interactive did not handle quoted paths containing '\a'. Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- perl/Git.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p

[PATCH 4/4] Add tests for Git::unquote_path()

2017-06-30 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check that unquote_path() handles spaces and escape sequences properly Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- t/t9700/test.pl | 7 +++ 1 file changed, 7 insertions(+) diff --git a/t/t9700/test.pl b/t/t9700/t

[PATCH 3/4] Git::unquote_path() throw an exception on bad path

2017-06-30 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> This is what the other routines in Git.pm do if there's an error. Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- perl/Git.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl/Git.pm b/perl/

[PATCH 1/4] add -i move unquote_path() to Git.pm

2017-06-30 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Move unquote_path() from git-add--interactive to Git.pm so it can be used by other scripts. Note this is a straight copy, it does not handle '\a'. That will be fixed in the next commit. Signed-off-by: Phillip Wood <phillip.w...@dune

Re: [PATCH v3 0/4] Add regression tests for recent rebase -i fixes

2017-06-26 Thread Phillip Wood
On 23/06/17 20:01, Junio C Hamano wrote: > Junio C Hamano writes: > >> For 3420, I can wrap the two-liner patch I showed here earlier into >> a commit on top of the series. > > So, here is what I'll queue on top before merging the topic down to > 'master'. Thanks for

Re: [PATCH v3 0/4] Add regression tests for recent rebase -i fixes

2017-06-26 Thread Phillip Wood
On 23/06/17 19:53, Junio C Hamano wrote: > Junio C Hamano writes: > >> 3404 needs a similar fix-up for the series to be able to stand on >> its own. Alternatively, at least we need to understand what in 'pu' >> makes the result of the merge pass---the symptom indicates that

Re: [PATCH v3 0/4] Add regression tests for recent rebase -i fixes

2017-06-23 Thread Phillip Wood
On 23/06/17 06:07, Junio C Hamano wrote: > Junio C Hamano writes: > >>> git-rebase.sh | 4 +- >>> sequencer.c | 11 ++-- >>> t/t3404-rebase-interactive.sh | 7 +++ >>> t/t3420-rebase-autostash.sh | 136 >>>

[PATCH 1/5] Git.pm Add unquote_path()

2017-06-22 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Add unquote_path() from git-add--interactive so it can be used by other scripts. Note this is a straight copy, it does not handle '\a'. That will be fixed in the next commit Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> ---

[PATCH 0/5] Move unquote_path() from git-add--interactive.perl to Git.pm

2017-06-22 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> I'm using this in some scripts and it would be more convenient to have it available from Git.pm rather than copying and pasting it each time I need it. I think it should be useful to other people using Git.pm as well. It is not uncommon

[PATCH 4/5] Add tests for Git::unquote_path()

2017-06-22 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check that unquote_path() handles spaces and escape sequences properly Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- t/t9700/test.pl | 7 +++ 1 file changed, 7 insertions(+) diff --git a/t/t9700/test.pl b/t/t9700/t

[PATCH 2/5] Git::unquote_path() Handle '\a'

2017-06-22 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> The version copied from git-add--interactive did not handle quoted paths containing '\a'. Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- perl/Git.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p

[PATCH 5/5] git-add--interactive.perl: Use unquote_path() from Git.pm

2017-06-22 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Not that we've copied unquote_path() to Git.pm use that copy instead of our own. Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- git-add--interactive.perl | 43 +-- 1 file changed,

[PATCH 3/5] Git::unquote_path() throw an exception on bad path

2017-06-22 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> This is what the other routines in Git.pm do if there's an error. Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- perl/Git.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl/Git.pm b/perl/

[PATCH v3 4/4] rebase: Add more regression tests for console output

2017-06-19 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check the console output when using --autostash and the stash does not apply is what we expect. The test is quite strict but should catch any changes to the console output from the various rebase flavors. Thanks-to: Johannes Schi

[PATCH v3 2/4] rebase -i: Add test for reflog message

2017-06-19 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check that the reflog message written to the branch reflog when the rebase is completed is correct Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- t/t3404-rebase-interactive.sh | 7 +++ 1 file changed, 7 insertions(+)

[PATCH v3 3/4] rebase: Add regression tests for console output

2017-06-19 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check the console output when using --autostash and the stash applies cleanly is what we expect. The test is quite strict but should catch any changes to the console output from the various rebase flavors. Thanks-to: Johannes Schi

[PATCH v3 1/4] sequencer: print autostash messages to stderr

2017-06-19 Thread Phillip Wood
parts of the interactive rebase in the sequencer the autostash messages are printed to stdout instead. It is time to fix that: let's print the autostash messages to stderr instead of stdout. Signed-off-by: Johannes Schindelin <johannes.schinde...@gmx.de> Signed-off-by: Phillip Wood <phillip.w..

[PATCH v3 0/4] Add regression tests for recent rebase -i fixes

2017-06-19 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> I've updated the second two tests to be portable using q_to_cr() as Johannes suggested and added his patch to fix the autostash messages going to stdout rather than stderr. The reflog message test is unchanged. Thanks to Johannes for hi

Re: [PATCH v2 0/3] Add regression tests for rectent rebase -i fixes

2017-06-19 Thread Phillip Wood
On 16/06/17 00:29, Junio C Hamano wrote: > Junio C Hamano <gits...@pobox.com> writes: > >> Junio C Hamano <gits...@pobox.com> writes: >> >>> Phillip Wood <phillip.w...@talktalk.net> writes: >>> >>>> From: Phillip Wood <ph

Re: [PATCH v2 0/3] Add regression tests for rectent rebase -i fixes

2017-06-19 Thread Phillip Wood
On 16/06/17 14:49, Johannes Schindelin wrote: > Hi Junio, > > On Thu, 15 Jun 2017, Junio C Hamano wrote: > >> diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh >> index 325ec75353..801bce25da 100755 >> --- a/t/t3420-rebase-autostash.sh >> +++ b/t/t3420-rebase-autostash.sh >>

[PATCH v2 0/3] Add regression tests for rectent rebase -i fixes

2017-06-14 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> I've revised the second two tests as Johannes suggested to drop the sed script. The first one is unchanged. Phillip Wood (3): rebase -i: Add test for reflog message rebase: Add regression tests for console output rebase: Add more regr

[PATCH v2 2/3] rebase: Add regression tests for console output

2017-06-14 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check the console output when using --autostash and the stash applies cleanly is what we expect. The test is quite strict but should catch any changes to the console output from the various rebase flavors. Thanks-to: Johannes Schi

[PATCH v2 1/3] rebase -i: Add test for reflog message

2017-06-14 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check that the reflog message written to the branch reflog when the rebase is completed is correct Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- t/t3404-rebase-interactive.sh | 7 +++ 1 file changed, 7 insertions(+)

[PATCH v2 3/3] rebase: Add more regression tests for console output

2017-06-14 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check the console output when using --autostash and the stash does not apply is what we expect. The test is quite strict but should catch any changes to the console output from the various rebase flavors. Thanks-to: Johannes Schi

Re: [PATCH 2/3] rebase: Add tests for console output

2017-06-14 Thread Phillip Wood
On 09/06/17 17:39, Junio C Hamano wrote: > Phillip Wood <phillip.w...@talktalk.net> writes: > >> I'm confused by this as my script does not use the escape sequence "\r" >> out of portability concerns. It has a literal carriage return as you get >> from typi

Re: [PATCH 2/3] rebase: Add tests for console output

2017-06-07 Thread Phillip Wood
Hi Johannes Thanks for your feedback On 01/06/17 13:56, Johannes Schindelin wrote: > Hi Phillip, > > On Wed, 31 May 2017, Phillip Wood wrote: > >> From: Phillip Wood <phillip.w...@dunelm.org.uk> >> >> Check the console output when using --autostash and the

Re: [PATCH 2/3] rebase: Add tests for console output

2017-05-31 Thread Phillip Wood
On 31/05/17 11:42, Phillip Wood wrote: From: Phillip Wood <phillip.w...@dunelm.org.uk> Check the console output when using --autostash and the stash applies cleanly is what we expect. To avoid this test depending on commit and stash hashes it uses sed to replace them with XXX. The sed

[PATCH 3/3] rebase: Add tests for console output with conflicting stash

2017-05-31 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check that the console output is what we expect when restoring autostashed changes fails. Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> --- t/t3420-rebase-autostash.sh | 10 +- t/t3420/expected-fail-am

[PATCH 2/3] rebase: Add tests for console output

2017-05-31 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check the console output when using --autostash and the stash applies cleanly is what we expect. To avoid this test depending on commit and stash hashes it uses sed to replace them with XXX. The sed script also replaces carriage r

[PATCH 1/3] rebase -i: Add test for reflog message

2017-05-31 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> Check that the reflog message written to the branch reflog when the rebase is completed is correct. This checks for regressions for the fix in commit 4ab867b8fc rebase -i: fix reflog message Signed-off-by: Phillip Wood <phillip.w...@dune

[PATCH 0/3] Add regression tests for recent rebase -i fixes

2017-05-31 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> These patches add some tests for the fixes I sent the week before last. The output tests check the messages for stashes that apply and fail for all three variants of rebase. They are quite strict but I couldn't think of a better way to

Re: [PATCH] rebase -i: Add missing newline to end of message

2017-05-19 Thread Phillip Wood
On 19/05/17 12:24, Ævar Arnfjörð Bjarmason wrote: On Fri, May 19, 2017 at 12:13 PM, Phillip Wood <phillip.w...@talktalk.net> wrote: On 18/05/17 22:21, Johannes Schindelin wrote: Hi Phillip, On Thu, 18 May 2017, Phillip Wood wrote: From: Phillip Wood <phillip.w...@dunelm.org.uk>

[PATCH v2] rebase -i: Add missing newline to end of message

2017-05-19 Thread phillip . wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> The message that's printed when auto-stashed changes are successfully restored was missing '\n' at the end. Signed-off-by: Phillip Wood <phillip.w...@dunelm.org.uk> Acked-by: Johannes Schindelin <johannes.schinde...@gmx.de> ---

Re: [PATCH] rebase -i: Add missing newline to end of message

2017-05-19 Thread Phillip Wood
On 18/05/17 22:21, Johannes Schindelin wrote: > Hi Phillip, > > On Thu, 18 May 2017, Phillip Wood wrote: > >> From: Phillip Wood <phillip.w...@dunelm.org.uk> >> >> The message that's printed when auto-stashed changes are successfully >> restored was m

Re: [PATCH] rebase -i: Add missing newline to end of message

2017-05-18 Thread Phillip Wood
On 18/05/17 14:48, Ævar Arnfjörð Bjarmason wrote: On Thu, May 18, 2017 at 3:41 PM, Phillip Wood <phillip.w...@talktalk.net> wrote: From: Phillip Wood <phillip.w...@dunelm.org.uk> The message that's printed when auto-stashed changes are successfully restored was missing '\n' at the

Re: [PATCH 2/2] rebase -i: silence stash apply

2017-05-18 Thread Phillip Wood
Hi Johannes Thanks for your reply On 18/05/17 11:49, Johannes Schindelin wrote: Hi Phillip, On Thu, 18 May 2017, Phillip Wood wrote: diff --git a/sequencer.c b/sequencer.c index f8bc18badf1a3fb1b39656501c5a316e229968d2..311728a145dfc66e230334221a2610468239932d 100644 --- a/sequencer.c

[PATCH] rebase -i: Add missing newline to end of message

2017-05-18 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> The message that's printed when auto-stashed changes are successfully restored was missing '\n' at the end. --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer.c b/sequencer.c index 311728a14..4dc

[PATCH 2/2] rebase -i: silence stash apply

2017-05-18 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> The shell version of rebase -i silences the status output from 'git stash apply' when restoring the autostashed changes. The C version does not. Having the output from git stash apply on the screen is distracting as it makes it difficult t

[PATCH 0/2] Fix a couple of minor rebase -i regressions

2017-05-18 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> These patches fix a regression in the reflog message written when rebase -i finishes and supresses the status output from applying any autostashed changes to match the shell version of rebase -i. Phillip Wood (2): rebase -i: fix reflog m

[PATCH 1/2] rebase -i: fix reflog message

2017-05-18 Thread Phillip Wood
From: Phillip Wood <phillip.w...@dunelm.org.uk> When rebase -i was converted to C a bug was introduced into the code that creates the reflog message. Instead of saying rebase -i (finish): onto it says rebase -i (finish): onto as the strbuf is not reset between reading the

Re: [PATCH v3 1/9] rebase -i: generate the script via rebase--helper

2017-05-01 Thread Phillip Wood
On 28/04/17 20:22, Johannes Schindelin wrote: > Hi Philip, > > On Fri, 28 Apr 2017, Phillip Wood wrote: > >> On 26/04/17 12:59, Johannes Schindelin wrote: >> >>> The first step of an interactive rebase is to generate the so-called >>> "to

Re: [PATCH v3 1/9] rebase -i: generate the script via rebase--helper

2017-04-28 Thread Phillip Wood
On 26/04/17 12:59, Johannes Schindelin wrote: > The first step of an interactive rebase is to generate the so-called "todo > script", to be stored in the state directory as "git-rebase-todo" and to > be edited by the user. > > Originally, we adjusted the output of `git log ` using a simple > sed

Re: Bug? git rebase -i --autostash fails to restore working files

2016-07-28 Thread Phillip Wood
On 28/07/16 14:02, Remi Galan Alfonso wrote: > Hi Phillip, > > Phillip Wood <phillip.w...@talktalk.net> writes: >> When running ‘git rebase -i --autostash’ if the editor fails then the >> rebase fails but stash is not applied so the working files are not >> rest

Bug? git rebase -i --autostash fails to restore working files

2016-07-28 Thread Phillip Wood
When running ‘git rebase -i --autostash’ if the editor fails then the rebase fails but stash is not applied so the working files are not restored. Running ‘git rebase --abort’ replies that there’s no rebase in progress. If you notice what’s happened it’s not a problem if you know to do ‘git stash

<    1   2   3   4   5   6