mbostock / gistup Goto Github PK
View Code? Open in Web Editor NEWCreate a gist from terminal, then use git to update it.
License: Other
Create a gist from terminal, then use git to update it.
License: Other
When trying to use the module (v 0.0.10) I get this error:
/usr/local/lib/node_modules/gistup/bin/gistup:85
throw error;
^
Error: invalid gist id: undefined
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/gistup/bin/gistup:248:69)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
How can I fix this?
Currently we make a placeholder post ({".gistup": "gistup"}
) but it would be nice to avoid potential caching issues by posting the actual file contents.
For creating anonymous gists (with no associated user).
github has changed the default branch name of new gists to main
. On my local machine, new repositories name new branches master
(as is currently the default).
Since these don't match, I get the following error:
Error: Command failed: git push -fu 'origin' main
error: src refspec main does not match any
error: failed to push some refs to 'gist.github.com:227fc9570dad5bacc46e21eed19985f8.git'
at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1047:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
killed: false,
code: 1,
signal: null,
cmd: "git push -fu 'origin' main"
}
I was able to recover by running
git branch -m main
git push -fu origin main
Gistup throws the following error when initializing a new gist:
Initialized empty Git repository in ~/example_01/.git/
[master (root-commit) SHA] Initial gistup commit.
1 file changed, 308 insertions(+)
create mode 100644 file.py
gist GIST_ID created!
https://gist.github.com/GIST_ID
~/.npm-global/lib/node_modules/gistup/lib/gistup/unless.js:11
throw error;
^
Error: Command failed: git push -fu 'origin' master
ssh: connect to host gist.github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at ChildProcess.exithandler (child_process.js:294:12)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
Is suspect GitHub services might be the problem, since tcptraceroute gist.github.com 22
eventually times out before reaching the destination.
Is it possible to use HTTPS over SSH in gistup or would you be interested in implementing it?
Similar issue found here: https://stackoverflow.com/questions/60740289/ssh-connect-to-host-gist-github-com-port-22-operation-timed-out-fatal-could-n
After I enter my access token in my terminal, I am greeted by the following error
buffer.js:382
throw new Error('Unknown encoding');
^
Error: Unknown encoding
at Buffer.write (buffer.js:382:13)
at new Buffer (buffer.js:261:26)
at Object.fs.writeFileSync (fs.js:758:12)
at /usr/local/lib/node_modules/gistup/bin/gistup:75:12
at Interface._onLine (readline.js:198:5)
at Interface._line (readline.js:518:8)
at Interface._ttyWrite (readline.js:736:14)
at ReadStream.onkeypress (readline.js:97:10)
at ReadStream.EventEmitter.emit (events.js:126:20)
at emitKey (readline.js:1058:12)
Am I doing something wrong?
Would be nice if you could store default settings in ~/.gistup.json. For example, maybe
{
"defaults": {
"private": true
}
}
would create private gists by default.
This is more a feature request.
Would it be possible to set some basic ignore files in .gistup.json?
On Mac the .DS_Store gets added to the version control.
I added an alias to my .bash_profile to create a .gitignore file in the folder
alias gistup='echo ".DS_Store" > .gitignore;gistup'
but that makes the naming of the gist ugly (see the image)
I could remove the .DS_Store with an alias, but I think everybody else on Mac will have the same problem.
For your standard github repos you can use git browse
to open/browse the repo's remote via Github's web interface. However, you can't use the browse
subcommand to open gist-based repos (i.e., repos with remotes on gist.github.com
).
I was expecting gistup's --open
option to do this, but if you try running gistup --open
in a directory that's already been gisted, you get ...
Reinitialized existing Git repository in /Users/jvoigt/Repos/gists/demo-gist/.git/
ERROR: the remote "origin" already exists.
Are you trying to run gistup in a directory that already has a git
repository?
Perhaps gistup could write a .gist.url
file after initializing the gist's repo and look for this when the --open
option is invoked?
FWIW, I'm currently using the following alias/hack for this purpose:
alias browse='open $(git config remote.origin.url | tr '\'':'\'' / | sed -e '\''s#git@#https://#'\'' -e '\''s/\.git$//'\'')'
Maybe it's cause I'm on Ubuntu, not sure how this stuff operates on OS X:
Press any key to open GitHub…
/usr/local/lib/node_modules/gistup/bin/gistup:63
if (error) throw error;
^
Error: Command failed: Couldn't get a file descriptor referring to the console
at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
One workaround would be to allow an auth token to be given over the command line, as an option.
Hello!
I'm currently trying to set up gistup and it is returning this error after I input a personal access token:
node:internal/readline/emitKeypressEvents:74
throw err;
^
ReferenceError: UserError is not defined
at /Users/janicechen/.nvm/versions/node/v17.1.0/lib/node_modules/gistup/lib/gistup/get-settings.js:57:73
at Interface.[_onLine] [as _onLine] (node:internal/readline/interface:387:7)
at Interface.[_line] [as _line] (node:internal/readline/interface:793:18)
at Interface.[_ttyWrite] [as _ttyWrite] (node:internal/readline/interface:1105:22)
at ReadStream.onkeypress (node:internal/readline/interface:240:20)
at ReadStream.emit (node:events:390:28)
at emitKeys (node:internal/readline/utils:358:14)
at emitKeys.next ()
at ReadStream.onData (node:internal/readline/emitKeypressEvents:64:36)
at ReadStream.emit (node:events:390:28)
Node.js v17.1.0
the .gistup.json file is in my home directory with correct api key. I set it up with rights to gist.
Here is the error message I get:
$ gistup test_v1.yaml
Initialized empty Git repository in /home/garret/projects/webmap/server/tangram_styles/.git/
[master (root-commit) 48671ed] Initial gistup commit.
1 file changed, 5597 insertions(+)
create mode 100644 fpdcc_v1.yaml
gist 2162c96304134b437f79ef4d7f9a644a created!
https://gist.github.com/2162c96304134b437f79ef4d7f9a644a
/home/garret/.nvm/versions/node/v7.7.3/lib/node_modules/gistup/lib/gistup/unless.js:11
throw error;
^
Error: Command failed: git push -fu 'origin' master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at ChildProcess.exithandler (child_process.js:210:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
Any thoughts on what might be wrong?
I made my repo first and then used gistup, but it added other files to my repo, and then made a commit, before posting a gist.
It was intuitive to me that if I had an existing git repo, it wouldn't add any files to my repo.
If there is an option for not adding any files, it's not in the README :(
For example, if the GitHub personal access token step fails, tell people to edit their ~/.gistup.json.
Getting the error below.
The error seems to fail in "gitRemoteDoesNotExist", but the error is that the remote origin already exists.
/usr/local/lib/node_modules/gistup/bin/gistup:80
if (error) throw error;
^
Error: the remote "origin" already exists.
at /usr/local/lib/node_modules/gistup/bin/gistup:154:82
at ChildProcess.exithandler (child_process.js:538:7)
at ChildProcess.EventEmitter.emit (events.js:91:17)
at maybeClose (child_process.js:638:16)
at Socket.ChildProcess.spawn.stdin (child_process.js:825:11)
at Socket.EventEmitter.emit (events.js:88:17)
at Socket._destroy.destroyed (net.js:357:10)
at process.startup.processNextTick.process._tickCallback (node.js:325:13)
at process.startup.processMakeCallback.process._makeCallback (node.js:253:15)
It would be nice to include the ability to gpg sign the initial gist commit. Something equivalent to git commit -S -m 'initial commit'
.
Would be nice if you wanted to restrict which files get added.
When I first launched gistup and tried to get a personal access token, I got the following error message.
ERROR: the remote "origin" looks funny.
I was expecting something like
[email protected]:123456789.git
but instead the remote URL is
https://gist.github.com/suewonjp/6cb1c64274069a60286972085e234696.git
so I’m giving up. Sorry.
What do you think I am missing?
Could prompt you for a description and let you verify each file you want to add.
Sorry, wasn't sure what to title this. Not super important.
When you press any key to continue, your web browser will open.
Please login (if needed) and fill out the resulting form to create
an access token. When you’re done, copy the access token to the
clipboard and paste it back into the terminal.[msg about pressing any key etc]
The msg above, which i can't recall exactly, will change to "Enter personal access token:" only after one closes their browser. Otherwise, it seems as if gistup has hung up. Once i clued in and closed the browser everything was fine. I thought that part should be made clear.
Thanks a bunch for the cool tool. And every other one you've created.
This is super cool, but it throws and error if I am already tracking the repo. I could copy, remove the .git and call from an untracked folder, but is there a way to do it via gistup?
/usr/local/lib/node_modules/gistup/bin/gistup:76
if (error) throw error;
^
Error: the remote "origin" already exists.
at /usr/local/lib/node_modules/gistup/bin/gistup:150:79
at ChildProcess.exithandler (child_process.js:635:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
It's not working behind restrictive firewall.
I have a patch, but it adds request as a requirement.
My gistup was working so well to automate my bl.ocks and gists from the cli. But recently it started giving me errors, no longer works, and now I'm trying to figure out why.
I made a test directory to illustrate this, cd'd into it and typed this into terminal:
$ gistup --public -m 'Testing stuff'
Gistup creates my gist, with success, I tab to Chrome, rename the public gist and it populates on blocks momentarily.
Reinitialized existing Git repository in /Users/aurelia/Code/2015/gist-test/.git/
error Error: Invalid url field. This commit is not recorded into the git-stats history since you haven't added the remote url. You can import the previous commits using the git-stats-importer tool.
/usr/local/lib/node_modules/gistup/lib/gistup/unless.js:11
throw error;
^
Error: git commit failed.
at /usr/local/lib/node_modules/gistup/bin/gistup:152:65
at ChildProcess.exithandler (child_process.js:646:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
I'm on the same machine, same setup, same Github account as always, not pushing anything abnormal. All should be working.
I installed git-stats a while back, circa the same time my gistup started failing; since it's cited in the error message, I wonder whether there's a conflict between the two (gistup <> gitstats)? There are no errors related to gistups in the git-stats repo.
Or maybe this is an error that someone has seen before and can help me debug/+1?
Thanks!
Hi,
I've followed the "Let's Make a Block" tutorial and gotten stuck trying to run gistup. I've pasted the error below, which isn't addressed in your gistup troubleshooting section. At first I thought it might be a git configuration issue, but it looks like I've not set up my path variables correctly for npm-installed programs to run. Will check that first.
Thank you.
c:\Users\username\AppData\Roaming\npm\node_modules\gistup\lib\gistup\unless.js:11
throw error;
^
Error: Command failed: error: pathspec 'gistup' did not match any file(s) known to git.
error: pathspec 'commit.'' did not match any file(s) known to git.
at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
This is such a great tool. Is there an easy way to tell gistup to always ignore certain files, e.g. .DS_Store?
I had a .DS_Store
file in my directory, which cause gistup to fail. Removing the file fixed the problem..
npm-docs $ gistup
/Users/zeke/.nvm/v0.10.26/lib/node_modules/gistup/bin/gistup:128
if (error) throw error;
^
Error: Command failed: The following paths are ignored by one of your .gitignore files:
.DS_Store
Use -f if you really want to add them.
fatal: no files added
at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
As in set an environment variable or something with the password?
Would be nice to support Git Bash on Windows
$ gistup -m "WebVR Experiment"
Welcome to GISTUP!
Since this is your first time using gistup, we need to create a
GitHub personal access token to grant gistup permission to create
gists on your behalf. You’ll only have to do this once, and you
can easily revoke this token in the future if desired.
When you press any key to continue, your web browser will open.
Please login (if needed) and fill out the resulting form to create
an access token. When you’re done, copy the access token to the
clipboard and paste it back into the terminal.
Press any key to open GitHub… C:\Users\m\AppData\Roaming\npm\node_modules\gistup\lib\gistup\get-settings.js:37
process.stdin.setRawMode(true);
^
TypeError: process.stdin.setRawMode is not a function
at ReadFileContext.callback (C:\Users\m\AppData\Roaming\npm\node_modules\gistup\lib\gistup\get-settings.js:37:21)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:365:13)
Hello! I've been trying to use gistup on my new computer and I'm fairly sure I've set everything up right...but after it says the gist has been created, it throws this error and doesn't push any of my files. I end up having an "empty" gist with just a .gistup file in it.
I can't figure this out and I'm not sure how to ask this in a way that can help you help me! What other information do you need?
Thank you,
Janice
gist eecafd72e2b8eaf5db1edfdc7c7339db created!
https://gist.github.com/eecafd72e2b8eaf5db1edfdc7c7339db
/Users/f002bjt/.nvm/versions/node/v15.2.1/lib/node_modules/gistup/lib/gistup/unless.js:11
throw error;
^
Error: Command failed: git push -fu 'origin' main
error: src refspec main does not match any
error: failed to push some refs to '[email protected]:eecafd72e2b8eaf5db1edfdc7c7339db.git'
at ChildProcess.exithandler (node:child_process:309:12)
at ChildProcess.emit (node:events:329:20)
at maybeClose (node:internal/child_process:1055:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5) {
killed: false,
code: 1,
signal: null,
cmd: "git push -fu 'origin' main"
}
How to change a gist name (or gist description) in terminal?
When use gist up, the name (or ID) is automatically created (e.g. a7153f66879a11baaabb) and
the block name in bl.ock.org
is also set to that code, before changing the gist description manually in the web.
I know this question may not be written in issue tab.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.