Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open the "files" tab view of a PR ? #298

Open
drupol opened this issue Jul 28, 2023 · 4 comments
Open

Open the "files" tab view of a PR ? #298

drupol opened this issue Jul 28, 2023 · 4 comments

Comments

@drupol
Copy link

drupol commented Jul 28, 2023

Hi!

I'm doing a lot of code review within the NixOS project and I was wondering if it would be possible to have a shortcut that open a PR but in the "files" tab view (url ending with /files).

Currently, I use the o shortcut to open the PR but then it requires an extra click on the files tab so I can make the review.

Since it is not possible to make inline reviews inside gh-dash, this would definitely be useful for me and most probably some others too.

Thanks!

@dlvhdr
Copy link
Owner

dlvhdr commented Jul 29, 2023

Hi, yes this is possible. See the section about custom key binds. You can override the o keybind to run gh pr open with maybe the json arg and then pipe it to jq or something like that.

@drupol
Copy link
Author

drupol commented Jul 29, 2023

Hi, yes this is possible. See the section about custom key binds. You can override the o keybind to run gh pr open with maybe the json arg and then pipe it to jq or something like that.

I tried:

key: o
command: |
  open $(gh pr view {{.PrNumber}} --json url -q ".url + \"/files\"")

But this doesn't seems to work. Do you another clue?

@dlvhdr
Copy link
Owner

dlvhdr commented Sep 10, 2023

This works for me:

    - key: o
      command: open $(gh pr view 244 --json url | jq -r '.url')/files

There's probably something going on when trying to subtitue the 244 with the {{.PrNumber}} variable

@drupol
Copy link
Author

drupol commented Sep 10, 2023

We should add this option in gh-dash perhaps then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants