Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "local history"
-
!rant.
Here's some useful git tricks. Use with care and remember to be careful to only rewrite history when noones looking.
- git rebase: powerful history rewriting. Combine commits, delete commits, reorder commits, etc.
- git reflog: unfuck yourself. Move back to where you were even if where you were was destroyed by rebasing or deleting. Git never deletes commits that you've seen within at least the last 50 HEAD changes, and not at all until a GC happens, so you can save yourself quite often.
- git cherry-pick: steal a commit into another branch. Useful for pulling things out of larger changesets.
- git worktree: checkout a different branch into a different folder using the same git repository.
- git fetch: get latest commits and origin HEADs without impacting local braches.
- git push --force-with-lease: force push without overwriting other's changes5 -
A day in the life of BoyBiscuit.
PM: Please zip up any local changes and push them to a temp folder on the repo and I will manually check to see what you have changed.
Me: *glaring at the download as zip button*
PM: Who broke the repo?
Me: *checks commit history*
Commit History: *last commit PM*
Me: Could you add the files to your commit before pushing because you've only pushed changes on tracked files.
PM: No not possible, I did 'commit -a'.
Me: ....
PM: Could you all delete your forks so that It isn't anywhere on the web
US: but it's private with only us as collaborators
PM: No because I can see it
Me: srysly?
PM: Could everyone try to write more effective code?
Me: Looks at his code
Code: Boolean b = getbooleanVal ? True : False;
Tl;Dr: PM doesn't know anything about git or working as a team.
See you tomorrow!1 -
Most upsetting interview rejection?
Back when I graduated college, I did the usual rounds of interviews with insurance companies, banks, various other institutional businesses set up by the college's career center.
One local insurance company interview I thought went great. Usual 'Where do you see yourself in 5 years?' type questions, told her about my job history, very high level type stuff.
Couple of weeks later I get a letter in the mail and after the usual 'It was great to meet you blah blah blah', it ended with
'State Farm will never consider you for a position with our company.'
Never?! My then fiance (now wife) yelled "WHAT DID YOU DO?!!!" and I racked my brain for anything I might have said or done. The HR lady was attractive, but I didn't stare at any body parts and I didn't make any weird sexual advances (I was nervous enough without *that* going thru my mind).
The college career center floods the local companies with graduates and I was #5 in the waiting room that day. My only guess was they got me confused with someone else.
My fiance wanted me to call them immediately to straighten out any misunderstanding, but I knew what was done, was done. It's not like they would realize "Oh, that's right, it was Bob that kept looking at Karen's breasts, not you...come work for us!" Besides, why would I want to work someplace that didn't know/care who I was?6 -
Went to a thrift store last week near work and they often have old dev or technology books (I picked up a first edition K&R C book, once) and I found:
1) A book on the history of codes and ciphers throughout history.
2) Beyond good and evil by Nietzsche.
3) A modern publication of a 1673 Spanish demon summoning book (to go into a local town archive).
4) The technical information and construction manual for telegram systems from 1938.
I swear I was driving home thinking:
"Please don't crash, if CSI teams have to piece my identity together from these four personal items I dread to think what conclusions they're going to come to..." -
I once interviewed for a role at Bank of America. The interview process started off well enough, the main guy asked some general questions about career history and future goals. Then it was off to the technical interviewers. The first guy was fine. Asked appropriate questions which he clearly understood the answers to.
The next guy up, however, was what I like to call an aggressive moron. After looking at my resume, he said I see you listed C++. To which I said, yes I have about 7 years of experience in it but I've mostly been using python for the past few years so I might be a bit rusty. Great he said, can you write me a function that returns an array?
After I finished he looked at my code, grinned and said that won't work. Your variable is out of scope.
(For non C programmers, returning a local variable that's not passable by value doesn't work because the local var is destroyed once the function exits. Thus I did what you're supposed to do, allocate the memory manually and then returned a pointer to it)
After a quick double take and verifying that my code did work, I asked, um can you explain why that doesn't work as I'm pretty sure it does.
The guy then attempted to explain the concept of variable scope to me. After he finished I said, yes which is why I allocated the memory manually using the new operator, which persists after the function exits.
Einstein then stared really hard at my code for maybe 10 to 15 seconds. Then finally looked up said ok fine, but now you have a memory leak so your code is still wrong.
Considering a memory leak is by definition an application level bug, I just said fine, any more questions?4 -
My .pryrc and a Ruby script it loaded (in another directory) both disappeared seemingly without cause. I lost days of work including a bunch of debugging and performance utilities I wrote over the past year.
But I have no clue how this happened. Neither the .pryrc file nor the script’s folder are tracked by git, so it wouldn’t have been deleted, overwritten, stashed and dropped, etc. None of the other dot files are missing, and the folder is still present, albeit with one fewer files. I wouldn’t delete them, and commands that would delete them do not appear in my zsh history. So I’m at a loss. Figuratively and literally.
They’re just. Gone.
Is there any way to recover missing files on OSX?
I never thought I’d need a backup solution for local scripts.9 -
Stop commenting out code blocks!
Either fix your shit or delete it.
I am open to argue what fixing may mean, as it is perfectly fine to make your broken code not reachable, e.g. via feature flags or skipping certain tests. Yet never ever should you comment those blocks!
So you say you want to keep it for historic reasons? You know, that is why we use version control! If you ever need certain functionality back, you can restore that state.
Each decent IDE also offers a local history where you can even restore code blocks that weren't even pushed or committed. So use that!
Commenting out test cases is a really bad habit, as you have no reminder that you shall restore it.
And no, a TODO and a FIXME won't count as a reminder as you have to actively look for them. And we all know how well that goes, don't we? (One time, I found a typo of a `TDO`. So even with a regular lookup for TODO, stuff will slip.)
Each test suite offers you ways to skip tests if there are valid reasons why they should not fail the build temporary and they offer colorful feedback. Yes, that means that your tests won't be green, but guess what: That's a feature! They shouldn't be.
That yellow is a fine reminder, aka warning!, that you should really fix your shit.
Commented code screams: "I DON'T KNOW WHAT I WAS DOING!" and it confuses the hell out of other developers ("Was this commented because of debugging purposes and should be active again or can I safely delete this!?") and adds verbose crap to the code base.
If you find yourself to be in a place that you comment code a lot, I also argue that your workflow is broken.
When you are using a decent debugger, there shouldn't that much of a need to comment in and out a lot of code in order to reason about your code-base.3 -
About 5 years ago I stopped pirating and started supporting companies by buying subscriptions or software ( mostly games, apps I use at work, tv shows / movies streaming services ). If it requires payment, I paid the price.
Companies started to screw both customers by delivering shitty products and employees by laying off ( I'm not in a big company, never will be but I feel bad for all the employees that are in this situation )
Started pirating everything, closed almost all of my subscriptions, currently building my home server for git, local ai and anything I need.
Now I'm planning to do some research to find some good replacements for cloudflare and a friendly host provider that is not all greed and doesn't have a history of massively laying off employees just because they overhired or overpromised.
Fuck you greedy capitalist pigs.2 -
Me: Ok I've updated the docs, I'll open a PR with the changes
Maintainer: Looks great! Can you remove the changes to the package-lock.json? (I assume it got updated when you ran npm install to start the webserver)
Me: Ok sure, I'll update it soon
And this is where the troubles begin. The file was commited 2 commits ago, so I have to roll back to then. However, the remote repository has been updated since then, so I git fetch to keep up to date.
This makes the rollback a hell of a lot harder, so I run git log to see the history. I try a reset, but I went back to the wrong commit, and now a shit ton of files are out of sync.
I frantically google 'reset a git reset', and come across the reflog command. Running that fucks things up even worse, and now so much shit is out of sync that even git seems confused.
I try to fix the mess I've created, and so I git pull from my forked repo to get myself back to where I was. Git starts screaming at me about out of sync files, so I try to find a way to overwrite local changes from the origin.
And by this point, the only way to describe what the local repo looks like is a dumpster fire clusterfuck that was involved in a train wreck
I resolved the mess by just deleting the local copy and git cloning again from my fork.
I gotta learn how to use Git better5 -
> somehow decides to fix two bugs at 3 a.m, since they looked simple enough
> fixes bugs
> also causes a memory leak in the same JS script
> next morning the app compiled but kept crashing (duh)
> obviously cant remember what happened
> hangover doesnt let me think, i.e forgets to check the Local History in the IDE
> spends an extra 2 hours. -
My job in company to developed e-commerce website as a full stack developer.
History of that project.
Company paid 300,000 INR to the local web development firm for developing previous website and they developed website without bootstrap/SSL/Even save information of high profile client in plain text.
I am not angry on that web firm ,I am laughing on my company because such client never trust on independent developers who work hard ,code day and night to complete freelancing projects.
I hope my work will make differnce in their selling. -
Accidentally ran
$ git reset --hard
On my 2 weeks worth of uncommited code.
Thankfully Intellij has a local history. 😥7 -
Doing pair programming while I was navigating on somebody else's computer, we hit a weird behavior that our code changes weren't reflected.
Trying everything it turned out: I forgot to save.
Yet: Why though would you make me save? And why did the IDE not warn me about compiling unsaved changes? I think it was eclipse for Java, oh well. What can I expect ...
Anyways, I have gotten so used to my editors autosaving content for me as I write it, that I completely forget about doing Ctrl + S myself.
I never understood the need to hit that key combination manually as if I break something: `get reset --hard` will help to get me to a working state. (And even if I mess it up differently, my IDE's local history also let me restore recent changes.) And if it is a workign state, then I like to commit early and often. and
I am really dumbfounded why people insist on hitting save themselves.7 -
So I thought I knew source tree, apparently I do not... Lost a week's worth of work, went to history, saw someone removed it with a commit, and now I'm getting blamed for my own work 'disappearing'. The reason I am being told I am to blame is how I control my branches... So how I do it is that I keep a local copy of the master branch, I keep it updated and monitor it for changes regularly (meaning fetch and pull cause double tap..) before I do a merge, I check for any new code on master again, then using the local copy of master, which I just updated, I pull the master changes into my branch, deal with any conflicts, build and done. Then I request my changes into master once I am happy everything is good.
My question is, clearly there is something wrong with the way I do things, so please source tree users, what is the most fool proof way to pull latest from master so that I don't loose code? 😔11 -
Ok finally, I can tell now.
There's a college project I'm in with 2 more people that uses Python and AnyLogic (separately).
We also need to write some LaTeX, so as I was already using PyCharm for the Pyshit, I used it for the LaTeX and for Git.
I used it for Git too because I didn't know how it used Git and was worried that if I used the console it didn't recognize something or glitched out or something. And what the hell, it's a mature IDE, what could be so hard or possibly go wrong?
I had to re download the repo a couple of times because between pushes, pulls, merges and commits something happened and the repo ended in a weird state.
These are all the things I do:
Add, commit, create branches, merge, push, pull and delete branches.
So, I hadn't opened in some time. The last time I tried to bring something from another branch, and stayed up late to finish something. I was waiting for my classmates to join the call when I thought something like "Hey, I should commit what I did until now, it worked great.". When I examined the IDE I found out I was in the middle of a rebase or something. I start clicking buttons to at least try to commit. I press "Skip Commit". I lose everything.
What the fuck‽ As you can see in the comprehensive list above, I never do something similar to a rebase. Apparently when I tried to merge a couple of branches, the stupid IDE thought I tried to do a rebase and never asked me to finish it. Why do something I have never asked? Plus, why haven't you prompted me to finish the operation? That's so stupid. I'm never trusting IDEs again.
I was so lit for losing so many hours of work I did a couple of weeks before, I would have to think it and do it all over again because of something I never asked.
We spent an hour looking for a way to recover the lost code.
Why an hour, you ask, if you can use the Local History for that in PyCharm?
Because none of us had used it before and the articles we found said that you had to open it from the toolbar. From the toolbar it was greyed out.
Then I found the option in the contextual menu of the files. Recovered the LaTeX files but on the AnyLogic files, it was greyed out.
I had to open the Local History of the folder containing the AnyLogic file.
And that was that.
I almost faint.
Fuck Python, fuck PyCharm.8 -
Spent half a day creating my CV, some time ago and today it was time to upload it to my site.
Unfortunately, swapped the first and second arguments of the tar command, so the CV file got overwritten with the tarball...
After about ten minutes of panicked searching in my browser cache, I realised that the jetbrains IDEs have local history 😀
So I did not lose half a day's work after all 😃 -
This was sadly recent. I have git checkout aliased to ‘gco’.
I was on a dev branch with a load of uncommitted changes, and I accidentally ran ‘gco ..’ instead of ‘cd ..’ (I use them both quite often)
That was one of my more frantic google searches.....
Thankfully I was able to get all my changes back, but only thanks to IntelliJ’s local history feature allowing me to revert each file reload from disk. -
About 3 years ago, we had 4 different WordPress sites for various clients.
My colleagues thought it'd be a genius idea to keep them all in one repo. Even more genius, for local development, a single installation which implements a switcher for the wp-config.php files so we can switch between sites. Not bad in theory.
Fast-forward to present day. 1 client left; another site got converted to using Laravel because they always asked us to update their content so no point using a CMS; whereas the remaining 2 sites use differing versions of WordPress on their live sites, no less than 18 months out of date, have no dev sites, different collection of plugins and themes and both modified to the deepest darkest depths of fucking hell that's barely recognisable as WordPress anymore and next to no documentation or comments around the changes.
The functions.php file of one of these themes is over 4000 lines long!!!
We're keen to upgrade our servers to use Ubuntu 16.04 which defaults to PHP7, so all the already deprecated WordPress functions will then fail to work completely as will have been removed.
Both of these clients have agreed that they wish to convert Laravel as well so there's not really much point in going through the clean up process of their WordPress sites. Just copy the database nuke it all and start a fresh with Laravel FFS!
They also wish to completely redesign and discuss what features to keep/add/remove. With no date for these redesign meetings in sight, we won't be converting to Laravel any time soon, nor upgrading our servers in the foreseeable future either!
This is all because of one dev in the office and his history of failing to keep on top of breaking changes!
Fuck you! Seriously, fuck you!!!
If I was your superior, then you'd have been fired long ago!3 -
Avoid Jetbrains products if you value your sanity.
For the last several months, my settings and stored database credentials are wiped out at random. Meaning code styles, indention settings, keymaps, database settings, plugins, local change history, cache, all of it are reset to factory default at random, costing me hours trying to restore it all.
I've updated and it is still happening.
The moral of the lesson is to not pay for dev tools, lest you become reliant on them. You definitely don't get what you're paying for anymore.11 -
Had a Java teacher in my local TAFE start his lessons going further and further in history till he got to tape drives... Put students to sleep, literally...2
-
i am 24 and i feel like i am making some very bad choices with money.
my last few regretful stuff:
- i bought a phone when i found my current one (less than 6 months old) to be slightly less peformant. what's worse is that i don't even like that phone i purchased a lower end phone just coz i felt like experiencing a new phone brand!
- i bought an earpods when i lost my old one. whats worse is that they are lost somewhere at home, and i might find them once i life some beds and other heavy stuff ( although i searched significantly)
- i bought a freaking macbook some months ago. i guess that's not a majorly had investment but its being rarely used as i can't play any games in it(feel like it's a good thing though) and i have to sometimes vsit my old hp laptop to run some softwares as m1 sometimes sucks
- i got into an argument with my dad and recently slammed their phone on floor, then bought them a new one . i regret my angry self that day
- i got myself a personal trainer at gym for additional fees even though i am a beginner. our gym has 4 trainers and they provide basic directions for free of cost , i did not needed that guy.
- i recently bought a few track suits which , although i don't regret buying, i felt that i could get them at cheaper price at my local markets.
plus there are many other stuff that if i look into my amazon or flipkart history , i will regret more.
i need help with this shit. i am spending like 5-20% of my salary on regretful stuff, so its not a bad ratio but i still need to control.
send help :'(9 -
Many Indiana entrepreneurs are now turning to loans to find capital to grow their businesses. The ability to obtain a business loan plays an important role in the process of expanding activities and ensuring the sustainability of the enterprise. In this regard, various financial institutions offer a wide range of loan products for small and medium-sized businesses.
To obtain a business loan in Indiana, entrepreneurs can turn to banks, credit unions, and alternative lenders. For example, you can contact https://gofundshop.com/usa/indiana/ . Banks typically offer traditional lending products such as lines of credit, long-term loans, and guarantee financing programs through the Small Business Administration. In addition, there are many credit cooperatives in Indiana that specialize in providing financial assistance to agricultural and small businesses.
However, the Indiana business lending market is not always straightforward. Many entrepreneurs are faced with the problem of lack of credit history or insufficient collateral base, which makes it difficult to obtain a loan. In such cases, turning to alternative lenders such as online lending platforms can be a solution. These lenders typically evaluate an entrepreneur's creditworthiness based on a variety of factors, including the business's financial performance, personal credit history, and the business's future growth plans.
It is important to note that Indiana has seen an increase in interest in business loans in recent years. Many entrepreneurs seek financial support to expand their business, launch new projects or upgrade equipment. In this regard, local banks and financial institutions are actively developing new lending programs, taking into account the specifics of small and medium-sized businesses in the region.
Additionally, Indiana has many business support programs that can help you obtain a business loan. For example, the Small Business Administration provides loan guarantees that allow companies with limited credit histories to access financing. There are also government support programs that provide preferential loans and subsidies for the development of small and medium-sized businesses.
Thus, the Indiana business lending market offers a wide range of opportunities for entrepreneurs. Regardless of what industry the business belongs to, company owners have the opportunity to obtain credit resources for the further development and growth of their enterprise. It is important to choose the optimal loan product and contact reliable financial partners who can offer the best lending conditions.1 -
Just had a memory popup about my uni days about 5 years ago. I was in my Junior year in business school and was doing a "consulting" project involving the whole Class (200 students). Groups of 4 were assigned an international company in either Europe, Asia, or South America. We'd visit them (as well as do some sightseeing) and learn about them (performance, market positions, products) during Spring Break and come up with a real proposal. We would then compete with other teams, and the winning pitchs for each would be presented in the school auditorium in front the entire class.
Our team didn't get that far but that's not the point. We did win the individual classroom competition. Our company was Deutsche Telekom (owner of T-Mobile).
This was in 2010, when the iPhone/smart-phones started to become mainstream... And our team's idea was location-based advertising.
Looking back, we basically predicted the future... though we got the wrong industry...
It's also sort of funny though because I remember the main reason we came up with the idea was to be different.
All other teams just went with some expansion plan to a neighboring country or cutting costs.... pure MBA/business plan. But I guess I was being a natural techie so thought of a tech idea instead.
We had a meeting with our professor after he picked us and he told us he had a history of spotting future hits. We were like "hm... ok... let's give it a shot... we definitely got an A!" but at that point I was sort of skeptical if this would actually work in real-life (the basic idea was they would sell ads to local businesses and if you were nearby, you would get a text message with an offer).
But guess he was pretty right... we just needed to have Google or Facebook to have been our company... though Groupon or Yelp works too... basically a tech company with larger scale rather than a mobile carrier...1 -
Argh, why the hell does Visual Studio not have a god damn LOCAL HISTORY for files (not just a VCS history) like any other reasonable IDE? Heck, even Eclipse has a rather decent one!
Now, I've lost the work of one hour due to an accidental reset, and there is no way to get it back!
Fuck you, Visual studio!