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

misc: Add wget-pr.sh script #1808

Merged
merged 1 commit into from Sep 2, 2023

Conversation

honggyukim
Copy link
Collaborator

GitHub provides an easy way to download the patches of PR by adding .patch postfix to the URL of PR.

This patch adds a simple script that can download the patch of the given pull request.

The usage is simple as follows.

  $ ./misc/wget-pr.sh
  usage: ./misc/wget-pr.sh <PR number>

If you want to download the patch of the PR number 1526, then it can be used as follows.

  $ ./misc/wget-pr.sh 1526
  --2023-08-27 07:04:48--  https://github.com/namhyung/uftrace/pull/1526.patch
      ...
  Saving to: ‘1526.patch’

  1526.patch              [ <=>                ]   5.47K  --.-KB/s    in 0s

  2023-08-27 07:04:48 (22.2 MB/s) - ‘1526.patch’ saved [5601]

Then simply apply the 1526.patch file by running 'git am'.

  $ git am 1526.patch
  Applying: record: Do not initialize when libmcount.so is explictly linked

GitHub provides an easy way to download the patches of PR by adding
.patch postfix to the URL of PR.

This patch adds a simple script that can download the patch of the given
pull request.

The usage is simple as follows.

  $ ./misc/wget-pr.sh
  usage: ./misc/wget-pr.sh <PR number>

If you want to download the patch of the PR number 1526, then it can be
used as follows.

  $ ./misc/wget-pr.sh 1526
  --2023-08-27 07:04:48--  https://github.com/namhyung/uftrace/pull/1526.patch
      ...
  Saving to: ‘1526.patch’

  1526.patch              [ <=>                ]   5.47K  --.-KB/s    in 0s

  2023-08-27 07:04:48 (22.2 MB/s) - ‘1526.patch’ saved [5601]

Then simply apply the 1526.patch file by running 'git am'.

  $ git am 1526.patch
  Applying: record: Do not initialize when libmcount.so is explictly linked

Signed-off-by: Honggyu Kim <honggyu.kp@gmail.com>
@honggyukim
Copy link
Collaborator Author

This script works when the PR contains multiple split commits. The git am applies multiple patches without a problem.

Copy link
Owner

@namhyung namhyung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@honggyukim honggyukim merged commit 12cf881 into namhyung:master Sep 2, 2023
3 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants