Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gist just saying You dont have configured github account #199

Open
favetelinguis opened this issue Nov 8, 2015 · 25 comments
Open

Gist just saying You dont have configured github account #199

favetelinguis opened this issue Nov 8, 2015 · 25 comments

Comments

@favetelinguis
Copy link

What can I do to find the error when gist only says You dont have github account configured?

I have done the follwoing:
Install web-api and gist with vundle
Run git --global github.user=... and git --gloab github.token=...
And created .gist-vim and put token=... but still gist just tells me I dont have github accound configured.

I get the same error when trying to run gist -a

Not sure what more i can try...

@mattn
Copy link
Owner

mattn commented Nov 9, 2015

try to remove ~/.gist-vim.

@favetelinguis
Copy link
Author

Makes no difference.
Den 9 nov 2015 01:15 skrev "mattn" notifications@github.com:

try to remove ~/.gist-vim.


Reply to this email directly or view it on GitHub
#199 (comment).

@mattn
Copy link
Owner

mattn commented Nov 10, 2015

What message do you get from below?

:echo g:github_user

What response do you get from below?

:echo substitute(s:system('git config --get github.user'), "\n", '', '')

@favetelinguis
Copy link
Author

First one: nothing is returned

Secound one:
E15: Invalid expression: substitute(s:system('git config --get github.user'), "\n", '','')
E120: Using not in a script context: s:system
E116: Invalid arguments for function substitute(s:system('git config --get github.user'), "\n", ''
,'')

@mattn
Copy link
Owner

mattn commented Nov 10, 2015

Ah, sorry. try this instead.

:echo substitute(system('git config --get github.user'), "\n", '','')

@favetelinguis
Copy link
Author

That did show my github account name!?!

@mattn
Copy link
Owner

mattn commented Nov 10, 2015

Yes, you will see your account name because it's given from https://github.com/mattn/gist-vim/blob/master/autoload/gist.vim#L39

So the error https://github.com/mattn/gist-vim/blob/master/autoload/gist.vim#L719 couldn't be displayed.

@favetelinguis
Copy link
Author

What might be the reason im not seeing the account name in the firs example?
Den 11 nov 2015 00:52 skrev "mattn" notifications@github.com:

Yes, you will see your account name because it's given from
https://github.com/mattn/gist-vim/blob/master/autoload/gist.vim#L39

So the error
https://github.com/mattn/gist-vim/blob/master/autoload/gist.vim#L719
couldn't be displayed.


Reply to this email directly or view it on GitHub
#199 (comment).

@mattn
Copy link
Owner

mattn commented Nov 11, 2015

What might be the reason im not seeing the account name in the firs example?

Removed by another plugin.

@tomibennett
Copy link

tomibennett commented Apr 17, 2016

EDIT °2
Very sorry. Forgot to mention that I'm running nvim 0.1.3


I've got the same error here and some things don't appear clear to me:

@mattn you asked @favetelinguis to perform in ex mode, a function's call that we can find in line 39 of the script:
substitute(s:system('git config --get github.user'), "\n", '', '')
which gave an error (like for me). You put on the fault of the s: and, thus you asked to remove it and run again, which resulted in the following function's call that was just fine (like for me):
substitute(system('git congit --get github.user'), "\n", '', '').

My question is why keeping the failed function's call in the source code instead of replacing it by the working one?

Also @mattn I really didn't understand this reply of yours

Yes, you will see your account name because it's given from https://github.com/mattn/gist-vim/blob/master/autoload/gist.vim#L39
So the error https://github.com/mattn/gist-vim/blob/master/autoload/gist.vim#L719 couldn't be displayed.


EDIT
I added this modification to the script and it seems to work just fine.

@mattn
Copy link
Owner

mattn commented Apr 17, 2016

What error do you get from git config --get github.user ?

@tomibennett
Copy link

None

@mattn
Copy link
Owner

mattn commented Apr 17, 2016

okay, but you must get error code. try to see echo $? on unix, echo %ERRORLEVEL% on windows.

@tomibennett
Copy link

tomibennett commented Apr 17, 2016

Sorry I wasn't clear. It gaves me what I wanted: my username
$> git config --get github.user
mahloun
$> cat ~/.gitconfig
[...]
[github]
  user = mahloun
[...]

@mattn
Copy link
Owner

mattn commented Apr 17, 2016

And do you mean that you get always error with system("git config --get github.user"). Right?

@tomibennett
Copy link

Nope exactly the contrary. what I was wondering is why not put the version that you just proposed (which is the working one) in the script? I realised that at the 39th line still contained the following version: s:system("git ...

@mattn
Copy link
Owner

mattn commented Apr 17, 2016

I don't still understand what problem you get. s:system is defined in line 36.

@tomibennett
Copy link

On line 39: without the context s: the whole script is working for me and not if present.
Here what I did:

  • -let g:github_user = substitute(s:system('git config --get github.user'), "\n", '', '')
  • +let g:github_user = substitute(system('git config --get github.user'), "\n", '', '')

Don't know very well scripting in git but it seems that using the bare system() is preferable for some of us.

@mattn
Copy link
Owner

mattn commented Apr 17, 2016

what environment do you use? linux or OSX, or Windows?

@tomibennett
Copy link

OSX

@mattn
Copy link
Owner

mattn commented Apr 17, 2016

I don't have OSX, but no errors on Linux, Windows with vim. it occur on nvim?

@tomibennett
Copy link

Yep on nvim

@mattn
Copy link
Owner

mattn commented Apr 17, 2016

Then, it is a bug of nvim.

@StaverDmitry
Copy link

StaverDmitry commented Dec 18, 2017

Hi! Used this plugin with Ubuntu nvim and everything was great, but get the same issue with OSX now. Seems like its an OS issue.
Results of all the previous commands are the same like other people had, I don't get anything with g:github_user and I see my username with echo substitute(system('git config --get github.user'), "\n", '','')

@mattn
Copy link
Owner

mattn commented Dec 19, 2017

Once remove ~/.gist-vim and please try it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants