Comments (8)
The history re-write is done. Please clone from the current repository
from basic-computer-games.
OK! I cloned the repo from scratch and it looks good to me! Thank you!
from basic-computer-games.
If I should do it, I would give @AlaaSarhan time until Monday to finish #404 . If possible, I would like to prevent open PRs.
Should I do it? Does it sound good to wait until #404 is merged / Monday (whatever is earlier)?
from basic-computer-games.
Sure! Sounds good to me.
from basic-computer-games.
from basic-computer-games.
Git History Rewrite
I propose to do the following:
- Clarify if we need the
buildJvm
directory (discussion) and maybe adjust what gets deleted from the git history - Merge all current branches - or ask the people to copy their changes
- Delete all local branches:
git branch -D $(git branch)
- Create backup:
git bundle create backup.bundle --all
- Rewrite the history (see below - I recommend the automatic way with this list of files to delete)
- Clean up git repo:
git gc --aggressive --prune=now
- Force-push!!!! Now everybody needs to fork / clone again!
⚠️ - Ask contributors to (1) delete their fork / repository (2) fork again (3) clone again
Maybe we should also disable force-pushes on main
after that in the Github settings?
History Rewrite Option 1: Manual
git filter-branch --prune-empty -d /dev/shm/scratch \
--index-filter "git rm --cached -f --ignore-unmatch '39 Golf/csharp/compiled/windows_x86/golf.exe'" \
--tag-name-filter cat -- --all
git filter-branch -f --prune-empty -d /dev/shm/scratch \
--index-filter "git rm --cached -f --ignore-unmatch '39 Golf/csharp/compiled/linux_x86/golf'" \
--tag-name-filter cat -- --all
git filter-branch -f --prune-empty -d /dev/shm/scratch \
--index-filter "git rm --cached -f --ignore-unmatch '89_Tic-Tac-Toe/python/TicTacToe_exe/TicTacToe.exe'" \
--tag-name-filter cat -- --all
git filter-branch -f --prune-empty -d /dev/shm/scratch \
--index-filter "git rm --cached -f --ignore-unmatch '53_King/kotlin/king.jar'" \
--tag-name-filter cat -- --all
git filter-branch -f --prune-empty -d /dev/shm/scratch \
--index-filter "git rm --cached -f --ignore-unmatch 'buildJvm/build_53_King_kotlin/build/install/build_53_King_kotlin/lib/kotlin-stdlib-1.6.0.jar'" \
--tag-name-filter cat -- --all
git filter-branch -f --prune-empty -d /dev/shm/scratch \
--index-filter "git rm --cached -f --ignore-unmatch '08 Batnum/vbnet/.vs/batnum/DesignTimeBuild/.dtbcache.v2'" \
--tag-name-filter cat -- --all
git filter-branch -f --prune-empty -d /dev/shm/scratch \
--index-filter "git rm --cached -f --ignore-unmatch '89_Tic-Tac-Toe/python/TicTacToe_exe/assets/tie.png'" \
--tag-name-filter cat -- --all
History Rewrite Option 2: Automatic
Delete all files from the history that are no longer there. I'm uncertain what happens with files that were moved!
# Install git-filter repo; several options: https://github.com/newren/git-filter-repo/blob/main/INSTALL.md
pip install git-filter-repo
# Run it
git filter-repo --analyze
# Create a list of all files that should get deleted
tail +3 .git/filter-repo/analysis/path-deleted-sizes.txt \
| tr -s ' ' \
| cut -d ' ' -f 5- \
> .git/filter-repo/analysis/path-deleted.txt
# Before you do this, you can check if there are things you want to keep
git filter-repo --invert-paths --paths-from-file .git/filter-repo/analysis/path-deleted.txt --force
rm -rf .git/filter-repo
Alternatively, you could use this path-deleted.txt
. I've removed all lines that match
(\.pl|\.py|\.cs|\.java|\.md|\.bas|\.rb|\.gitignore|\.rs|\.js|\.vb|\.sln|\.txt|\.html|\.csproj|\.vbproj|\.kt)$
from basic-computer-games.
The effect of this:
$ ls -lh
74M backup.bundle
3,4M repo-after-history-rewrite-and-clean-manual-deletion.bundle
3,1M repo-after-history-rewrite-and-clean-automatic-deletion.bundle
When you now execute this snippet you can see:
2e07bb068f29 41KiB 01_Acey_Ducey/rust/target/debug/incremental/rust-8frg64vi8djd/s-g737sgtzl9-gc3nmb-ydny6jjnqtbz/dep-graph.bin
6557ca9f5546 42KiB 00_Alternate_Languages/88_3-D_Tic-Tac-Toe/csharp/Qubic.cs
595db6616bd6 43KiB 88_3-D_Tic-Tac-Toe/csharp/Qubic.cs
a01944e199e2 43KiB 88_3-D_Tic-Tac-Toe/csharp/Qubic.cs
513651d6a5e4 44KiB 88_3-D_Tic-Tac-Toe/csharp/Qubic.cs
9a4573c62152 48KiB 84_Super_Star_Trek/javascript/superstartrek.mjs
b8ecb9343b12 49KiB 84_Super_Star_Trek/java/SuperStarTrekGame.java
213b2a0b8d38 49KiB 84_Super_Star_Trek/java/SuperStarTrekGame.java
7454180f2ae8 58KiB buildJvm/gradle/wrapper/gradle-wrapper.jar
ea71f1cf7903 58KiB 00_Alternate_Languages/01_Acey_Ducey/elm/package-lock.json
6fe43fa79007 115KiB 75_Roulette/perl/roulette-test.t
d2946a198344 125KiB 00_Alternate_Languages/01_Acey_Ducey/elm/docs/app.js
ccf0500fd14b 196KiB buildJvm/build_53_King_kotlin/build/install/build_53_King_kotlin/lib/kotlin-stdlib-common-1.6.0.jar
In case we don't need the buildJvm folder, we could reduce the allowed file size from 1MB to 200 KB.
from basic-computer-games.
I think we have definitely decided we don't want any build or IDE specific files in the repo, so proceed accordingly there...
from basic-computer-games.
Related Issues (20)
- terminal_style.css pegs cpu usage HOT 1
- Mastermind.py has trouble counting black and white pegs. HOT 5
- Typo in the Basic and JavaScript versions of SALVO HOT 2
- hangman.rb doesn't randomize the order of puzzle words HOT 9
- Are less mainstream languages allowed? HOT 4
- DEC Basic Computer Games HOT 2
- A little more about the spirit of the project??? HOT 6
- Super Star Trek README has a typo that's a rude word. HOT 1
- Edited latest commit requesting review for pull request (Life for Two.py)
- Super Star Trek - Ship class does not work correctly HOT 2
- A function never called in tictactoe2.py HOT 1
- Hacktoberfest HOT 1
- Confusion between 91_Train and 92_Trap Rust HOT 3
- 84_Super_Star_Trek java issues HOT 1
- Lunar lander initial weight HOT 1
- Battle doesn't seem to accept the num,num format suggested in the readme HOT 4
- Python Acey-Ducey has a "1" card instead of the "10" HOT 5
- Code decomposition question HOT 4
- Another possible tourist trade bug in King HOT 2
- Hacktoberfest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from basic-computer-games.