Gists Vrs Repos for sharing Pythonista codebrowsing

I was reading about Gists, and the docs say that they are functionally equivalent to repos, in regards to cloning, forking etc...

@ccc, I noticed you had a post before about Gists being unmanaged. Have they changed since you wrote that? Or are Gists inferior to repos. From what I read, a gist is a repo.

I understand this is not Pythonista specific, but just trying to work out the best way to go. As Pythonista has some support for Gists, it would make sense to use them if they are functionally equivalent.

My sense of things is that with Gists, I can send the author comments about their code. With Repos, I can do everything that I can do with a Gist but I can also send code corrections/additions that the author chan chose to integrate in (or ignore).

To me, Gist is about advertising code while Repo is on collaborating about code. My knowledge may be (is!) incomplete.

Ok, I will keep looking. I got the impression you could do the same. But, and a big but, I need to read further. Is still black magic for me. Well, not entirely, i get the gist of things ;) but the source code management tools I used a long time were no where near as sophisticated what they are now. Being on the iPad adds that little extra, holy crap!

@dgelessus, thanks for clearing it up. Not that I am even close to be able to collaborate on a project yet. But with some luck and hard work, I will be able to one day. So I will keep trying to get my head around it. I personally find the interface on github a mine field. But I am not used to it. Starting to follow some of their tutorials, so hopefully I will get the hang of it sooner or later.
Thanks again.

GitHub can be confusing... There are a lot of utilities in Pythonista-Tools to help but it can still be complicated.

I was recently asked to document how I create Pull Requests into GitHub repositories that I do not own. I have trouble remembering all the magic syntax of the git command line tools in StaSH or on the Mac OSX command line. I tend to like using GUI tools more.

You can just use the GitHub web pages and copy and paste your changes in place and create a Pull Request that way but this can be confusing and gets quickly painful if you want to touch a number of files in a single pull request.

Another simplifying approach is to use PyCharm Community Edition but this too can sometimes be more complicated than it should be.

@ccc, I am almost never on my desktop. Did you write the guide with a desktop as part of the work process because it sort of has to be?

I would love a process to do everything from my ipad. I am not sure if that's unrealistic or not. I see people doing all sorts of things with workflow and workingcopy. But for simple old me it seems so convoluted. It really does frustrate me. There are so many talented programmers here, I feel this should be a no brainer.

But it gets to the root of what is being addressed here. Repos and cooperation. If all you smart guys got together and worked on one tool to give the whole create/edit/test/update etc.. Cycle inside Pythonista, I am sure it could be done.

As far as I know you can do all the important things with the git commands in stash. The most important ones you need to know are:

git clone https://github.com/username/reponame.git to download a repo's contents into the current folder, so do it in a new empty folder or have fun cleaning up the mess afterwards.

git pull to update an existing repo to the version available on GitHub. (You don't need to specify the URL here, because it's already stored in the .git metadata folder.)

git status to see which files have changed locally, and which modifications will happen in the next commit (see below).

git add and git rm to add or remove a file from the next commit.

git reset to undo any changes since the last commit.

git commit to save the changes in the repo as a new commit. When you run the command, you'll be asked to enter a commit message, where you should write a short one-line description of the changes you made. (On a real computer you can write a more detailed description in multiple lines, no idea if that's possible in stash.) The first time you commit to a repo (after you've cloned it) you're also asked to enter your username and e-mail address, which should be the same that you use on GitHub.

git push to publish any local commits to GitHub. The first time you do this you're asked to enter your GitHub username and password. Obviously this step only works for repos that you have write access to.

@dgelessus and @ccc , wouldn't you say the smartest thing would be for the top notch programmers come together and create a simple to use app using the the Pythonista ui libs. Something as close to fool proof as you can get.
I understand cmd line interfaces are very powerful. But this subject is at the core. I am sure I am not the only guy that can not make heads or tails of this, even when it's spoon fed to me.
I am not trying to be difficult, but Github with a user interface is difficult anyway, let alone a series of cmd line operations. For me, I cross my fingers and hopes it works out.

But again I will be blunt with you guys. I think you don't get how difficult it is, just because you know it like the back of your hand. And if you struggle occasionally, imagine how the rest of us fair? Not so good!

Really, if I had the skills. The backup/restore issue would be the first thing I would tackle, this would be the second. But not by myself, need to get a consensus that this is the tool for backups, and this is the tool for Github. Others not supported. Some lines need to be drawn in the sand sometimes. I think this is one of those times.

Well, that's my idea anyway. I know how structured you guys are in your business life, I don't see this should be different.

@Phuket2 I might eventually decide to work on some kind of code-sharing app built just for Pythonista, as I think it'd be worth doing.

It'd be a script that automated uploading / downloading code to and from a database. The database would probably be a GitHub repo, but the script would provide a foolproof front-end.

It'd have to be a bit more complicated than that, though, because I wouldn't want to give people write access to the repo just by reading through the script's code. The way I'd do this would probably be to have a web service on my server that took requests and posted content on GitHub. This way, I wouldn't have to include the password to the GitHub repo in the script that I had people download. The web service would only provide methods for uploading new scripts and for downloading scripts, not for editing, that way nobody would be able to undo others' work besides myself.

@ccc The commands I listed are for working with a repo that you own or have write access for. I'm not sure if GitHub forking is possible from the command line, there seems to be a lot of GitHub-specific stuff involved with the process. (Honestly I don't know how one would fork a repo independent of GitHub, or if that really just involves making a copy of the repo.)

GitHub's examples explain the entire workflow of dealing with your own repo in an easy to understand way. You have full read/write permissions so you can just Push changes directly into the repo without even needing to resort to Pull Requests.

The complexities for me come when I want to send a Pull Request into a repo that I do not own and I am not a "contributor" to. That is why the bold text in my post above is: create Pull Requests into GitHub repositories that I do not own.

I would still really like to see someone replicate my approach above using Working Copy app in place of GitHub Desktop.

@ccc GitHub specific functions can be accessed through GitHub API v3, including fork, create pull request etc. It should be possible to write a command line tool for them. But it is so convenient already to just do them via the webpages. It seems to me that the API is really for people who develope apps for GitHub, eg working copy. If you don't pay for the API, it is limited to about 60 calls per hour.

@ccc I do the initial "fork" of the repo using the website. Then I can create branches off my fork's master branch and commit to them using the command line. That should also be possible in stash. Once I'm done I send the PR through the website again.

If my fork's master branch gets outdated, I do git merge upstream/master (replace upstream with the original repo owner name, or add it as a remote by hand) which should always result in a fast-forward because I never do any changes to my master branch.

@ywangd Github has the hub command-line tool for these things https://hub.github.com. It provides all git functions, as well as some that are specific to GitHub. They recommend aliasing git to hub to make it the default command-line interface for Git.

Guys, I hope I didn't come off as complaining. I have a very high regard for all you guys and how much you are will to share and do. I was just emotional and frustrated. But the good news is you only get emotional about things you care about. It looks @ccc post got the topic started again though was is great. I think one thing that frustrates me, is that I can only talk about it. I can't really do anything that I am aware to contribute.

Oh, well. As I say just hope I didn't offend anyone. Was the furthest thing from my mind.