Comments (10)
@JakeStanger this is awesome! Good work!
from dura.
your second point is very strong. go for it
from dura.
Going to start work on this today
from dura.
I have a JSON file in ~/.config/dura/config.json
. It's a misnomer though because its more of a "runtime database", not for humans to edit. For config, I was thinking rename that file to runtime.db
(still JSON) and create another called config.toml
. Alternately, we could use .gitconfig
, but I like the TOML option better because we could include all available options and document them extensively. Harder to do that with .gitconfig
. What do you think?
from dura.
I think the format of a .gitconfig
is great, but we should avoid using the existing one as it's bad practice to use another programs config file. I think TOML makes the most sense. Renaming the file to have .db
or even calling it something like paths.json
would be better for less confusion.
from dura.
Given my PR above, I think now is a good time to work on this.
Correct me if I'm wrong, but the only value that should be inside the db file at the moment is the pid
. The rest can be put inside a human-friendly config.
Ideally, the db should be put in the user's cache dir, and the config inside their config dir.
from dura.
One reason to keep the paths in the DB is as a cache. But that comes with all the problems of caches, so I'm fine getting rid of it and just having the PID in the DB.
from dura.
Some guidelines:
- JSON for machine-writable content. Since
dura watch
anddura unwatch
exist, shouldn't we store these in JSON? - TOML for things that need lots of documentation. We can put lots of comments in a default config file with all available options
Those aren't entirely opposites, and the paths config seems to fall under both.
from dura.
My feeling is that paths should definitely be part of the config:
-
They're defined by the user:
watch
andunwatch
are end-user commands for configuring the program behavior -
The config should contain everything required to duplicate the setup. I should be able to copy
config.toml
to a new machine (with a similar file structure) and dura just work -
Cache files should be treated as temporary. If paths were part of the cache and the cache got wiped, you'd need to reconfigure the program
-
One reason to keep the paths in the DB is as a cache
I'd stay well clear of trying to cache a list of files on disk. As you mention it brings about a lot of problems, and I think if it becomes necessary that would suggest a larger architectural problem. I know somebody mentioned using notify to listen for file changes which should come with enough performance benefits to remove any possible need for caching.
from dura.
@chand1012 changes were merged this evening, obviously more settings will get added with time but let me know what you think :)
.config/dura/config.toml
(you'll need to watch a dir for it to be generated)
from dura.
Related Issues (20)
- Update: Upgrade clap to V3.1.6 & replace deprecated code in main.rs HOT 2
- Dura doesn't create any branches on github codespaces HOT 2
- brew install dura HOT 4
- Couldnt you just git commit more often? HOT 4
- Error: UnbornBranch HOT 6
- Update clap
- Data Corruption: Don't allow dura to run as root
- Ubuntu install instructions HOT 2
- Donβt create unnecessary branches
- Chronological git log HOT 2
- feature request: remove old dura branches periodically HOT 1
- support install linux and macOS with brew HOT 15
- `dura checkout` command HOT 6
- Tests broken HOT 3
- Binaries built by Github are not working HOT 6
- Prevent pushin dura branches to remote HOT 4
- stabilize config loading HOT 2
- Dura fails to capture anything if a worktree is present as a subdir of the working directory HOT 4
- Make dura branch names more informative HOT 3
- Feature Request: `dura status` command HOT 2
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 dura.