From a214856adc93e678e0fd14b2eb624fc45af05c9e Mon Sep 17 00:00:00 2001 From: bryango Date: Thu, 23 Mar 2023 10:17:32 +0800 Subject: [PATCH 1/4] Update README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 939db85b6054..412ab905b17b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ # aur.git This is an experimental mirror of the aur.git repository backing [the AUR](https://aur.archlinux.org). + +**This is a fork,** to host personalizations of packages. + +## as a remote of `~/.cache/yay/$PKG` + +Example `.git/config` of `~/.cache/yay/texlive-installer`: + +```gitconfig +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true +[remote "origin"] + url = https://aur.archlinux.org/texlive-installer.git + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master +## ... above generated by yay +## ... below added by user +[remote "p13n"] + url = git@github.com:bryango/aur.git + fetch = +refs/heads/texlive-installer:refs/remotes/p13n/texlive-installer ## restrict fetch heads + push = p13n/texlive-installer ## push to branch: texlive-installer +[remote] + pushdefault = p13n ## push to remote: p13n +``` From a9bef6cec0ad494dc2f27f91c1275c6060a6b582 Mon Sep 17 00:00:00 2001 From: bryango Date: Sun, 25 Jun 2023 22:37:06 +0800 Subject: [PATCH 2/4] Fix .git/config in README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 412ab905b17b..91686eb1b57e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Example `.git/config` of `~/.cache/yay/texlive-installer`: [remote "p13n"] url = git@github.com:bryango/aur.git fetch = +refs/heads/texlive-installer:refs/remotes/p13n/texlive-installer ## restrict fetch heads - push = p13n/texlive-installer ## push to branch: texlive-installer + push = master:texlive-installer ## push to branch: texlive-installer [remote] - pushdefault = p13n ## push to remote: p13n + pushdefault = p13n ## push to remote: p13n ``` From 8584fa379a08cf4af1c02f8f8292af6f06d7f3c1 Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Wed, 9 Aug 2023 00:56:51 +0800 Subject: [PATCH 3/4] Add AUR clone script (to be extended) --- .gitignore | 4 ++++ git-clone-aur.sh | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .gitignore create mode 100755 git-clone-aur.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..f479c756ff76 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/* + +!.gitignore +!git-clone-aur.sh diff --git a/git-clone-aur.sh b/git-clone-aur.sh new file mode 100755 index 000000000000..5ada06fb31cb --- /dev/null +++ b/git-clone-aur.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -x + +BRANCH=$1 +REPO=$2 + +if [[ -z $1 ]]; then bat "$0"; exit; fi +[[ -z $2 ]] && REPO=bryango/aur + +git clone \ + --filter=blob:none \ + --branch="$BRANCH" \ + --single-branch \ + "git@github.com:$REPO.git" \ + "$(basename "$REPO" | sed -e 's/^arch-//g')-$(basename "$BRANCH")" From 2a0179ecfb3992cbd8111e82296ab3b5aa044749 Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Wed, 9 Aug 2023 01:13:33 +0800 Subject: [PATCH 4/4] Update script: prepare commit to be forked --- git-clone-aur.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/git-clone-aur.sh b/git-clone-aur.sh index 5ada06fb31cb..2731cf25ace9 100755 --- a/git-clone-aur.sh +++ b/git-clone-aur.sh @@ -4,13 +4,27 @@ set -x BRANCH=$1 REPO=$2 +UPSTREAM=$3 if [[ -z $1 ]]; then bat "$0"; exit; fi [[ -z $2 ]] && REPO=bryango/aur +[[ -z $2 ]] && UPSTREAM=archlinux/aur -git clone \ +target="$(basename "$REPO")-$(basename "$BRANCH")" +origin="git@github.com:$REPO.git" +upstream="git@github.com:$UPSTREAM.git" + +if git clone \ --filter=blob:none \ --branch="$BRANCH" \ --single-branch \ - "git@github.com:$REPO.git" \ - "$(basename "$REPO" | sed -e 's/^arch-//g')-$(basename "$BRANCH")" + "$origin" "$target" +then + exit +fi + +## otherwise, +set -xe +commit=$(git ls-remote "$upstream" "$BRANCH" | cut -f1) +echo "$BRANCH" +open "https://github.com/$REPO/tree/$commit"