From 40235a26bb0db1fce5b88d4e6c89222e558ac42d Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Sat, 19 Apr 2025 21:56:50 -0400 Subject: [PATCH] attempt to re-add pkg install feature by programatically reverting commits --- restore-pkg.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 restore-pkg.md diff --git a/restore-pkg.md b/restore-pkg.md new file mode 100644 index 000000000..b7ba06fb8 --- /dev/null +++ b/restore-pkg.md @@ -0,0 +1,65 @@ +commit IDs that you've mentioned for restoring removed files: + +be22674f8c1ac84e1cff89947ff4a6753070f21b +31e1d4f839118b59398ca6f871929fc0e286e13c +751a23af0f5a9612b8e28af1400896a3026ee331 +9dbc79dc96a4cf439adbead5563e46d1eb301391 +a5958bf7f0da207e02065a88355b8afae0b5e256 + + +These are the commits from which we're trying to restore deleted files in your repository. + + +``` +# Reset to a clean state for our branch +git reset --hard HEAD + +# Extract ONLY the filenames (without the extra metadata) +git show be22674f8c1ac84e1cff89947ff4a6753070f21b --name-status | grep ^D | cut -f2- > deleted_commit1.txt +git show 31e1d4f839118b59398ca6f871929fc0e286e13c --name-status | grep ^D | cut -f2- > deleted_commit2.txt +git show 751a23af0f5a9612b8e28af1400896a3026ee331 --name-status | grep ^D | cut -f2- > deleted_commit3.txt +git show 9dbc79dc96a4cf439adbead5563e46d1eb301391 --name-status | grep ^D | cut -f2- > deleted_commit4.txt +git show a5958bf7f0da207e02065a88355b8afae0b5e256 --name-status | grep ^D | cut -f2- > deleted_commit5.txt + +# Review the files to make sure they look correct +cat deleted_commit1.txt +cat deleted_commit2.txt +cat deleted_commit3.txt +cat deleted_commit4.txt +cat deleted_commit5.txt + +# Now restore each file individually to avoid errors with empty files +while read file; do + if [[ -n "$file" ]]; then + git checkout be22674f8c1ac84e1cff89947ff4a6753070f21b~1 -- "$file" + fi +done < deleted_commit1.txt + +while read file; do + if [[ -n "$file" ]]; then + git checkout 31e1d4f839118b59398ca6f871929fc0e286e13c~1 -- "$file" + fi +done < deleted_commit2.txt + +while read file; do + if [[ -n "$file" ]]; then + git checkout 751a23af0f5a9612b8e28af1400896a3026ee331~1 -- "$file" + fi +done < deleted_commit3.txt + +while read file; do + if [[ -n "$file" ]]; then + git checkout 9dbc79dc96a4cf439adbead5563e46d1eb301391~1 -- "$file" + fi +done < deleted_commit4.txt + +while read file; do + if [[ -n "$file" ]]; then + git checkout a5958bf7f0da207e02065a88355b8afae0b5e256~1 -- "$file" + fi +done < deleted_commit5.txt + +# Add and commit all restored files +git add . +git commit -m "Restore files removed in commits be22674, 31e1d4f, 751a23a, 9dbc79d, and a5958bf" +``` \ No newline at end of file