Skip to content

Add gg.cmd run-pr xyz #115

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

Merged
merged 19 commits into from
May 31, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions _posts/2025-05-31-run-pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Try out any JabRef pull request
---

Thanks to the strong ecosystem of Java, one can easily try out (nearly) any JabRef pull request.
For instance, to try out the "[initial implementation of walkthrough](https://github.com/JabRef/jabref/pull/13182)", one needs to execute following command:

```cmd
.\gg.cmd just run-pr 13182
```

As preparation, one needs to clone JabRef's source code and download [`gg.cmd`](https://github.com/eirikb/gg) and place it into the cloned source code directory.

The preparation is also simplified by `gg.cmd`.

1. [Download `gg.cmd`](https://github.com/eirikb/gg/releases/latest/download/gg.cmd)
2. Execute `.\gg.cmd jbang https://github.com/JabRef/jabref/blob/main/.jbang/CloneJabRef.java`. This will clone JabRef into a temporary folder.

1. Initialization\
![gg initialization](../img/gg-init.png)
2. JBang will ask for trust - please trust the script with <kbd>2</kbd> and then <kbd>Enter</kbd>\
![JBang confirmation](../img/gg-jbang-confirmation.png)
3. Clone happens\
![gg-jabref-clone](../img/gg-jabref-clone.png)

3. After it finishes, it will output the directory:

```text
JabRef code available at: C:\Users\koppor\AppData\Local\Temp\jabref
```

4. Go to the directory: `cd C:\Users\koppor\AppData\Local\Temp\jabref` (Note - replace "`koppor`" with your username).
5. Move `gg.cmd` to here: `move C:\Users\koppor\Downloads\gg.cmd .`. (Note - replace "`koppor`" with your username. The path also needs to be changed if you have downloaded `gg.cmd` anywhere else).
6. Now you can run a PR using `.\gg.cmd just run-pr 13182` (replace 13182 with the PR number of whichever PR you want to try out). Initially, this might take several minutes, as the build environment has to be initialized and JabRef is build completely from scratch. You will also need to tell JBang to trust JabRef's code. In later runs the run will be faster.

## Troubleshooting

For Linux and macOS, use `sh ./gg.cmd` instead of `.\gg.cmd`.

You might get "error: No justfile found"

```monospace
just gui
error: No justfile found
error: Recipe `run-pr` failed on line 21 with exit code 1
Unable to execute
```

Then, the pull request has not merged recent `main`.
You need to "manually" start:

```cmd
.\gg.cmd gradle :jabgui:run
```

## More Information

More information is available in our [contributing guide](https://docs.jabref.org/contributing#i-would-like-to-try-out-a-feature-introduced-at-pull-request).
Binary file added img/gg-init.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/gg-jabref-clone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/gg-jbang-confirmation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.