From 5d9fb816cd5e55c121e9304a4b3f6cfaf2d6db35 Mon Sep 17 00:00:00 2001 From: Dmytro Serdiuk Date: Wed, 20 Nov 2019 18:13:02 +0200 Subject: [PATCH] Use `vi` as the default editor during testing and debugging All testing and debugging activities are performed within a Docker container. And sometimes, the real editor is required to make some experiments. As the dummy editor was used, some commands were failed as it does not work. For instance, when an interactive rebase is executed. As the solution, the `vi` editor now is used the default editor for git. It is available in our alpine-based Docker image, that's why the CI will work without changes. --- .workflows/ci-pipeline.bash | 2 +- tests/addons-repo.bash | 2 +- tests/git-elegant-acquire-git.bats | 4 ++-- tests/git-elegant-acquire-repository.bats | 8 ++++---- workflows | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.workflows/ci-pipeline.bash b/.workflows/ci-pipeline.bash index 1344aaf..a217bfe 100755 --- a/.workflows/ci-pipeline.bash +++ b/.workflows/ci-pipeline.bash @@ -17,7 +17,7 @@ pipeline() { echo "Installation...." git config --global user.name "Elegant Git" git config --global user.email elegant.git@email.com - git config --global core.editor some-editor + git config --global core.editor vi git config --global elegant.acquired true ./install.bash /usr/local src echo "'Unknown command' testing..." diff --git a/tests/addons-repo.bash b/tests/addons-repo.bash index f6aa509..9467bcf 100644 --- a/tests/addons-repo.bash +++ b/tests/addons-repo.bash @@ -11,7 +11,7 @@ repo-new() { perform-verbose git init perform-verbose git config --local user.email "\"elegant-git@example.com\"" perform-verbose git config --local user.name "\"Elegant Git\"" - perform-verbose git config --local core.editor "\"edi\"" + perform-verbose git config --local core.editor "\"vi\"" perform-verbose touch ${FILE_TO_MODIFY} perform-verbose git add . perform-verbose git commit -m "\"Add ${FILE_TO_MODIFY}\"" diff --git a/tests/git-elegant-acquire-git.bats b/tests/git-elegant-acquire-git.bats index 89a0cb3..c266ca0 100644 --- a/tests/git-elegant-acquire-git.bats +++ b/tests/git-elegant-acquire-git.bats @@ -28,8 +28,8 @@ teardown() { [[ "${lines[@]}" =~ "==>> git config --global user.name Elegant Git" ]] [[ "${lines[@]}" =~ "What is your user email? {elegant-git@example.com}: " ]] [[ "${lines[@]}" =~ "==>> git config --global user.email elegant-git@example.com" ]] - [[ "${lines[@]}" =~ "Please specify a command to start the editor. {edi}: " ]] - [[ "${lines[@]}" =~ "==>> git config --global core.editor edi" ]] + [[ "${lines[@]}" =~ "Please specify a command to start the editor. {vi}: " ]] + [[ "${lines[@]}" =~ "==>> git config --global core.editor vi" ]] } @test "'acquire-git': standards are configured as expected on Windows" { diff --git a/tests/git-elegant-acquire-repository.bats b/tests/git-elegant-acquire-repository.bats index b4b629b..6d9d0c1 100644 --- a/tests/git-elegant-acquire-repository.bats +++ b/tests/git-elegant-acquire-repository.bats @@ -25,8 +25,8 @@ teardown() { [[ "${lines[@]}" =~ "==>> git config --local user.name Elegant Git" ]] [[ "${lines[@]}" =~ "What is your user email? {elegant-git@example.com}: " ]] [[ "${lines[@]}" =~ "==>> git config --local user.email elegant-git@example.com" ]] - [[ "${lines[@]}" =~ "Please specify a command to start the editor. {edi}: " ]] - [[ "${lines[@]}" =~ "==>> git config --local core.editor edi" ]] + [[ "${lines[@]}" =~ "Please specify a command to start the editor. {vi}: " ]] + [[ "${lines[@]}" =~ "==>> git config --local core.editor vi" ]] } @test "'acquire-repository': standards are configured as expected on Windows" { @@ -101,8 +101,8 @@ teardown() { [[ "${lines[@]}" =~ "==>> git config --local user.name Elegant Git" ]] [[ "${lines[@]}" =~ "What is your user email? {elegant-git@example.com}: " ]] [[ "${lines[@]}" =~ "==>> git config --local user.email elegant-git@example.com" ]] - [[ ! "${lines[@]}" =~ "Please specify a command to start the editor. {edi}: " ]] - [[ ! "${lines[@]}" =~ "==>> git config --local core.editor edi" ]] + [[ ! "${lines[@]}" =~ "Please specify a command to start the editor. {vi}: " ]] + [[ ! "${lines[@]}" =~ "==>> git config --local core.editor vi" ]] [[ ! "${lines[@]}" =~ "==>> git config --local core.commentChar |" ]] [[ "${lines[@]}" =~ "1 Elegant Git aliases were removed." ]] [[ ! "${lines[@]}" =~ "==>> git config --local alias.acquire-repository elegant acquire-repository" ]] diff --git a/workflows b/workflows index dae0df7..72ee880 100755 --- a/workflows +++ b/workflows @@ -33,7 +33,7 @@ repository() { cd /eg git config --global user.name \"Elegant Git\" git config --global user.email elegant.git@email.com - git config --global core.editor some-editor + git config --global core.editor vi git config --global elegant.acquired true ./install.bash /usr/local src "