All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: Junio C Hamano <gitster@pobox.com>, Git List <git@vger.kernel.org>
Subject: Re: [PATCH 1/4] add -p: demonstrate failure when running 'edit' after a split
Date: Tue, 14 Apr 2015 16:46:09 -0400	[thread overview]
Message-ID: <CAPig+cQQrWUESdOdVCS_sU+muttt=P+sRJBjzrWTEUn10+aSDw@mail.gmail.com> (raw)
In-Reply-To: <1429011168-23216-2-git-send-email-Matthieu.Moy@imag.fr>

On Tue, Apr 14, 2015 at 7:32 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
> The test passes if one replaces the 'e' command with a 'y' command in
> the 'add -p' session.
>
> Reported-by: Tanky Woo <wtq1990@gmail.com>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
> diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
> index 24ddd8a..b48a75c 100755
> --- a/t/t3701-add-interactive.sh
> +++ b/t/t3701-add-interactive.sh
> @@ -335,6 +335,31 @@ test_expect_success 'split hunk "add -p (edit)"' '
>         ! grep "^+15" actual
>  '
>
> +test_expect_failure 'split hunk "add -p (no, yes, edit)"' '
> +       cat >test <<-\EOF &&
> +       5
> +       10
> +       20
> +       21
> +       30
> +       31
> +       40
> +       50
> +       60
> +       EOF
> +       git reset &&
> +       # test sequence is s(plit), n(o), y(es), e(dit)
> +       # q n q q is there to make sure we exit at the end.
> +       for a in s n y e   q n q q
> +       do
> +               echo $a
> +       done |

Simplified:

    printf '%s\n' s n y e q n q q |

> +       EDITOR=: git add -p 2>error &&
> +       test_must_be_empty error &&
> +       git diff >actual &&
> +       ! grep "^+31" actual
> +'
> +
>  test_expect_success 'patch mode ignores unmerged entries' '
>         git reset --hard &&
>         test_commit conflict &&
> --
> 2.4.0.rc1.42.g9642cc6

  reply	other threads:[~2015-04-14 20:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14  1:56 Git add -p “Your edited hunk does not apply. Edit again” Tanky Woo
2015-04-14  9:43 ` Matthieu Moy
2015-04-14 11:32   ` [PATCH 0/4] demonstrate add -p and stash -p failures Matthieu Moy
2015-04-14 11:32     ` [PATCH 1/4] add -p: demonstrate failure when running 'edit' after a split Matthieu Moy
2015-04-14 20:46       ` Eric Sunshine [this message]
2015-04-14 11:32     ` [PATCH 2/4] t3904-stash-patch: fix test description Matthieu Moy
2015-04-14 11:32     ` [PATCH 3/4] t3904-stash-patch: factor PERL prereq at the top of the file Matthieu Moy
2015-04-14 11:32     ` [PATCH 4/4] stash -p: demonstrate failure of split with mixed y/n Matthieu Moy
2015-04-14 20:46       ` Eric Sunshine
2015-04-14 18:00     ` [PATCH 0/4] demonstrate add -p and stash -p failures Junio C Hamano
2015-04-16  7:02     ` [PATCH v2 0/5] " Matthieu Moy
2015-04-16  7:02       ` [PATCH v2 1/5] t3701-add-interactive: simplify code Matthieu Moy
2015-04-16  7:02       ` [PATCH v2 2/5] add -p: demonstrate failure when running 'edit' after a split Matthieu Moy
2015-04-16  7:02       ` [PATCH v2 3/5] t3904-stash-patch: fix test description Matthieu Moy
2015-04-16  7:02       ` [PATCH v2 4/5] t3904-stash-patch: factor PERL prereq at the top of the file Matthieu Moy
2015-04-16  7:02       ` [PATCH v2 5/5] stash -p: demonstrate failure of split with mixed y/n Matthieu Moy
     [not found]   ` <CALv9gbMshdNhB58Otx5h8rmtCAU4qo9eNTqKSMzD_Phy7Sataw@mail.gmail.com>
2015-04-14 14:00     ` Git add -p “Your edited hunk does not apply. Edit again” Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPig+cQQrWUESdOdVCS_sU+muttt=P+sRJBjzrWTEUn10+aSDw@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.