Comments (7)
I'm that colleague
from onefetch.
But I like that "time travel" achievement 😢 😆 But you're right that we could handle this more gracefully.
I think that most people don't pay attention to the commit time, so even if it was an unreasonable value like in the year 3000 it could still get merged in. And if that happens the repo is basically unusable by onefetch unless a maintainer rewrites the history to fix the commit date. So overall we should change this from a panic to a warning message so that at least onefetch can display the other stats, and one unexpected time getting accidentally merged in doesn't "break" the whole repo for onefetch.
Besides the panic, I'm also worried that we're dropping the timezone offset somewhere, which can cause this issue. Do both of you (@OsiPog and @MalteT) live in different timezones, and can you confirm that your system times are correct?
from onefetch.
Actually, we live in the same time zone and I can confirm that my system time was in fact incorrect. So I just caused this issue by commiting with my system time being in the future.
from onefetch.
So I think the solution is to print something like could not calculate last change: last commit datetime is in the future and then continue running.
Or time traveler detected, omitting last change calculation to prevent temporal paradox
:D
I'm not familiar with the code base, but if the change is not too involved I could assemble a PR :)
from onefetch.
I think we did have a timezone issue, anway 😆 2a3707e
Regardless of who or what caused the issue, I don't think anybody wants to rebase the commit history to fix the commit times just to get onefetch
to stop panicking. So I think the solution is to print something like could not calculate last change: last commit datetime is in the future
and then continue running.
from onefetch.
Labeling this as an enhancement instead of a bug since the panic was intended behavior.
from onefetch.
Oh, I like that better, actually! All you need to do is filter out commits where the commit time is greater than now.
But to do that some refactoring might be needed to avoid recalculating "now" in multiple places. Ideally SystemTime::now
should only be called once per execution.
from onefetch.
Related Issues (20)
- [doc] Universal install anchor is broken HOT 2
- True color support not recognized on Windows Terminal HOT 6
- Make it easier to discover that data languages (JSON, YAML) and prose (Markdown) are not reported by default HOT 2
- Translate `README.md` to German 🇩🇪
- Parse .gitattributes HOT 1
- GPL-3.0-or-later licenses wrongly reported as GPL-3.0-only HOT 4
- Estimated development time. HOT 6
- Cannot load git config from non-standard paths when installed from `snap` HOT 17
- I can't install the new version: v2.20 HOT 2
- Installer hash does not match HOT 6
- Bare repository support HOT 2
- RUSTSEC-2024-0320: yaml-rust is unmaintained.
- Include a flag to replace the "circle" with a glyph from Nerd Fonts HOT 3
- Automatically detect if no programming language is present to show overview in data-only repository HOT 4
- Add CLI option to force URL format to http
- Churn computation sometimes hangs/deadlocks
- Churn includes bot commits when `--no-bots` option is provided
- Lua dark blue color make it hard to read HOT 2
- Wiki page "Images in the terminal" refers to incorrect command line argument HOT 1
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 onefetch.