Re: [PATCH 3/7] test patch hunk editing with "commit -p -m"
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- Mar 15, 2014, 12:28 UTC
- Message-ID
- <53244777.2040302@web.de>
- In-Reply-To
- <xmqqk3c0o3cj.fsf@gitster.dls.corp.google.com>
On 2014-03-11 22.03, Junio C Hamano wrote:
Show 16 quoted lines
> Benoit Pierre <benoit.pierre@gmail.com> writes: > >> Add (failing) test: with commit changing the environment to let hooks >> now that no editor will be used (by setting GIT_EDITOR to ":"), the >> "edit hunk" functionality does not work (no editor is launched and the >> whole hunk is committed). >> >> Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com> >> --- >> t/t7513-commit_-p_-m_hunk_edit.sh | 34 ++++++++++++++++++++++++++++++++++ >> 1 file changed, 34 insertions(+) >> create mode 100755 t/t7513-commit_-p_-m_hunk_edit.sh >> >> diff --git a/t/t7513-commit_-p_-m_hunk_edit.sh b/t/t7513-commit_-p_-m_hunk_edit.sh > > I'll move this to t/t7514-commit-patch.sh for now while queuing.
This line is problematic: echo e | env GIT_EDITOR="sed s/+line3\$/+line2/ -i" git commit -p -m commit2 f
(sed -i is not portable: http://pubs.opengroup.org/onlinepubs/007908799/xcu/sed.html)
The whole test hangs in a forever loop loop under MacOS: debug=t verbose=t ./t7514-commit-patch.sh Stage this hunk [y,n,q,a,d,/,e,?]? @@ -1 +1,2 @@ line1 +line3
I think perl can be used instead of sed (but I haven't found the exact syntax yet)