vermiculus / magithub

**DEPRECATED - please use Forge instead!** -- Magit-based interfaces to GitHub
GNU General Public License v3.0
579 stars 63 forks source link

Support Private Repos In Organizations #114

Closed dmin7b5 closed 7 years ago

dmin7b5 commented 7 years ago

I've tried using orgname/reponame but I get an invalid name error. And I'm not sure how I would indicate I want a private repo created. In hub I use: hub create orgname/reponame -p -d "Repo Description"

vermiculus commented 7 years ago

Can you provide the exact error text?

dmin7b5 commented 7 years ago

when prompted with: Repository name: myusername/orgname/reponame + I get, "invalid name". Not sure what syntax to use for a private repo on an org.

vermiculus commented 7 years ago

Should it not just be orgname/reponame?

Sorry, I'm not that familiar with organizations.

dmin7b5 commented 7 years ago

Sorry, yes...if you try to delete the myusername part that is pre-populated in the prompt, you get an error saying, "Text is read-only".

vermiculus commented 7 years ago

Ahh... I gotcha now. I'll see what I can do for this. Probably before we prompt, we should get a list of all accounts to which the user has push access -- then use that for the prompt.

dmin7b5 commented 7 years ago

ya that would be great, or If we could change that text and do something like orgname/reponame -p (and any other valid hub flags) that would be awesome.

vermiculus commented 7 years ago

I'll see what I can do about creating private repositories. The interface for homepage/description might be a little more complicated.

dmin7b5 commented 7 years ago

Thanks for looking at this...I love what you are doing with magithub. I really enjoy not having to constantly toggle to iterm and back to emacs...you rock!

vermiculus commented 7 years ago

@dmin7b5 Can you try out the develop branch? I'm not a member of any organizations so I can't rightly test to see if my changes really work 😉

dmin7b5 commented 7 years ago

INSTALL Ok, I was able to add your branch to Spacemacs by doing the following:

Edit init.el

dotspacemacs-additional-packages '((magithub :fetcher github :repo "vermiculus/magithub" :branch "develop"))

(defun dotspacemacs/user-config () (require 'magithub)

TESTING I then used a local git repo with one file and one commit and hit "H" and was prompted with:

STEP 1 Account: magithub-create gitusername org1 org2 org3

I chose org1 and hit enter

STEP 2 Next prompted with:

Will this be a private repository? (y or n)

I typed "y" and was prompted with:

STEP 3 Repository name: org1/

I typed in a repo name and hit enter

STEP 4 Prompted with:

Description (optional):

I hit enter and got the following error msg:

Symbol's function definition is void: \,@

Hope that helps.

vermiculus commented 7 years ago

Alrighty, try again. I tested with creating a private repo myself and everything seems to be in order; just the org stuff remains untested.

Note you'll need the most recent version of ghub+.

dmin7b5 commented 7 years ago

So I was able to push to an org with a private repo successfully. Some things to note though. I had to add (magithub-feature-autoinject t) to my user-config section of init.el because I kept getting this message popping up in between steps: "Magithub features not configured (pull-request-merge pull-request-checkout) ; see variable ‘magithub-features’ to turn off this message". Once I added that and restarted Spacemacs it went away.

After hitting "u" in the final step to push everything up, I get the message, "API not responding quickly, go offline? (y or n)". I kept hitting "n" and after about 4 of those messages it went away and I could see the commit had worked.

Just an fyi on what versions of stuff I'm using: Emacs (spacemacs) 25.2 with latest pkgs, hub version 2.3.0-pre10.

Thanks for getting this working, it's awesome!

vermiculus commented 7 years ago

API offline stuff related to #107.

Re magithub-feature-autoinject; see the README.

I'm glad stuff is working for you!

dmin7b5 commented 7 years ago

Thanks for the links. Yeah, I'm using gpg so that's why the message is popping up. I've been testing it and your code is working every time. The only odd thing now is that after everything is completed, the last line after the commit info says: "CI: Pending (it seems checks have not yet begun)".

vermiculus commented 7 years ago

@dmin7b5 That's to be expected; it takes time for GitHub to notify the CI of the push and for the CI to start the checks. That time is way longer than it takes us to ask for the statuses of the ref we just pushed, so the response comes back null.

I'm unsure of how to handle this without being annoying -- the only thing I can think of is to have some sort of idle-timer hook that'll refresh CI-status, but that'll kick off a full magit-refresh which would probably interrupt any other staging/committing work being done.

dmin7b5 commented 7 years ago

Good point. Perhaps being more explicit with the notification would suffice, "CI: Pending (awaiting host notification to allow the CI checking process to begin)"

vermiculus commented 7 years ago

@dmin7b5 When the header is being calculated, though, we can't tell between the following possibilities:

Trying to be too specific here isn't the answer -- if anything, the message should be more generic.

This conversation might be better suited to a new issue, though.