Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vilmibm
Copy link
Contributor

@vilmibm vilmibm commented Sep 14, 2020

more gist

video demo!

This PR:

  • adds gh gist list
    • gh gist list --public
    • gh gist list --secret
    • gh gist list --limit 2
  • adds gh gist edit
    • gh gist edit --filename foo.txt edit just one specific file in the gist
  • adds gh gist view
    • gh gist view --web eb834408ca7ffc9c5e7fb15b0e7d25c4 open gist in browser
    • gh gist view --raw eb834408ca7ffc9c5e7fb15b0e7d25c4 do not attempt to render markdown if found
    • gh gist view --filename foo.txt only print foo.txt
  • tweaks gh gist create to allow you to name files added via stdin
  • tweaks gh alias list to output yaml always
  • tweaks gh gist to add it to core commands

Limitations

  • list only deals with current authenticated user's gists (but view can view other users' gists)
  • no ability to fork another user's gist
  • no affordance for cloning a gist to do more advance editing
  • no affordance to add files during edit

@vilmibm vilmibm added the gist label Sep 14, 2020
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I love the editing functionality.

if len(gists) == limit {
break
}
if visibility == "all" || (visibility == "secret" && !gist.Public) || (visibility == "public" && gist.Public) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With GraphQL, I think you might be able to fetch gists based on their private bit and order them by UPDATED_AT.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah interesting, for some reason my brain thought "gists are not in the graphql api" but there they are.

i'm going to finish writing tests and then if i have time circle back and port this to graphql.

@vilmibm vilmibm requested a review from mislav September 15, 2020 22:30
@vilmibm vilmibm changed the title a slew of gist improvements bunch of gist stuff Sep 15, 2020
@tierninho
Copy link
Contributor

Just a few thoughts after playing around with this:

  • Should we always show a response for gh gist list. Currently nothing shows when I run it, but I have gists on my profile.
  • I ran 'gh gist view 1and it showed a poem, but when I rangh gist view 1 -w` it shows the first gist on github (https://gist.github.com/1).
  • Where exactly does gh gist create create a new gist? My profile?

@vilmibm
Copy link
Contributor Author

vilmibm commented Sep 16, 2020

  • Should we always show a response for gh gist list. Currently nothing shows when I run it, but I have gists on my profile.

I don't see any public gists at https://gist.github.com/tierninho ; do you have secret gists?

I think if a user has no gists we should probably print a user friendly message.

  • I ran 'gh gist view 1and it showed a poem, but when I rangh gist view 1 -w` it shows the first gist on github (https://gist.github.com/1).

I don't think there is anything wrong here. There is a gist with a hardcoded id of 1 with that "poem" (it's a joke version of the marine corps Rifle Creed) and you fetched it with gh gist view 1. It should have displayed properly with --web; did you see something different?

  • Where exactly does gh gist create create a new gist? My profile?

They are added to your gists at https://gist.github.com/tierninho

Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Ship it, ship it to the moon! 🚀 🌔

@jsejcksn
Copy link

jsejcksn commented Sep 16, 2020

no affordance for cloning a gist to do more advance editing

This is all that’s still needed in order to be able to use gh to enumerate and backup/export (clone) all owned gists, right?

@tierninho
Copy link
Contributor

I think if a user has no gists we should probably print a user friendly message.

👍

gh gist view 1 --web should have displayed properly; did you see something different?

Yes, I was taken to a random page that said this user has no gists. It went here: (https://gist.github.com/1).

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

Successfully merging this pull request may close these issues.

5 participants