Skip to content

Commit

Permalink
wip: add refspec for clean fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Feb 26, 2024
1 parent 90ae850 commit 7de246e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
10 changes: 10 additions & 0 deletions apps/nvfetcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ fetch.github = "frappe/bench"
src.git = "https://github.com/frappe/frappe"
fetch.github = "frappe/frappe"

[frappe.passthru]
since = "version-13"
upstream = """
URL: https://github.com/frappe/frappe
Pull: +refs/heads/develop:refs/remotes/upstream/develop
Pull: +refs/heads/version-15:refs/remotes/upstream/version-15
Pull: +refs/heads/version-15-hotfix:refs/remotes/upstream/version-15-hotfix
Pull: +refs/tags/v15.*:refs/remotes/upstream/tags/v15.*
"""

[erpnext]
# src.github= "frappe/erpnext" -- 2024-02-17 - frappe patch doesn't apply and frappe 16 is not compatible with erpnext 15
src.git = "https://github.com/frappe/erpnext"
Expand Down
11 changes: 7 additions & 4 deletions apps/sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,21 @@
"name": null,
"owner": "frappe",
"repo": "erpnext",
"rev": "08caa7cfa15912f8b45d97088fed30c32e55db29",
"sha256": "sha256-eofJ+Cy87BrZ1LD9NiqImFNBDQoLonLfb6BQ19EKYrk=",
"rev": "8aa2b7c1838e2af39f73557a0359313e76032197",
"sha256": "sha256-yPWUPvzsXBV1A63Nq6ehUz1Y4oK5pKyMZ9vVLloY0TU=",
"type": "github"
},
"version": "08caa7cfa15912f8b45d97088fed30c32e55db29"
"version": "8aa2b7c1838e2af39f73557a0359313e76032197"
},
"frappe": {
"cargoLocks": null,
"date": "2024-02-26",
"extract": null,
"name": "frappe",
"passthru": null,
"passthru": {
"since": "version-13",
"upstream": "URL: https://github.com/frappe/frappe\nPull: +refs/heads/develop:refs/remotes/upstream/develop\nPull: +refs/heads/version-15:refs/remotes/upstream/version-15\nPull: +refs/heads/version-15-hotfix:refs/remotes/upstream/version-15-hotfix\nPull: +refs/tags/v15.*:refs/remotes/upstream/tags/v15.*\n"
},
"pinned": false,
"src": {
"deepClone": false,
Expand Down
8 changes: 5 additions & 3 deletions apps/sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
};
erpnext = {
pname = "erpnext";
version = "08caa7cfa15912f8b45d97088fed30c32e55db29";
version = "8aa2b7c1838e2af39f73557a0359313e76032197";
src = fetchFromGitHub {
owner = "frappe";
repo = "erpnext";
rev = "08caa7cfa15912f8b45d97088fed30c32e55db29";
rev = "8aa2b7c1838e2af39f73557a0359313e76032197";
fetchSubmodules = false;
sha256 = "sha256-eofJ+Cy87BrZ1LD9NiqImFNBDQoLonLfb6BQ19EKYrk=";
sha256 = "sha256-yPWUPvzsXBV1A63Nq6ehUz1Y4oK5pKyMZ9vVLloY0TU=";
};
date = "2024-02-26";
};
Expand All @@ -45,6 +45,8 @@
fetchSubmodules = false;
sha256 = "sha256-ly6dopRikmqrDG4yGlBpqDvgchWOqoynDM+jmgh9SOg=";
};
upstream = "URL: https://github.com/frappe/frappe\nPull: +refs/heads/develop:refs/remotes/upstream/develop\nPull: +refs/heads/version-15:refs/remotes/upstream/version-15\nPull: +refs/heads/version-15-hotfix:refs/remotes/upstream/version-15-hotfix\nPull: +refs/tags/v15.*:refs/remotes/upstream/tags/v15.*\n";
since = "version-13";
date = "2024-02-26";
};
gameplan = {
Expand Down
1 change: 1 addition & 0 deletions src/overlays/frappe/frappe.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ buildPythonPackage rec {
];

passthru = rec {
pin = frappe;
packages = with pkgs; [
mysql
restic
Expand Down
17 changes: 9 additions & 8 deletions src/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,16 @@ in {
text = let
clone = app: ''
if [[ ! -d "$PRJ_ROOT/apps/${app.pname}" ]]; then
git clone --config "diff.fsjd.command=fsjd --git" --single-branch --branch "${app.src.src.rev}" \
--origin upstream --depth 1 "${app.src.src.gitRepoUrl}" \
git clone --config "diff.fsjd.command=fsjd --git" \
--origin upstream --shallow-exclude="${app.pin.since}" "${app.pin.src.gitRepoUrl}" \
"$PRJ_ROOT/apps/${app.pname}"
(
cd "$PRJ_ROOT/apps/${app.pname}";
git switch -c custom
diff -uraN ${app.src} "$PRJ_ROOT/apps/${app.pname}" | patch
find . -type f -iname "*.orig" -delete
git add .
git commit -m "FRAPPIX START" --no-verify --allow-empty --no-gpg-sign
mkdir .git/remotes;
echo "${app.pin.upstream}" > .git/remotes/upstream;
git switch -c custom;
(diff -ura $PRJ_ROOT/apps/${app.pname} ${app.src} | patch --strip 4) || true;
git add . && git commit -m 'FRAPPIX START' --no-verify --allow-empty --no-gpg-sign
yarn --silent || true
)
relpath="$(realpath --relative-to=`pwd` $PRJ_ROOT/apps/${app.pname})"
Expand Down Expand Up @@ -220,12 +220,13 @@ in {
inherit package;
};
in [
(devPackage pkgs.frx)
(devPackage pkgs.pre-commit)
(devPackage pkgs.nvfetcher)
(devPackage pkgs.nodePackages.localtunnel)
(devPackage pkgs.frx)
(devPackage pkgs.bench)
(devPackage pkgs.apps)
(devPackage pkgs.yarn)
];
};
};
Expand Down

0 comments on commit 7de246e

Please sign in to comment.