Skip to content

Commit

Permalink
Change the default of sync-before-ship to off (#2735)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgo committed Dec 7, 2023
1 parent b084b3f commit c05f3bb
Show file tree
Hide file tree
Showing 36 changed files with 228 additions and 463 deletions.
6 changes: 3 additions & 3 deletions features/config/view.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: show the configuration
sync-feature strategy: merge
sync-perennial strategy: rebase
sync with upstream: yes
sync before shipping: yes
sync before shipping: no
Hosting:
hosting service override: (not set)
Expand Down Expand Up @@ -47,7 +47,7 @@ Feature: show the configuration
sync-feature strategy: merge
sync-perennial strategy: rebase
sync with upstream: yes
sync before shipping: yes
sync before shipping: no
Hosting:
hosting service override: (not set)
Expand Down Expand Up @@ -82,7 +82,7 @@ Feature: show the configuration
sync-feature strategy: merge
sync-perennial strategy: rebase
sync with upstream: yes
sync before shipping: yes
sync before shipping: no
Hosting:
hosting service override: (not set)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ Feature: commit message with double-quotes
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git checkout feature |
| feature | git merge --no-edit origin/feature |
| | git merge --no-edit main |
| | git checkout main |
| main | git merge --squash feature |
| | git commit -m "with "double quotes"" |
| | git push |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@ Feature: must provide a commit message

Scenario: result
Then it runs the commands
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git checkout feature |
| feature | git merge --no-edit origin/feature |
| | git merge --no-edit main |
| | git checkout main |
| main | git merge --squash feature |
| | git commit |
| | git reset --hard |
| | git checkout feature |
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git merge --squash feature |
| | git commit |
| | git reset --hard |
| | git checkout feature |
And it prints the error:
"""
aborted because commit exited with error
Expand Down
15 changes: 3 additions & 12 deletions features/ship/current_branch/edge_cases/empty_branch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,14 @@ Feature: does not ship an empty branch
Given the current branch is a feature branch "empty"
And the commits
| BRANCH | LOCATION | MESSAGE | FILE NAME | FILE CONTENT |
| main | origin | main commit | common_file | common content |
| main | local | main commit | common_file | common content |
| empty | local | empty commit | common_file | common content |
When I run "git-town ship"

Scenario: result
Then it runs the commands
| BRANCH | COMMAND |
| empty | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git checkout empty |
| empty | git merge --no-edit origin/empty |
| | git merge --no-edit main |
| | git reset --hard {{ sha 'empty commit' }} |
| | git checkout main |
| main | git reset --hard {{ sha 'Initial commit' }} |
| | git checkout empty |
| BRANCH | COMMAND |
| empty | git fetch --prune --tags |
And it prints the error:
"""
the branch "empty" has no shippable changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@ Feature: abort the ship by empty commit message

Scenario: result
Then it runs the commands
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git checkout feature |
| feature | git merge --no-edit origin/feature |
| | git merge --no-edit main |
| | git checkout main |
| main | git merge --squash feature |
| | git commit |
| | git reset --hard |
| | git checkout feature |
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git merge --squash feature |
| | git commit |
| | git reset --hard |
| | git checkout feature |
And it prints the error:
"""
aborted because commit exited with error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,31 @@ Feature: handle conflicts between the shipped branch and the main branch

Scenario: result
Then it runs the commands
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git push |
| | git checkout feature |
| feature | git merge --no-edit origin/feature |
| | git merge --no-edit main |
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git merge --squash feature |
| | git reset --hard |
| | git checkout feature |
And it prints the error:
"""
CONFLICT (add/add): Merge conflict in conflicting_file
"""
And it prints the error:
"""
To go back to where you started, run "git-town undo".
To continue after having resolved conflicts, run "git-town continue".
aborted because commit exited with error
"""
And the current branch is still "feature"
And a merge is now in progress
And no merge is in progress

Scenario: undo
When I run "git-town undo"
Then it runs the commands
| BRANCH | COMMAND |
| feature | git merge --abort |
Then it prints the error:
"""
nothing to undo
"""
And it runs no commands
And the current branch is still "feature"
And no merge is in progress
And now these commits exist
| BRANCH | LOCATION | MESSAGE | FILE NAME | FILE CONTENT |
| main | local, origin | conflicting main commit | conflicting_file | main content |
| feature | local | conflicting feature commit | conflicting_file | feature content |
And the initial branch hierarchy exists

Scenario: resolve and continue
When I resolve the conflict in "conflicting_file"
And I run "git-town continue"
Then it runs the commands
| BRANCH | COMMAND |
| feature | git commit --no-edit |
| | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" |
| | git push |
| | git push origin :feature |
| | git branch -D feature |
And the current branch is now "main"
And the branches are now
| REPOSITORY | BRANCHES |
| local, origin | main |
And now these commits exist
| BRANCH | LOCATION | MESSAGE | FILE NAME | FILE CONTENT |
| main | local, origin | conflicting main commit | conflicting_file | main content |
| | | feature done | conflicting_file | resolved content |
And no branch hierarchy exists now

Scenario: resolve, commit, and continue
When I resolve the conflict in "conflicting_file"
And I run "git commit --no-edit"
And I run "git-town continue"
Then it runs the commands
| BRANCH | COMMAND |
| feature | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" |
| | git push |
| | git push origin :feature |
| | git branch -D feature |
And the current branch is now "main"
And now the initial commits exist
And the initial branches and hierarchy exist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: handle conflicts between the shipped branch and its tracking branch
| BRANCH | LOCATION | MESSAGE | FILE NAME | FILE CONTENT |
| feature | local | conflicting local commit | conflicting_file | local content |
| | origin | conflicting origin commit | conflicting_file | origin content |
And Git Town setting "sync-before-ship" is "true"
When I run "git-town ship -m 'feature done'"

Scenario: result
Expand Down
21 changes: 8 additions & 13 deletions features/ship/current_branch/edge_cases/in_subfolder.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,14 @@ Feature: ship the current feature branch from a subfolder on the shipped branch

Scenario: result
Then it runs the commands
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git checkout feature |
| feature | git merge --no-edit origin/feature |
| | git merge --no-edit main |
| | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" |
| | git push |
| | git push origin :feature |
| | git branch -D feature |
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" |
| | git push |
| | git push origin :feature |
| | git branch -D feature |
And the current branch is now "main"
And the branches are now
| REPOSITORY | BRANCHES |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Feature: handle conflicts between the main branch and its tracking branch
| main | local | conflicting local commit | conflicting_file | local content |
| | origin | conflicting origin commit | conflicting_file | origin content |
| feature | local | feature commit | feature_file | feature content |
And Git Town setting "sync-before-ship" is "true"
When I run "git-town ship -m 'feature done'"

Scenario: result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,14 @@ Feature: ship the current feature branch with a tracking branch

Scenario: result
Then it runs the commands
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git checkout feature |
| feature | git merge --no-edit origin/feature |
| | git merge --no-edit main |
| | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" |
| | git push |
| | git push origin :feature |
| | git branch -D feature |
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" |
| | git push |
| | git push origin :feature |
| | git branch -D feature |
And the current branch is now "main"
And the branches are now
| REPOSITORY | BRANCHES |
Expand Down
10 changes: 0 additions & 10 deletions features/ship/current_branch/features/coworker_branch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ Feature: ship a coworker's feature branch
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git checkout feature |
| feature | git merge --no-edit origin/feature |
| | git merge --no-edit main |
| | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" --author "coworker <coworker@example.com>" |
| | git push |
Expand All @@ -33,11 +28,6 @@ Feature: ship a coworker's feature branch
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git checkout feature |
| feature | git merge --no-edit origin/feature |
| | git merge --no-edit main |
| | git checkout main |
| main | git merge --squash feature |
| | git commit --author "coworker <coworker@example.com>" |
| | git push |
Expand Down
21 changes: 8 additions & 13 deletions features/ship/current_branch/features/hotfix_branch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,14 @@ Feature: ship hotfixes

Scenario: result
Then it runs the commands
| BRANCH | COMMAND |
| hotfix | git fetch --prune --tags |
| | git checkout production |
| production | git rebase origin/production |
| | git checkout hotfix |
| hotfix | git merge --no-edit origin/hotfix |
| | git merge --no-edit production |
| | git checkout production |
| production | git merge --squash hotfix |
| | git commit -m "hotfix done" |
| | git push |
| | git push origin :hotfix |
| | git branch -D hotfix |
| BRANCH | COMMAND |
| hotfix | git fetch --prune --tags |
| | git checkout production |
| production | git merge --squash hotfix |
| | git commit -m "hotfix done" |
| | git push |
| | git push origin :hotfix |
| | git branch -D hotfix |
And the current branch is now "production"
And the branches are now
| REPOSITORY | BRANCHES |
Expand Down
4 changes: 0 additions & 4 deletions features/ship/current_branch/features/local_branch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ Feature: ship a local feature branch
| BRANCH | COMMAND |
| feature | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git checkout feature |
| feature | git merge --no-edit main |
| | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" |
| | git push |
Expand Down
3 changes: 1 addition & 2 deletions features/ship/current_branch/features/local_repo.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Feature: ship a feature branch in a local repo
Scenario: result
Then it runs the commands
| BRANCH | COMMAND |
| feature | git merge --no-edit main |
| | git checkout main |
| feature | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" |
| | git branch -D feature |
Expand Down
15 changes: 5 additions & 10 deletions features/ship/current_branch/features/offline.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ Feature: offline mode

Scenario: result
Then it runs the commands
| BRANCH | COMMAND |
| feature | git checkout main |
| main | git rebase origin/main |
| | git checkout feature |
| feature | git merge --no-edit origin/feature |
| | git merge --no-edit main |
| | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" |
| | git branch -D feature |
| BRANCH | COMMAND |
| feature | git checkout main |
| main | git merge --squash feature |
| | git commit -m "feature done" |
| | git branch -D feature |
And the current branch is now "main"
And now these commits exist
| BRANCH | LOCATION | MESSAGE |
Expand Down
19 changes: 7 additions & 12 deletions features/ship/current_branch/features/parent_branch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@ Feature: ship a parent branch

Scenario: result
Then it runs the commands
| BRANCH | COMMAND |
| parent | git fetch --prune --tags |
| | git checkout main |
| main | git rebase origin/main |
| | git checkout parent |
| parent | git merge --no-edit origin/parent |
| | git merge --no-edit main |
| | git checkout main |
| main | git merge --squash parent |
| | git commit -m "parent done" |
| | git push |
| | git branch -D parent |
| BRANCH | COMMAND |
| parent | git fetch --prune --tags |
| | git checkout main |
| main | git merge --squash parent |
| | git commit -m "parent done" |
| | git push |
| | git branch -D parent |
And it prints:
"""
branch "child" is now a child of "main"
Expand Down

0 comments on commit c05f3bb

Please sign in to comment.