Slackbot
08/22/2023, 10:50 PMJacob Gold
08/22/2023, 10:56 PMVampire
08/22/2023, 11:09 PMAaron Friel
08/22/2023, 11:41 PMAaron Friel
08/22/2023, 11:42 PMJacob Gold
08/23/2023, 12:00 AMJacob Gold
08/23/2023, 12:01 AMBen Jaffe
08/23/2023, 6:23 AMVampire
08/23/2023, 6:51 AMBen Jaffe
08/23/2023, 12:24 PMgt commands changes, and it'll be very hard to write since Graphite doesn't expose easy ways to get either the Graphite or Github urls.Vampire
08/23/2023, 1:31 PMgt bi | grep -F app.graphite.dev | sed 's!^<https://app>\.graphite\.dev/github/pr/\([^/]\+\)/\([^/]\+\)/\([^/]\+\)\(/.*\)\?!<https://github.com/>\1/\2/pull/\3!'Vampire
08/23/2023, 1:32 PMsed in a wrapper around sed to replace all Graphite links by GitHub links in the outputBen Jaffe
08/23/2023, 7:06 PMBen Jaffe
08/23/2023, 7:07 PMgt bi | grep -F app.graphite.dev | sed 's!^<https://app>\.graphite\.dev/github/pr/\([^/]\+\)/\([^/]\+\)/\([^/]\+\)\(/.*\)\?!<https://github.com/>\1/\2/pull/\3!' | pbcopyVampire
08/23/2023, 8:14 PMVampire
08/23/2023, 8:14 PMBen Jaffe
08/23/2023, 8:22 PMBen Jaffe
08/23/2023, 8:22 PMgt bi | grep -F <http://app.graphite.dev|app.graphite.dev> | sed 's!^<https://app>\.graphite\.dev/github/pr/\([^/]\+\)/\([^/]\+\)/\([^/]\+\)\(/.*\)\?!<https://github.com/>\1/\2/pull/\3!' (what you wrote above) doesn't output anything eitherBen Jaffe
08/23/2023, 8:23 PMVampire
08/23/2023, 8:23 PMVampire
08/23/2023, 8:24 PMVampire
08/23/2023, 8:24 PMBen Jaffe
08/23/2023, 8:24 PMBen Jaffe
08/23/2023, 8:24 PMBen Jaffe
08/23/2023, 8:24 PMBen Jaffe
08/23/2023, 8:24 PMVampire
08/23/2023, 8:25 PMBen Jaffe
08/23/2023, 8:27 PMVampire
08/23/2023, 8:28 PMsed behaves differently:
$ echo '<https://app.graphite.dev/github/pr/archiveresale/archive/4665>' | sed 's!^<https://app>\.graphite\.dev/github/pr/\([^/]\+\)/\([^/]\+\)/\([^/]\+\)\(/.*\)\?!<https://github.com/>\1/\2/pull/\3!'
<https://github.com/archiveresale/archive/pull/4665>Ben Jaffe
08/23/2023, 8:29 PMBen Jaffe
08/23/2023, 8:29 PM/usr/bin/sedVampire
08/23/2023, 8:30 PMBen Jaffe
08/23/2023, 8:30 PMBen Jaffe
08/23/2023, 8:31 PMBen Jaffe
08/23/2023, 8:31 PMJacob Gold
08/23/2023, 8:31 PMVampire
08/23/2023, 8:32 PMsed ... really sed -E ... or something similar, changing the regex syntax from defaultVampire
08/23/2023, 8:33 PM/usr/bin/sedVampire
08/23/2023, 8:33 PMalias sed if it is in fish like in bashVampire
08/23/2023, 8:35 PM-E or -r or whatever your version of sed supportsVampire
08/23/2023, 8:35 PMBen Jaffe
08/23/2023, 8:36 PM/usr/bin/sed has the same behaviorVampire
08/23/2023, 8:36 PMBen Jaffe
08/23/2023, 8:36 PMBen Jaffe
08/23/2023, 8:37 PMBen Jaffe
08/23/2023, 10:47 PMBen Jaffe
08/23/2023, 10:47 PMBen Jaffe
08/23/2023, 10:51 PMecho '<https://app.graphite.dev/github/pr/archiveresale/archive/4665>' | sed -E 's|<https://app>\.graphite\.dev/github/pr/([^/]+)/([^/]+)/([^/]+)|<https://github.com/>\1/\2/pull/\3|'Ben Jaffe
08/23/2023, 10:57 PM# Open Graphite Page
abbr dp "gt dp"
# Open Github Page
abbr dpg "gt bi | grep -F app.graphite.dev | sed -E 's|<https://app>\.graphite\.dev/github/pr/([^/]+)/([^/]+)/([^/]+)|<https://github.com/>\1/\2/pull/\3|' | xargs open"
# Copy Graphite Page
abbr dc "gt bi | grep -F app.graphite.dev | pbcopy"
# Copy Github Page
abbr dg "gt bi | grep -F app.graphite.dev | sed -E 's|<https://app>\.graphite\.dev/github/pr/([^/]+)/([^/]+)/([^/]+)|<https://github.com/>\1/\2/pull/\3|' | pbcopy"