This message was deleted.
# feature-requests
s
This message was deleted.
1
j
If they do not use graphite, the link should show an interstitial that directs them to GitHub. We don't plan on changing this behavior
v
But you can click the link and then get the GitHub link from the web UI by click menu and shortcut 🙂
a
I think it's not great - would love to have an option to change this even if just for OSS repositories.
This is great for increasing attach rate and growth, I'm sure, but it's not welcoming to send to someone who wants to see a PR fixing their issue.
j
We are doing our best to ensure there continues to be a Graphite
To be candid, we are primarily focused on the at-work use case over open source for the near term
b
I understand that providing a flag to output github links is something you're not currently willing to consider. But I'd push back on the argument that an optional flag (maybe don't even document it in the online docs) would cause Graphite to make less money. If anything, better interoperability means that Graphite gets the business of employees at companies that aren't willing or able to fully switch over to Graphite 100%.
1
v
Hope, that the client gets reexposed as open source like it was, then you can use a modified version. :-) You could also use a wrapper around that translates the links.
b
Yeah, one of these days I'll sit down and type out some bash monstrosity, but it'll be brittle -- it'll break if the output of
gt
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.
v
Copy code
gt bi | grep -F app.graphite.dev | sed 's!^<https://app>\.graphite\.dev/github/pr/\([^/]\+\)/\([^/]\+\)/\([^/]\+\)\(/.*\)\?!<https://github.com/>\1/\2/pull/\3!'
👍 1
Or the same
sed
in a wrapper around
sed
to replace all Graphite links by GitHub links in the output
b
I wish I knew bash better 🙃
Trying this, but I'm probably missing something really obvious and bashy
Copy code
gt bi | grep -F app.graphite.dev | sed 's!^<https://app>\.graphite\.dev/github/pr/\([^/]\+\)/\([^/]\+\)/\([^/]\+\)\(/.*\)\?!<https://github.com/>\1/\2/pull/\3!' | pbcopy
v
That command has zero to do with bash.
What is your issue with it?
b
it doesn't copy to my clipboard
gt 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 either
(I'm using fish shell btw)
v
Again, nothing in that command is in any way specific to any shell, you can even use it in cmd.exe on Windows if you have the tools in the path
Then reduce it further, start with "gt bi", maybe it tells you you are not on a branch currently
If not and the URL is printed, add the grep to see whether the graphite url is printed
b
ah apologies, you're right
it's broken in a different way now
👌 1
it outputs the graphite link, not the github link
so something about the regex isn't working with my repo links
v
Can you show me the gt link?
v
Seems your
sed
behaves differently:
Copy code
$ 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>
b
hmm
MacOS 13.4.1,
/usr/bin/sed
v
No idea, I would never use an Apple OS on any device if I can prevent it
b
lol
fascinating, okay, well thanks for validating that I'm not crazy. I'll see if I can find something about this.
and thank you for the help with that command!
j
works on my mac
v
Do you maybe have something like an alias that makes
sed ...
really
sed -E ...
or something similar, changing the regex syntax from default
Try with fully-qualified
/usr/bin/sed
Or type
alias sed
if it is in fish like in bash
The regex is really just basic regex without any GNU specifics used or anything, so should actually work on any sed-variant unless you change the accepted syntax with things like
-E
or
-r
or whatever your version of
sed
supports
Or install GNU sed from Homebrew or MacPorts 🙂
b
I don't have an alias, and
/usr/bin/sed
has the same behavior
v
Then I'm out of ideas from remote, especially as it works on Jacobs Mac (thanks for checking by the way)
b
so bizarre
Yes, Thanks Jacob! I appreciate the help!
I wonder @Jacob Gold if you have a different sed. I just confirmed that this doesn't work for another of my colleagues who is on MacOS.
Obviously don't spend time on this, but if it's possible you directly or indirectly installed gnu-sed, that'd be helpful to know
Also, got it working:
Copy code
echo '<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|'
👌 1
For anyone who wants them, my final fish aliases are:
Copy code
# 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"