-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
submit: --no-publish should work for unsupported forges
If using `submit` commands with --no-publish, there's no need to require remote repository information. As long as we can `git push` to it, we're good. This commit reorganizes the information retrieval in submit commands to only fetch the remote repository information when necessary. Resolves #351
- Loading branch information
Showing
8 changed files
with
140 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kind: Fixed | ||
body: '{branch, stack, upstack, downstack} submit: When submitting with --no-publish, allow pushing to repositories managed by unsupported forges.' | ||
time: 2024-08-21T08:29:41.537238-07:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
testdata/script/issue351_submit_no_publish_unsupported_forge.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# submit commands should still be able to push to unsupported forges | ||
# if the --no-publish flag is used. | ||
# | ||
# https://github.com/abhinav/git-spice/issues/351 | ||
|
||
as 'Test <[email protected]>' | ||
at '2024-08-21T05:18:00Z' | ||
|
||
# setup an upstream repository | ||
mkdir upstream | ||
cd upstream | ||
git init | ||
git commit --allow-empty -m 'Initial commit' | ||
|
||
# receive updates to the current branch | ||
git config receive.denyCurrentBranch updateInstead | ||
|
||
# setup the git-spice managed repository | ||
cd .. | ||
git clone upstream repo | ||
cd repo | ||
gs repo init | ||
|
||
# set up a stack: feat1 -> feat2 -> feat3 | ||
mv $WORK/extra/feat1.txt feat1.txt | ||
git add feat1.txt | ||
gs bc -m feat1 | ||
|
||
mv $WORK/extra/feat2.txt feat2.txt | ||
git add feat2.txt | ||
gs bc -m feat2 | ||
|
||
mv $WORK/extra/feat3.txt feat3.txt | ||
git add feat3.txt | ||
gs bc -m feat3 | ||
|
||
# branch submit: supports pushing | ||
gs bottom | ||
gs branch submit --no-publish | ||
|
||
# downstack submit: supports pushing | ||
gs up | ||
gs downstack submit --no-publish | ||
|
||
# upstack submit: supports pushing | ||
gs upstack submit --no-publish | ||
|
||
# stack submit: supports pushing | ||
gs stack submit --no-publish | ||
|
||
# submit: can push a new commit | ||
gs bottom | ||
mv $WORK/extra/feat1-new.txt feat1.txt | ||
git add feat1.txt | ||
gs cc -m 'feat1 new version' | ||
gs stack submit --no-publish | ||
|
||
# submit: can push an amended commit | ||
gs up | ||
mv $WORK/extra/feat2-new.txt feat2.txt | ||
git add feat2.txt | ||
gs ca -m 'feat2 new version' | ||
gs stack submit --no-publish | ||
|
||
# verify final state | ||
cd ../upstream | ||
git graph --branches | ||
cmp stdout $WORK/golden/final-graph.txt | ||
|
||
-- extra/feat1.txt -- | ||
feature 1 | ||
-- extra/feat2.txt -- | ||
feature 2 | ||
-- extra/feat3.txt -- | ||
feature 3 | ||
-- extra/feat1-new.txt -- | ||
feature 1 new version | ||
-- extra/feat2-new.txt -- | ||
feature 2 new version | ||
-- golden/final-graph.txt -- | ||
* 34273ae (feat3) feat3 | ||
* b7b3597 (feat2) feat2 new version | ||
* a5db510 (feat1) feat1 new version | ||
* 85d6296 feat1 | ||
* 019537e (HEAD -> main) Initial commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters