Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Stash, git not working correctly
-
Hello everyone! I've recently been trying to use stash for the git support. I do a git init in a folder, then try doing a pull, in which it says "stash: <type 'exceptions.Exception'>: Current directory isn't a git repository". Strange, I try to do a git clone also but have an error instead, "stash: <class 'dulwich.errors.GitProtocolError'>: unexpected http response 401" it only clones the folder of the project, but no files can be found, even with ls -a. All of this has been done on python 2.7, I'm running out of ideas. Any help would be amazing, thank you!
-
If you want to do git pull, you need to set git remote for origin.
Take a look at the stash git tutorial. I would recommend using clone first, as that sets up the remotes properly. It should be possible to use git init, but you definately need to commit before you can push, and also need to specify where to push.
-
Even when I try to do a clone, I get a dulwich error, I use gitlab, could that be the problem?
-
I tried to do a full reinstall of Pythonista, installed stash and it said I needed dulwich, saying yes gave me an error. Restarted it, I was able to perform git unit with no error, but it didn't actually do it. I tried performing actions using git but I kept getting that the current directory wasn't a git repo.
-
hmm, not sure if gitlab works. you might try ssh
-
one note...
the syntax for git init is:
git init folder
so, to init the current folder you would
git init .
You should ls-la to cerify that .git was created.
I was able to clone from gitlab. Don't forget to append the trailing .git to the https path.
git clone https://gitlab.com/abate/meteor-volunteers.git meteor
-
Hey!
So when I try to do a commit it ask for my name and email, saving these brings an error, not saving it brings a random string of letter and numbers.
stash: <type 'exceptions.AttributeError'>: 'StackedConfig' object has no attribute 'write_to_path'
However this runs without the -m in "gif commit -m "something"".
When I do put the -m , I get this
usage: Commit current working tree. [-h] [message] [name] [email]
Commit current working tree.: error: unrecognized arguments: -mHow could I fix this? Thank you!
Edit: .git was created
-
the random string of letters and numbers is probably the commit sha. means you committed. git log should confirm.
there is no -m in stash version of git. best to just do
git commit
and let it promot you for message, etc
what is the error you get when it asks to save.
-
actually, can you type
stashconf py_traceback 1
then repeat your commit. then paste the full traceback here.
-
When I try to save the setting I get an new error,
File "/private/var/mobile/Containers/Shared/AppGroup/491E0501-5B73-4099-B13E-CFB6B2149284/Pythonista3/Documents/site-packages/stash/system/shruntime.py", line 510, in exec_py_file
exec(code, namespace, namespace)
File "../site-packages/stash/bin/git.py", line 763, in <module>
ns.func(args)
File "../site-packages/stash/bin/git.py", line 433, in git_commit
ns.name = ns.name or get_config_or_prompt(repo, 'user', 'name', 'Author Name: ')
File "../site-packages/stash/bin/git.py", line 411, in get_config_or_prompt
config.write_to_path()
AttributeError: 'StackedConfig' object has no attribute 'write_to_path'Yup..all of that.
Still can't push, I push it to the origin which is my gitlab repo, which I confirmed working. I ran your command and nothing happened, literally nothing.. I got new results so I guessed something did happen.
When trying to push to my repo:
stash: <type 'exceptions.AttributeError'>: 'function' object has no attribute 'urlparse'
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/491E0501-5B73-4099-B13E-CFB6B2149284/Pythonista3/Documents/site-packages/stash/system/shruntime.py", line 510, in exec_py_file
exec(code, namespace, namespace)
File "../site-packages/stash/bin/git.py", line 763, in <module>
ns.func(args)
File "../site-packages/stash/bin/git.py", line 561, in git_push
netloc = urlparse.urlparse(result.url).netloc
AttributeError: 'function' object has no attribute 'urlparse' -
Are you running stash using the 2.7 or 3.6 interpreter? ( Check launch_stash for the shebang). Stash git was never really tested in 3.6, and probably won't work yet
-
@JonB said:
Are you running stash using the 2.7 or 3.6 interpreter? ( Check launch_stash for the shebang). Stash git was never really tested in 3.6, and probably won't work yet
You can also check the output of the
version
command.
BTW, do you think portinggit
tp py3 involves a lot of work? Are the dependencies already py3 or do we need to port them as well? -
Using the 2.7 version
-
bennr01 -- i have a version of stash git which removes gittle dependencies, and upgrades to latest dulwich version. However, I think I have a few of the commands to port over still.
-
@crazyblob
looks like your problem is caused by some recent changes that allowed for user name and email to be stored in ~/.gitconfig. but in doing so, seems to have broken the per repo config handling.The easiest fix for you is to create that file:
in stash:
edit ~/.gitconfig
then, in the editor, type[user] name = Your Name email = youremail@address.com
where you obviously fill in your own info...
As for the push issues, looks to me like when things got updated recently, and git.py had 2to3 run on it, i think things got borked. quite honestly i would reccomend reverting to an older version of stash, or at least stash git...maybe try master, instead of dev.
-
Where can I get a earlier version of stash?
-
You could try installing the master version
selfupdate -f master
-
Did that, still didn't work
-
as a temporary fix, see
https://github.com/ywangd/stash/issues/328#issuecomment-416044398edit git.py and change the one line.