Settings

Theme

Show HN: Peek into a remote repo from GitHub or Gitlab quickly

github.com

32 points by unrahul · 11 comments

Reader

3 threads
m-chrzan

Looks like github1s really kicked off everyone making these git previewers.

Thread about git-peek (which the author here cites as inspiration) from a few days ago: https://news.ycombinator.com/item?id=26108039

And the top commenter there created a cute bash 10-liner that basically implements the same functionality: https://git.sr.ht/~alexdavid/dotfiles/tree/master/bin/git-pe...

  • drzel

    Guilty as charged: https://github.com/drzel/vim-repo-edit

    Above only works on vim. But has the advantage of working within vim, so no need to open a new instance, and with no external dependencies beyond git.

    • oarsinsync

      All three spin-offs (git-peek, git-peak, vim-repo-edit) work with any git repo, maintaining the decentralised nature of git

      This latest one (repo-peek) explicitly only works with github and gitlab

andrewzah

What's the benefit here over starting a tmux session and cloning the repo in /tmp?

Knowing me, I'd close out and then realize I needed to search something else, etc.

  • kortex

    Well for one, giant repos from folks who don't understand why you shouldn't commit and push your 1 GB pytorch model.

    Yay working with academic researchers.

  • unrahulOP

    for the core functionality, the tool pretty much does that, although I am thinking of adding trending repos and things as such.. and any other features that other folks have in mind, keeping the core utility of the tool as opening a repo in your editor

    • unrahulOP

      Also, i am looking at ways to make pulling the content the fastest way possible using cdn cached files where possible and things like that..

pensatoio

Does this provide any kind of search mechanism? If it did, I would probably use this every day for viewing the source of 3rd party libraries.

  • m-chrzan

    I believe the point of these tools is to be UNIXy, doing one thing well, and delegating the rest to other tools you already use. The script just downloads source code and drops you into an editor. Presumably, if you're a developer, you already have your editor set up for handling source code directories.

    • unrahulOP

      Yup that is the intent, i designed it keeping in mind, I download very many repos and open it on vim, search is then offloaded to your tool of choice.

      Future improvements I am looking at is to add a search for trending remote repos and some caching mechanism

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection