You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It suspect there is an assumption that path.default will always be origin and that origin will always exist.
I suspect this is the cause of two bugs:
Confusing error output when github.com/github enterprise is a non-origin remote.
Empty PRs for repos without origin remote.
Confusing errors for github.com as non-origin
Problem: If I add github.com as a non-origin remote, I get the error message abort: either None is not a GitHub (Enterprise) hostname or you are not logged in.
The None in this output is confusing.
Flags tried:
--verbose provides no more information.
--debug provides irrelevant information about watchman.
--traceback showed me the place in the code where I could use the SL_TEST_GH_URL environment variable to override the default behavior (which seems to be intended only for testing).
I suspected adding a remote would fail, but also expected error output would help me fix it.
$ git remote -vv
github https://github.com/thcipriani/dumb-todo.git (fetch)
github https://github.com/thcipriani/dumb-todo.git (push)
origin [email protected]:thcipriani/dumb-todos.git (fetch)
origin [email protected]:thcipriani/dumb-todos.git (push)
$ git branch --set-upstream-to=github/main
branch 'main' set up to track 'github/main'.
$ echo 'Hello world' > README
$ sl add README
$ sl commit -m 'Update README'
$ sl
@ b468cd27e 5 seconds ago tyler
╭─╯ Update README
│
o dd9d12001 Sunday at 16:23 tyler origin/main
│ Add LICENSE
~
$ sl pr s
abort: either None is not a GitHub (Enterprise) hostname or you are not logged in.
Authenticate using the GitHub CLI: `gh auth login --git-protocol https --hostname None`
$ sl path
default = /tmp/dumb-todo/[email protected]:thcipriani/dumb-todos.git
github = https://github.com/thcipriani/dumb-todo.git
I'm unsure where hostname None is coming from, other than somewhere in python.
Suggestions
Show the path.default instead of None -- that gives me more information.
Bonus: If hostname is None, show path.default is not GitHub, abort, and add a pointer to sl help path/sl help urls
Possible feature: It may be helpful to specify the path for commands which use the path (i.e. sl pr submit github analogous to git push <refspec>).
Empty PRs for repos without origin
Problem: sl pr s creates an empty pull request after sl add and sl commit.
I suspect this is due to not having a origin remote for this repository. I found this while fiddling with the above problem.
$ git init
Initialized empty Git repository in /tmp/dumb-todos/.git/
$ git remote add github https://github.com/thcipriani/dumb-todo.git
$ git fetch github
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 27 (delta 8), reused 24 (delta 7), pack-reused 0
Unpacking objects: 100% (27/27), 17.16 KiB | 428.00 KiB/s, done.
From https://github.com/thcipriani/dumb-todo
* [new branch] main -> github/main
$ git checkout main
branch 'main' set up to track 'github/main'.
Already on 'main'
$ ls
app.py LICENSE requirements.txt static templates
$ echo 'Hello world' > README
$ sl add README
$ sl commit -m 'Update README'
$ sl pr s
abort: could not read paths.default
$ sl path --add default https://github.com/thcipriani/dumb-todo.git
$ sl path
default = https://github.com/thcipriani/dumb-todo.git
github = https://github.com/thcipriani/dumb-todo.git
$ sl pr s
pushing 3 to https://github.com/thcipriani/dumb-todo.git
abort: error creating pull request for <sha1>: {
"message": "Validation Failed",
"errors": [
{
"resource": "PullRequest",
"code": "custom",
"message": "No commits between main and pr4"
}
],
"documentation_url": "https://docs.github.com/rest/pulls/pulls#create-a-pull-request",
"status": "422"
}
$ git diff github/main..HEAD
diff --git a/README b/README
new file mode 100644
index 0000000..802992c
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+Hello world
The text was updated successfully, but these errors were encountered:
It suspect there is an assumption that
path.default
will always beorigin
and thatorigin
will always exist.I suspect this is the cause of two bugs:
github.com
/github enterprise is a non-origin
remote.origin
remote.Confusing errors for
github.com
as non-originProblem: If I add github.com as a non-
origin
remote, I get the error messageabort: either None is not a GitHub (Enterprise) hostname or you are not logged in.
The
None
in this output is confusing.Flags tried:
--verbose
provides no more information.--debug
provides irrelevant information about watchman.--traceback
showed me the place in the code where I could use theSL_TEST_GH_URL
environment variable to override the default behavior (which seems to be intended only for testing).I suspected adding a remote would fail, but also expected error output would help me fix it.
I'm unsure where hostname
None
is coming from, other than somewhere in python.Suggestions
path.default
instead of None -- that gives me more information.None
, showpath.default
is not GitHub, abort, and add a pointer tosl help path
/sl help urls
sl pr submit github
analogous togit push <refspec>
).Empty PRs for repos without
origin
Problem:
sl pr s
creates an empty pull request aftersl add
andsl commit
.I suspect this is due to not having a
origin
remote for this repository. I found this while fiddling with the above problem.The text was updated successfully, but these errors were encountered: