toddmedema / electrify

Take Charge of the Power Market
http://electrifygame.com
MIT License
6 stars 2 forks source link

LFS or remove `AWSCLIV2.pkg` #98

Closed n-hebert closed 2 months ago

n-hebert commented 2 months ago

It looks like da2b830 might have introduced a large blob (38M) into the raw git repo. It looks like an install package for the AWS CLI? This should definitely be provisioned by whatever infra is installing outside of the repo, similar to #50

We can LFS it or do an amended rm and force push, so this'll take admin perms :smiley: Happy to meet to rework the commit tree if desired!

n-hebert commented 2 months ago

Circling back to this, a thought I didn't leave -- I'd be more than thrilled to take a look at the infra side and apply my infra skills to help out there. Let me know!

toddmedema commented 2 months ago

That was a mistake on my part, it's just the install file / not actually needed. I did a follow up commit to remove it, but I guess that'll still slow down pulls... so help amending and force pushing to get rid of it would be appreciated :)

n-hebert commented 2 months ago

Easily! I put a new branch on issue-98 and you can git push --force origin issue-98:master to fix it all up :smile:

If you notice binaries slip in, best to just force push them out immediately. The smaller the impact of the force push (the fewer files touched), the less problem it really is, anyway.

p.s. Easy as this!

  git rebase --rebase-merges -i da2b830ecca5f1842c26aa97d0e2ec5d559e8a3a # add a line at the top saying "break"
  git rm AWSCLIV2.pkg 
  git commit --amend --no-edit
  git rebase --continue
  git log --graph # check that it looks right
  git diff origin/master # check that the only difference is just what we wanted to get rid of
  git push origin HEAD:issue-98
toddmedema commented 2 months ago

Done!

n-hebert commented 2 months ago

I'm taking a look; the repo still downloads it ( :question: ) but it's gone from the history. Might just be a git gc sorta thing. I'll note back if there's any steps or close if it'll just naturally filter out. It might just be the live references on other branches, so they would just need to be rebased.

n-hebert commented 2 months ago

https://github.com/toddmedema/electrify/commits/master/

On here I still see da2b830ecca5f1842c26aa97d0e2ec5d559e8a3a appears, so it might be an error that popped up when you ran the command. Maybe I meant git push --force origin origin/issue-98:master ? I have the branch locally :sweat_smile:

toddmedema commented 2 months ago

Hmm, that didn't seem to do anything?

todd@Todds-MBP electrify % git push --force origin origin/issue-98:master
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Bypassed rule violations for refs/heads/master:
remote: 
remote: - Cannot force-push to this branch
remote: 
remote: - Changes must be made through a pull request.
remote: 
remote: 
remote: GitHub found 4 vulnerabilities on toddmedema/electrify's default branch (1 high, 1 moderate, 2 low). To find out more, visit:
remote:      https://github.com/toddmedema/electrify/security/dependabot
remote: 
To github.com:toddmedema/electrify.git
 + d809c5b...c3e4aaa origin/issue-98 -> master (forced update)

I also tried running the original commandset again and saw

fatal: pathspec 'AWSCLIV2.pkg' did not match any files

But then I noticed that git status said I was 1 commit ahead of origin/master, so I did a regular git push:

todd@Todds-MBP electrify % git push
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 10 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 469 bytes | 469.00 KiB/s, done.
Total 5 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
remote: Bypassed rule violations for refs/heads/master:
remote: 
remote: - Changes must be made through a pull request.
remote: 
remote: 
remote: GitHub found 4 vulnerabilities on toddmedema/electrify's default branch (1 high, 1 moderate, 2 low). To find out more, visit:
remote:      https://github.com/toddmedema/electrify/security/dependabot
remote: 
To github.com:toddmedema/electrify.git
   c3e4aaa..8e423d3  master -> master
n-hebert commented 2 months ago

oh! Well, despite any signs on your side, after this comment I now do see:

git remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Total 5 (delta 4), reused 5 (delta 4), pack-reused 0
Receiving objects: 100% (5/5), 469 bytes | 469.00 KiB/s, done.
Resolving deltas: 100% (4/4), completed with 4 local objects.
From github.com:toddmedema/electrify
 + d809c5b...8e423d3 master     -> origin/master  (forced update)

So it worked! A new clone (purposefully not having git-lfs available) looks like this:

$ git clone git@github.com:toddmedema/electrify.git
Cloning into 'electrify'...
remote: Enumerating objects: 7764, done.
remote: Counting objects: 100% (524/524), done.
remote: Compressing objects: 100% (120/120), done.
remote: Total 7764 (delta 409), reused 405 (delta 404), pack-reused 7240
Receiving objects: 100% (7764/7764), 1.98 MiB | 4.76 MiB/s, done.
Resolving deltas: 100% (2850/2850), done.
git-lfs filter-process: line 1: git-lfs: command not found
fatal: the remote end hung up unexpectedly
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

$ du -sh electrify/
3.3M    electrify/

Easy :sunglasses:

:partying_face:

toddmedema commented 2 months ago

Awesome! Thank you for the help :)