Skip to content

Commit

Permalink
Use vi as the default editor during testing and debugging
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
extsoft committed Nov 20, 2019
1 parent 9cf9a53 commit 5d9fb81
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .workflows/ci-pipeline.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pipeline() {
echo "Installation...."
git config --global user.name "Elegant Git"
git config --global user.email [email protected]
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..."
Expand Down
2 changes: 1 addition & 1 deletion tests/addons-repo.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repo-new() {
perform-verbose git init
perform-verbose git config --local user.email "\"[email protected]\""
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}\""
Expand Down
4 changes: 2 additions & 2 deletions tests/git-elegant-acquire-git.bats
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ teardown() {
[[ "${lines[@]}" =~ "==>> git config --global user.name Elegant Git" ]]
[[ "${lines[@]}" =~ "What is your user email? {[email protected]}: " ]]
[[ "${lines[@]}" =~ "==>> git config --global user.email [email protected]" ]]
[[ "${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" {
Expand Down
8 changes: 4 additions & 4 deletions tests/git-elegant-acquire-repository.bats
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ teardown() {
[[ "${lines[@]}" =~ "==>> git config --local user.name Elegant Git" ]]
[[ "${lines[@]}" =~ "What is your user email? {[email protected]}: " ]]
[[ "${lines[@]}" =~ "==>> git config --local user.email [email protected]" ]]
[[ "${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" {
Expand Down Expand Up @@ -101,8 +101,8 @@ teardown() {
[[ "${lines[@]}" =~ "==>> git config --local user.name Elegant Git" ]]
[[ "${lines[@]}" =~ "What is your user email? {[email protected]}: " ]]
[[ "${lines[@]}" =~ "==>> git config --local user.email [email protected]" ]]
[[ ! "${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" ]]
Expand Down
2 changes: 1 addition & 1 deletion workflows
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repository() {
cd /eg
git config --global user.name \"Elegant Git\"
git config --global user.email [email protected]
git config --global core.editor some-editor
git config --global core.editor vi
git config --global elegant.acquired true
./install.bash /usr/local src
"
Expand Down

0 comments on commit 5d9fb81

Please sign in to comment.