ejoffe / spr

Stacked Pull Requests on GitHub
MIT License
714 stars 65 forks source link

.spr.yml is overwritten with new values every time a git spr command is run. #410

Open jameskyle opened 3 weeks ago

jameskyle commented 3 weeks ago

Steps to reproduce for 0.14.9:

Run git spr status or something, it generates a config file that looks something like

githubRepoOwner: TheOwner
githubRepoName: therepo
githubHost: github.com
requireChecks: true
requireApproval: true
githubRemote: origin
githubBranch: master
remoteBranches: []
mergeMethod: rebase

Make some changes something like...

githubRepoOwner: TheOwner
githubRepoName: therepo
githubHost: github.com
requireChecks: true
requireApproval: true
githubRemote: origin
githubBranch: develop
remoteBranches: []
mergeMethod: squash

Run git spr status again

Works as expected. Changes retained.

Now add something new

githubRepoOwner: TheOwner
githubRepoName: therepo
githubHost: github.com
requireChecks: true
requireApproval: true
githubRemote: origin
githubBranch: develop
remoteBranches: []
mergeMethod: squash
mergeQueue: true

Now run git status spr one more time

It overwrites the config and removes the mergeQueue option going back to

githubRepoOwner: TheOwner
githubRepoName: therepo
githubHost: github.com
requireChecks: true
requireApproval: true
githubRemote: origin
githubBranch: develop
remoteBranches: []
mergeMethod: squash

I also tested to remove something like githubBranch (which I understand should be auto-detected). It will overwrite the .spr.yml and set it to the default of master.

jameskyle commented 3 weeks ago

I have a stack I can't merge due to needing the mergeQueue option.

jameskyle commented 3 weeks ago

I walked back the versions to 0.14.6 and still see the behavior.

Oddly, I only see it with one of my repository. In a second repository, with mergeQueue also enabled, I do not see this behavior.