hub
hub copied to clipboard
hub find files for shareability
The problem I'm trying to solve:
I want a shareable link of a specific file or line range to be shared with my team mates for easy references
Use cases:
- share the URL with my team mates
- if possible, generate the
blob/{filename}
url for share-ability - bonus, append specific line numbers e.g.
blob/{filename}#L12:34
How I imagine hub could expose this functionality:
Opens the find/{ref}
url on github
-
hub find
- opensfind/{ref}
-
hub find {filename}
- opensfind/{ref}
and pre-fill the find textbox
Current proof of concept I have, named ~/bin/git-find
#!/usr/bin/env bash
__hub_find(){
if test 0 -eq "$#"
then
hub browse -- find/$(git rev-parse --abbrev-ref HEAD)
return $?
fi
hub browse -- search\?q=filename:"$*"
}
__hub_find "$@"
really cool, could open up alot of possibilities.