Skip to content

Commit 405ddf0

Browse files
committed
Merge mhutchie#637, Upgrade TypeScript to 4.9.5, Fix Build & Tests
1 parent 13b4a46 commit 405ddf0

10 files changed

Lines changed: 6475 additions & 17 deletions

File tree

fetch-upstream-prs.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
set -e
3+
4+
UPSTREAM_REPO="mhutchie/vscode-git-graph"
5+
JSON_FILE="/tmp/upstream_prs_details.json"
6+
7+
# Check if JSON file exists, if not generate it
8+
if [ ! -f "$JSON_FILE" ]; then
9+
echo "🔍 Fetching open PRs from $UPSTREAM_REPO..."
10+
gh pr list --repo "$UPSTREAM_REPO" --limit 100 --state open \
11+
--json number,title,author,headRefName \
12+
> "$JSON_FILE"
13+
fi
14+
15+
echo "✅ Loading PRs from $JSON_FILE..."
16+
count=0
17+
18+
# Loop through PRs and fetch them
19+
jq -c '.[]' "$JSON_FILE" | while read -r pr; do
20+
number=$(echo "$pr" | jq -r '.number')
21+
title=$(echo "$pr" | jq -r '.title')
22+
author=$(echo "$pr" | jq -r '.author.login')
23+
24+
# Sanitize branch name
25+
safe_title=$(echo "$title" | sed -e 's/[^A-Za-z0-9._-]/_/g' | cut -c 1-30)
26+
branch_name="upstream/pr-${number}-${author}"
27+
28+
echo "⬇️ Fetching PR #$number ($title) -> $branch_name"
29+
30+
# Fetch the pull request head to a local branch
31+
if git fetch upstream pull/$number/head:$branch_name; then
32+
echo " ✅ Fetched successfully"
33+
else
34+
echo " ❌ Failed to fetch"
35+
fi
36+
37+
count=$((count + 1))
38+
done
39+
40+
echo ""
41+
echo "🎉 Fetched $count PRs into local branches."
42+
echo "💡 You can now checkout these branches and merge them into your master."
43+
echo " Example: git checkout upstream/pr-910-MatriQ && git merge master"

0 commit comments

Comments
 (0)