News for hackers. Stuff that matters.
Re:Ask HN: Can I see your scripts? by impalallama on Monday August 15, 2022 @10:04AM (#32469829)
A bash script to open up the current git branch in my browser.

Use it everyday. Great because my company has multiple git submodules in any given project and I can use this to watch for pipeline failures and the like.

  x=$(git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p')
  y=$(git symbolic-ref --short HEAD)
  url="https://git.thecompany.com/thecompany/$x/tree/$y"
  $(open -a "firefox developer edition" "$url"
Re:Ask HN: Can I see your scripts? by eibhinn on Monday August 15, 2022 @07:58PM (#32477370)
Me too! Though yours looks fancier, is that jumping to a branch? lovely.

    glo () {
      xdg-open https://git.thecompany.com/$(git config remote.origin.url |cut -f2 -d: |cut -f1 -d.)
    }
Re:Ask HN: Can I see your scripts? by hugolundin on Sunday August 21, 2022 @05:56AM (#32538727)
I use git-open [1] for this – highly recommended. It supports multiple remotes and works great with custom hosted servers out of the box.

[1]: https://github.com/paulirish/git-open