Skip to content

Commit

Permalink
Handle the lack of OOT patches
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtbahartr committed Dec 25, 2024
1 parent 2ea86f1 commit 1c63258
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ https://github.com/dianaw353/dotfiles/releases/tag/V1.1.8.3
**Script**
- Miscallenous improvements to the preinstall script
- Lint the script using shellcheck and fix the syntax warnings accordingly.
- Handle the OOT patches during git-based upgrades properly.

**Fixes**
- Hyprland: The Hyprlock skin would render incorrectly with resolutions other than 1080p.
Expand Down
14 changes: 11 additions & 3 deletions dotfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,23 @@ function clone_repository {
_cmd "cd $DOTFILES_DIR" 3 2 "Failed to enter into existing dotfiles directory."
_cmd "git fetch $REPO_URL $REPO_BRANCH" 3 2 "Failed to fetch the latest changes on the requested release."
_task "Backing up out-of-tree patches"
_cmd "git stash" 3 2 "Failed to stash uncommitted changes."
stashed=0
if [[ "$(git diff)" != "" ]]; then
_cmd "git stash" 3 2 "Failed to stash uncommitted changes."
stashed=1
fi
_cmd "git format-patch -o oot_patches origin/$(git branch --show-current)" 3 2 "Failed to create patch files for out-of-tree commits."
_task "Performing an in-place upgrade"
_cmd "git checkout FETCH_HEAD" 3 2 "Failed to checkout to the requested release."
_cmd "git branch -f $REPO_BRANCH" 3 2 "Failed to create the target branch."
_cmd "git checkout $REPO_BRANCH" 3 2 "Failed to switch to the target branch."
_task "Restoring out-of-tree patches"
_cmd "git am --empty=drop oot_patches/*.patch" 1 0 "Failed to apply out-of-tree patches. You might have conflicts in your working tree. Use git-status and fix the conflicts."
_cmd "git stash pop" 1 0 "Failed to reapply the uncommitted changes. You might have conflicts in your working tree. Use git-status and fix the conflicts."
if [[ -f "oot_patches/*.patch" ]]; then
_cmd "git am --empty=drop oot_patches/*.patch" 1 0 "Failed to apply out-of-tree patches. You might have conflicts in your working tree. Use git-status and fix the conflicts."
fi
if [[ $stashed -eq 1 ]]; then
_cmd "git stash pop" 1 0 "Failed to reapply the uncommitted changes. You might have conflicts in your working tree. Use git-status and fix the conflicts."
fi
_task "Cleaning up"
_cmd "rm -rf oot_patches" 3 2 "Failed to delete the temporary directory for out-of-tree patches."
fi
Expand Down

0 comments on commit 1c63258

Please sign in to comment.