Sfoglia il codice sorgente

Switch to subtrees

Willy-JL 2 anni fa
parent
commit
a0c9700a65

+ 2 - 0
.gitconfig

@@ -0,0 +1,2 @@
+[alias]
+    update-subtree = "!f() { git subtree pull -P $GIT_PREFIX $(<${GIT_PREFIX}.gitremote); }; f"

+ 0 - 5
.gitremotes

@@ -1,5 +0,0 @@
-# [remote "upstream"]
-#     url = https://github.com/username/repository
-#     fetch = +refs/heads/*:refs/remotes/repository/*
-# [alias]
-#     merge-upstream = pull --no-edit upstream branch

+ 1 - 0
.modules/good-faps/.gitremote

@@ -0,0 +1 @@
+https://github.com/flipperdevices/flipperzero-good-faps dev

+ 0 - 5
.modules/good-faps/.gitremotes

@@ -1,5 +0,0 @@
-[remote "upstream"]
-        url = https://github.com/flipperdevices/flipperzero-good-faps
-        fetch = +refs/heads/*:refs/remotes/flipperzero-good-faps/*
-[alias]
-    merge-upstream = pull --no-edit upstream dev

+ 1 - 0
.modules/mayhem/.gitremote

@@ -0,0 +1 @@
+https://github.com/eried/flipperzero-mayhem next

+ 0 - 5
.modules/mayhem/.gitremotes

@@ -1,5 +0,0 @@
-[remote "upstream"]
-    url = https://github.com/eried/flipperzero-mayhem
-    fetch = +refs/heads/*:refs/remotes/mayhem/*
-[alias]
-    merge-upstream = pull --no-edit upstream next

+ 11 - 8
README.md

@@ -13,11 +13,14 @@ Apps we use for Xtreme are all modified (some lots more than others). This inclu
 - **Updating and fixing apps** that were abandoned by the original developers
 
 ### How?
-**Apps made by the Xtreme team are just kept as code in the main branch. Others instead come from elsewhere and need tweaks applied.**
-Due to how Git works we can't just make edits in a submodule and publish it as a signle repo like that.
-Our changes need to be committed and tracked somewhere, but we didn't want to have a fork repo for each app.
-Instead we use **fork *branches*:tm:** where the **code for the apps is in branches** of this same repo and the **main branch has submodules to other branches** this same repo.
-As for pulling updates from the upstream repositories, remotes are not kept when pushing and cloning, so we use a modular system:
-- set it up by running `git config --local include.path ../.gitremotes` (this makes your git config import the file `.gitremotes`)
-- each app branch has a `.gitremotes` file which contains configuration for its `upstream` remote
-- this also has an alias for merging upstream updates with the correct ref by `git merge-upstream`
+**Apps made by the Xtreme team are kept as plain code here. For all others we use git subtrees to pull updates from elsewhere but also keep our own tweaks.**
+We didn't want to have fork repos for each single app since it would get out of hand very quick. Instead, we opted for subtrees.
+
+Subtrees work in a very peculiar way, where they pull and compare commit history from a remote repo and apply it to a subdirectory of this repo.
+That's why the commit history for our repo is so huge, it contains all the commits for all the apps, plus our edits.
+
+To make updating more manageable, we have added another layer on top of subtrees:
+- each remote app/repo has a `.gitremote` file that indicates the remote url and branch name
+- we have a git alias `update-subtree` for pulling updates based on the current directory (set it up by running `git config --local include.path ../.gitconfig`)
+- run `git update-subtree` in each subtree folder to update it
+- or run `find . -name .gitremote -execdir git update-subtree \;` to run it on all subtrees

+ 1 - 0
esp_flasher/.gitremote

@@ -0,0 +1 @@
+https://github.com/0xchocolate/flipperzero-esp-flasher main

+ 0 - 5
esp_flasher/.gitremotes

@@ -1,5 +0,0 @@
-[remote "upstream"]
-    url = https://github.com/0xchocolate/flipperzero-esp-flasher
-    fetch = +refs/heads/*:refs/remotes/esp-flasher/*
-[alias]
-    merge-upstream = pull --no-edit upstream main

+ 1 - 0
multi_fuzzer/.gitremote

@@ -0,0 +1 @@
+https://github.com/DarkFlippers/Multi_Fuzzer dev

+ 0 - 5
multi_fuzzer/.gitremotes

@@ -1,5 +0,0 @@
-[remote "upstream"]
-    url = https://github.com/DarkFlippers/Multi_Fuzzer
-    fetch = +refs/heads/*:refs/remotes/multi-fuzzer/*
-[alias]
-    merge-upstream = pull --no-edit upstream dev

+ 1 - 0
sentry_safe/.gitremote

@@ -0,0 +1 @@
+https://github.com/H4ckd4ddy/flipperzero-sentry-safe-plugin master

+ 0 - 5
sentry_safe/.gitremotes

@@ -1,5 +0,0 @@
-[remote "upstream"]
-    url = https://github.com/H4ckd4ddy/flipperzero-sentry-safe-plugin
-    fetch = +refs/heads/*:refs/remotes/sentry-safe/*
-[alias]
-    merge-upstream = pull --no-edit upstream master

+ 1 - 0
subghz_bruteforcer/.gitremote

@@ -0,0 +1 @@
+https://github.com/DarkFlippers/flipperzero-subbrute master

+ 0 - 5
subghz_bruteforcer/.gitremotes

@@ -1,5 +0,0 @@
-[remote "upstream"]
-    url = https://github.com/DarkFlippers/flipperzero-subbrute
-    fetch = +refs/heads/*:refs/remotes/subghz-bruteforcer/*
-[alias]
-    merge-upstream = pull --no-edit upstream master