Forum Archive

gitui, stash and shellista issues

polymerchm

Trying to push next major upgrade to my chordcalc script and I get this from essantially all three of the subject line tools

tempting to push to: https://github.com/polymerchm/chordcalc.git, branch: refs/heads/devel-json
Traceback (most recent call last):
  File "./uidialog.py", line 119, in dispatch_ok_action
  File "/var/mobile/Containers/Data/Application/3469D264-D1AC-451E-9E4A-B3E38AD33B7F/Documents/gitview/gitui.py", line 572, in push_callback_dict
    push_callback(d['username'],d['password'])
  File "/var/mobile/Containers/Data/Application/3469D264-D1AC-451E-9E4A-B3E38AD33B7F/Documents/gitview/gitui.py", line 565, in push_callback
    porcelain.push(repo.path, remote, branch_name, opener=opener)
  File "/var/mobile/Containers/Data/Application/3469D264-D1AC-451E-9E4A-B3E38AD33B7F/Documents/site-packages/dulwich/porcelain.py", line 505, in push
    r.object_store.generate_pack_contents, progress=errstream.write)
  File "/var/mobile/Containers/Data/Application/3469D264-D1AC-451E-9E4A-B3E38AD33B7F/Documents/site-packages/dulwich/client.py", line 1018, in send_pack
    data=req_data.getvalue())
  File "/var/mobile/Containers/Data/Application/3469D264-D1AC-451E-9E4A-B3E38AD33B7F/Documents/site-packages/dulwich/client.py", line 976, in _smart_request
    resp = self._http_request(url, headers, data)
  File "/var/mobile/Containers/Data/Application/3469D264-D1AC-451E-9E4A-B3E38AD33B7F/Documents/site-packages/dulwich/client.py", line 941, in _http_request
    resp = self.opener.open(req)
  File "/private/var/mobile/Containers/Bundle/Application/350A701A-29F3-4F40-83B7-2C1AF58866B7/Pythonista.app/pylib/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/private/var/mobile/Containers/Bundle/Application/350A701A-29F3-4F40-83B7-2C1AF58866B7/Pythonista.app/pylib/urllib2.py", line 422, in _open
    '_open', req)
  File "/private/var/mobile/Containers/Bundle/Application/350A701A-29F3-4F40-83B7-2C1AF58866B7/Pythonista.app/pylib/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/private/var/mobile/Containers/Bundle/Application/350A701A-29F3-4F40-83B7-2C1AF58866B7/Pythonista.app/pylib/urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/private/var/mobile/Containers/Bundle/Application/350A701A-29F3-4F40-83B7-2C1AF58866B7/Pythonista.app/pylib/urllib2.py", line 1184, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno 32] Broken pipe>

Help (whimper)!!

Also, shash now tries to load 0.9.9 Dulwich every time it starts and I do a git command. during this, it complanis it can't find ...stash/dulwich.old

dgelessus

Had this error as well for my pythonista-scripts repo. My solution was to clone the repo from GitHub in a new folder, copy all changed files over and redo the commit. After that I could push again without problems. This certainly isn't the best way to solve this issue (it's more of a bad workaround really) and I don't know enough about Dulwich/Gittle's inner workings to tell why this is happening... (It also happens with gitview, unsurprisingly, as the two seem to use the same Git implementation.)

JonB

This happens when you are trying to push something which is not a direct descendent of the github repo, like you've made changes in both places. The clone solution works, but the latest git command also has a merge command to help with this.

The way you'd use this would be:

git fetch
git merge origin/devel-json

If the merge goes well, you can simply git push otherwise, you'll have to go resolve conflict markers. Then git commit will set the version on github to be a parent, and it should accept the push.

As for the redownload problem, I have that fixed in
https://github.com/jsbain/stash/blob/git_overhaul/bin/git.py

Or, restart pythonista, and run stash git before running gitui.

polymerchm

May humbly suggest that Stash ask the user if, when they type rm -rf * , that they are not out of their cotton-picking mind and really want to erase everything. And I do mean everything. At least there is github. First I have to get at stash or shellista back. Just 3 weeks codeing down the bit bucket, but I know what I did.

Any simple suggestion as to how I bootstrap them in from ground zero? Going to use has just bought iMazing, but only used it on my iPhone. Oh well.

polymerchm

all back except the last 3 weeks oh well

JonB

Well, the -f generally means "I'm not out of my mind, don't bother me" :).
Use rm -r if you are someone with lots of remorse.

I did this in shellista before we added -f, and noticed it taking a long time, and was able to kill pythonista before I lost everything (just mostly everything)....

Btw, the latest stash dev now has the fixed git versions, which should let you use merge.

polymerchm

Got it. Back in the day, when I ran a lot of big Fortran programs on a Harris 100 computer, if you wanted to reformat the hard drives, it would ask you a series of "are your sure questions" whose answers went from

Y/N to

Yes/No to

'Type: "I WANT TO ERASE THIS ENTIRE DRIVE".

I now am using iMazing. It is.

ywangd

@polymerchm The -f option means "force removal without asking". The -r means recursively remove folders and all of their sub-folders and files. Please issue rm as rm -i ..., if you'd like to have a second look on what is going to be deleted. For most commands, you can type and run command_name -h (e.g. rm -h) to check available options and their detailed meanings.

@JonB In fact, rm by default behave likes rm -f, so rm -r will still remove everything w/o asking. You have to explicitly require delete confirmation with the -i option, i.e. rm -i. You can create an alias like alias rm='rm -i' so that deletion confirmation is always issued. This behaviour is in line with the Linux version of rm. I usually try to stick to Linux behaviour as much as possible. But in this case, it may be worthwhile to break the rule as it is more likely to have a mis-type in Pythonista and data loss is much difficult to recover??

polymerchm

@ywangd Been unix-ing for eons. Never do an rm while conversing with your daughter over the phone. Mea culpe.

polymerchm

New stash wierdness. Trying to edit .gitignore using edit command. when I type:

edit .gitignore

the screen jumps to what I was previously editing with no request to "accept the edits", just an empty command line. Enclosure in single or double quotes does not help. This used to work.

asking to edit README.md (which exists) displays that file for editing, but no request to save/not save edits.

JonB

Try edit -t .gitignore

The pythonista editor doesn't like extensions it doesn't know about. Though I will say this has been crashing on me.

Also note gitignore is not currently used in git stash... Maybe that should be the next feature to add...

polymerchm

Thanks. That did the trick. .gitignore does work in gitview.