17 ms·
Dura is a background process that watches your Git repositories
- sahkopoyta 5y agoSeems like a nice tool, but if you really used git, I don't really see how this situation described at the readme.md could happen :-) you think you just lost days of work
- can16358p 5y agoNot for you and me but might save hours/days of work for someone (including me-a-few-years-ago) who is lazy/forgetful about their commits.
- sahkopoyta 5y ago"including me-a-few-years-ago". This also applies to me, sometimes you have to learn the hard way. I would say that in this scenario addressing the root cause is better than treating the symptoms.
- dbalatero 5y agoAny unstaged work is getting committed in the background, so if you lose unstaged work accidentally, it will be available on that dura branch.
- masklinn 5y ago> if you really used git That really doesn't mean anything. > I don't really see how this situation described at the readme.md could happen :-) Start working on a big and complicated refactoring, don't commit because everything's broken and in flux, run the wrong command and lose your changes-in-flight somehow (reset the working copy, revert a file, overwrite a file incorrectly, ...).
- pcthrowaway 5y agoYep, this. Exactly like the docs say, you could recover entire directories after an accidental reset, or just avoid having to ctrl+z in your file 40 times. I've been fortunate to "only" lose about 2-3 hours of work to mis-typing in git in the last year. It could have been 2 days or so if I was unlucky. For 2-3 hours of work it's maybe not worth installing this tool, but I'm definitely thinking about it because it's so much better than potentially losing 2 days. "Commit often" doesn't work for me a lot of the time, I'd spend up spending almost as much time rebasing and patch committing as I would in dev/refactor. When you're exploring you try 5 things for every one that works, and it's not apparent til later which thing you want to keep. Committing junk every 10 minutes and then committing a rollback for most of it isn't ideal.
- masklinn 5y ago> Yep, this. Exactly like the docs say, you could recover entire directories after an accidental reset, or just avoid having to ctrl+z in your file 40 times. I've definitely wished IntelliJ's local history could work across multiple files a few times, it did let me recover from fuckups more than once but having to find and revert each file individually was not fun.
- sneak 5y agoI keep my git repositories in a directory synced to other machines with syncthing. Those other machines keep a tiered version history of all synced files (not just git). One has zfs snapshots, as well.
- dv_dt 5y agoI always wanted a utility to run in the background, look for changes, run unit tests, and if they pass automatically do a side commit noting it. This looks close.
- maleldil 5y agoI think you can do something like that with `watchexec` (or `entr`, if you prefer that): watchexec -c -e go 'go test ./... && git commit -am "Tests pass"'
- varsketiz 5y agoTook me a while to realize this is derived from the word duraBILITY. At first I thought this was a russian word being used...
- yosito 5y agoThe root is Latin, duro, which means hard. https://en.m.wiktionary.org/wiki/duro#Latin https://en.m.wiktionary.org/wiki/duro#Latin
- ljm 5y agoI thought it was called дура (stupid) because 'git' is slang for idiot.
- ratww 5y agoIt seems the previous name of the app was "Duralumin" and they just shortened to "Dura".
- lucas_v 5y agoOr you could just "git push" responsibly...
- paxys 5y agoI love this. One of the biggest reasons people don't frequently commit their code is fear of "polluting" their feature branch. Automatically creating and pushing to backup branches is the best of both worlds.
- yosito 5y agoThis is an interesting concept. I'd think it would need some kind of system tray icon to be aware if it stops running, otherwise, it might provide a false sense of security and you could lose work because you thought you were safe but Dura actually crashed three days ago. It also probably needs some sort of automatic syncing to a remote repo, so it isn't affected by spilling your coffee on your laptop.
- dbalatero 5y agoIf there was a machine-parseable `dura status` command, a Hammerspoon menu bar icon could poll that every N seconds and make a status icon!
- nathancahill 5y agoI love Hammerspoon so much.
- tkellogg 5y agoYes! I'm the author and this is the next feature I was planning on adding, I was even planning on naming it `dura status`. First I need to get better logging (to a JSON file), and then expose it via `dura status`. It occurs to me that having all that data could tell me a lot about how I work, so it could unlock some very interesting usages of dura. Would you mind creating a Github issue? The project could benefit from more discussion around this.
- tkellogg 5y agoAlright, I'm half-way there. It now write JSON logs to `~/.config/dura/logs/*.json`
- xixixao 5y agoI’ve had this idea for about 10 years - it really pays off to wait and eventually someone will build all my ideas :) There are many things to build on top: - Squash history so that it doesn’t grow indefinitely. - Be somewhat language aware to provide better commit messages - IDE integration
- marcofatica 5y agoFossil has had this feature for a long time
- dradtke 5y agoI'm curious about this, any links handy?
- klaussilveira 5y agohttps://fossil-scm.org/home/doc/trunk/www/sync.wiki https://fossil-scm.org/home/doc/trunk/www/sync.wiki
- deleted 5y ago[deleted]
- sgbeal 5y ago> Fossil has had this feature for a long time (A long-time fossil contributor here.) Fossil has no such feature. Fossil sync synchronizes the remote and local saved state (checked-in/saved state only). It does not do anything with un-checked-in state. That said, you can use fossil's stash to periodically take a (non-sync'd) snapshot using something like 'fossil stash snapshot -m "snapshot @ $(date)"' (i have that aliased and use it often). That does not enter the SCM history and is lost if you destroy the checkout dir.
- bch 5y agoGoofy context here: ‘sgbeal and I were doing some fossil dev work ourselves (I’m personally not at his level of fossil-fu, but am a long-running user and contributor). Our work was in a fossil repo (he in Europe, me in North America) and we were using the chat[0] feature to discuss our work when we noticed and discussed the GP post. Fossil has been self-hosting for ages, now is it self-correcting? /s [0] https://fossil-scm.org/home/doc/trunk/www/chat.md https://fossil-scm.org/home/doc/trunk/www/chat.md
- dilap 5y agoAlong similar lines, I've adopted a hyper-frequent commit pattern in git. I do a bunch of meaningless micro-commits as I'm making progress, and then rewrite them all into one or two meanginful commits once I've reached a working state of whatever I was trying to do. I find it's helpful for not losing work / easily backing up if as I'm going along I realize I want to change approach. (For the micro commit I have a git command "git cam" that just commits all changes with the message "nt". Then once I'm ready to do a "real commit", I have "git wip" which rolls back all the nt commits but leaves them in checkout; then I can make one or two "real" commits.) I wonder if dura would be even better, or if the commit frequency would end up being too fine-grained and obscure?
- jwineinger 5y agoI do something similar, but with larger intermediate commits than yours and more meaningful messages. Then at the end, I do an interactive rebase, squash the ones I don't care about, and reword the final commit message based on the hints I left myself in the squashed ones.
- int_19h 5y agoI do a combination of the two: the first commit gets a meaningful (but still draft) message, and their follow-ups are all committed with "." as a message - but only until "switching gears", i.e. until a commit comes that is logically separate from the bunch before it. Those commits that have messages then provide logical milestones for squashing. This breaks down sometimes if you have to switch back and forth between different parts of code, breaking the linear sequence. But even then, the messages make it easier to connect the pieces when it's time to clean up history before the pull request.
- DarylZero 5y agoIt seems like you could just use the index. I.e. just use "git add -A" instead of "git cam" Then you don't need "git wip"
- dilap 5y ago
- danslo 5y agoI see no reason to use this if you commit often and know how to use reflog.
- thatswrong0 5y agoSo then don't use it. I prefer not rebasing / editing unless I have to.
- dahart 5y agoWhat do you mean? The concept of dura is editing. And using reflog isn’t normally a rebase.
- agumonkey 5y agohas anyone ever made the reverse of bisect, doing some kind of graph search over potential edits and let the thing grow and hopefully converge ?
- mlvljr 5y ago
- admax88qqq 5y agoCool tool! It's kind of insane to that in 2022 were still dealing with "save early, save often." Our tools are so antiquated. Storage is cheap and computers are fast, every keystroke should be persisted somewhere I can recover from rather than having to manually save and commit works in progress.
- whartung 5y agoWell, it's funny because the Apple stuff works like this, but not Xcode. I pretty much never save anything with Page/Numbers/TextEdit. I just quit Not only do I not lose changes, I don't lose editions. I can go back to older versions. And that's not including Time Machine. It's simply "built in". From a user experience, it's really wonderful and no stress. I don't even think about it. At the same time, I have no idea where these extra versions are stored but, honestly, I don't care. I do wish other applications worked similarly. Source code is tricky, but it probably wouldn't be awful to have a similar experience.
- fishtoaster 5y agoA lightweight way to accomplish this is to at least set up frequent autosaves in your editor. I had `au FocusLost * :wa` in vim to save all buffers to disk whenever it loses focus. Now that I've converted to the church of VS Code (with vim bindings, of course), there's an "Auto Save: onFocusChange" config option to do the same thing. I don't know how people live without it!
- DarylZero 5y agoYou don't always want to save to disk though, you want to save in a consistent state. Vim allows you to set up a persistent undo that will let you load the modified buffer from a backup file without touching the original until you're ready. Or undo back to the saved on disk version. Or undo even further to previous versions. That's true persistence.
- xcambar 5y agoProper text editors[0] do this since decades. [0]: vim and emacs, at least.
- clircle 5y agoEmacs's autosave is quite excellent at recovering my work when my computer crashes. M-x recover-this-file https://www.emacswiki.org/emacs/AutoSave https://www.emacswiki.org/emacs/AutoSave
- mssdvd 5y agomagit has a mode, magit-wip-mode, that can do what dura does (but it only works if you make changes with Emacs). https://magit.vc/manual/magit/Wip-Modes.html https://magit.vc/manual/magit/Wip-Modes.html
- dahart 5y agoGit has a built-in Ctrl-Z that is called “reflog”. Acknowledging that git’s UI commands such as “reflog” may be technical, and nonstandard, and poorly named, does dura provide something that git doesn’t, and is it a good idea to add yet another application/layer/dependency to the git workflow? Would it be just as effective to add a git alias called “undo”, or something like that?
- weaksauce 5y agothat's tangential to this tool though. the reflog is for any git changes. this is a tool that checks for changes every 5 seconds or so and commits them to a shadow branch. there are a few things that standard git will clobber too without any recourse from the reflog.
- dahart 5y ago> there are a few things that standard git will clobber too without any recourse from the reflog. True! Stash is one of those things, right? Does dura catch the stashes specifically? Clearly it’ll catch whatever work you did before stashing, but if it saved stashes specifically in it’s own thing, that would be extra handy.
- jhardy54 5y agoReflog is a log of refs. If you don’t make commits then then nothing is added to the ref log.
- dahart 5y agoTrue, fair. I was about to delete my somewhat dumb question. Yeah I guess if someone’s not saving early & often, this could definitely catch some mistakes.
- jdavis703 5y agoIt’s not dumb, I had the same question. Would’ve been great if the value proposition explained how it was different than using the reflog. In my experience there’s a lot of Git tools out there that basically exist because people don’t want to read the manual. But seems like Dura is not one of those.
- lowbloodsugar 5y agoIntelliJ (and I assume other JetBrains IDEs) track local changes as if they were commits - you can diff history for example. I've seen it lose changes across a crash though, so something running on disk would be very nice.
- endisneigh 5y agoIs there a built-in way to configure Git to just make a temporary branch and commit every file save?
- unbanned 5y agoHmmm...rm -fr .git Now what?
- jdavis703 5y agoI use Time Machine on an external drive. I learned this lesson the hard way… Obviously it’s not perfect, but you aren’t going to lose an entire days work.
- remram 5y agoThis has happened to me unfortunately and didn't feel good at all. I ran `rclone sync` on the folder that had .git instead of the correct subdirectory, and that removed files not present in the source with confirmation (like rsync --delete-after). I've learned to commit and push to a remote frequently (which is easy with Git because you can use any machine you can SSH).
- remram 5y ago*without confirmation
- qbasic_forever 5y agoNothing protects against rm -rf by design. You shouldn't use it to blindly clean up and delete files (unless as a last resort or some very specific and careful use case). Just use plain old rm and feed it the explicit list of files to delete, which forces you to actually look at what you're about to do.
- kazinator 5y ago> Nothing protects against rm -rf by design You mean, other than backups? Including editor backups, in a separate directory.
- quickthrower2 5y agoYou need something to monitor your files and back them up. Backblaze would do it.
- howdydoo 5y agoThis feature is built-in to all the JetBrains IDEs. Right-click your project, open Local History, and you can diff any file at any two points in time. That's saved my bacon more than once.
- voiper1 5y agoVS Code has a local history extension: https://marketplace.visualstudio.com/items?itemName=xyz.local-history https://marketplace.visualstudio.com/items?itemName=xyz.loca...
- foepys 5y agoJetbrains adds tags like "commited to VCS", "test failed/succeeded", "reverted", and much more. It's more than just a history of changes.
- plmpsu 5y agoIs my understanding correct in that this serves the same function as Intellij's Local History?
- chmaynard 5y agoIt might be simpler for dura to stage your work every 5 seconds (git add -A) without creating a new commit each time. Not sure how git handles many small changes in the index.
- baby 5y agoHonestly I feel a bit weird running this process that's going to watch all my git repos and commit things like that. Also, if my files are saved, then what am I recovering? I use VSCode and if my computer crashes it'll just recover the unsaved files automatically. That's useful.
- pcthrowaway 5y agoThe docs say it only watches repos you tell it to
- specialp 5y agoJetBrains "local history" for InteliJ IDEs has saved me several times. It has all of the diffing tools that are available for git commits. This looks to be a generic implementation of that. We should not live in a world where unsaved data is lost.
- saila 5y agoI used to run a simple rsync script that copied all my active projects to an external drive every 15 minutes. I figured that if I had a major issue, I'd only lose a limited amount of work, which I could probably re-create without too much trouble. Lately, I've been using private branches in the early stages of feature development, but you still have to remember to push in case of hardware failure. I also rely on my IDE's local history to get back to a good place if I need it. I wonder if it would be good to combine these ideas: commit and automatically push every N minutes. Is this something that's being considered for Dura? Or is it a bad idea? One big challenge must be avoiding commits when someone's right in the middle of typing, although having to stitch a couple adjacent commits together would definitely be better than losing work.
- kadoban 5y agoAutomatic commits is generally not a good idea. Commits are supposed to be meaningful chunks of work, and meaning requires manual effort. Automatic pushing is also probably not great. If it's just a backup mirror of some kind maybe, but otherwise you should be doing something like intentionally pushing what you're trying to share. I don't really think that backups should be tied to git. There's already good backup software, wiring it into git doesn't seem to add anything.
- saila 5y agoFor regular commits, sure, but for snap-shotting your work, I think it's fine. The backup branch would never be shared with anyone else, as you'd either push it to your own workspace/fork or to a clone on a mounted disk. For this type of ephemeral backup of code-in-progress, I think storing it in git would be really convenient, because you'd just use standard git commands to find what you're looking for without having to deal with another tool.
- kadoban 5y agoConvenience could make it worth it. I can't say I'm all that convinced though, because you'll have to learn new concepts (and likely new commands, unless you're a git guru) about the backups anyway.
- abcd_f 5y agoAs a sidenote - “dura” is a common and fairly rude Russian word for “fool” or “imbecile” as applied to women. Perhaps it was intended, but I can’t quite make a connection.
- ajuc 5y agoif you're a fool you will be happy you installed this tool
- dzdt 5y agoI took it as short for "durable". But then again "git" is a common, slightly rude English word for "fool" or "imbecile" as usually applied to men...
- mrestko 5y agoAnd "git" is English slang for similar. Dura is also an anatomical term for the tissue encasing the brain.
- Koshkin 5y agoInteresting. I've always thought it was the word from https://www.imdb.com/title/tt0095348/ https://www.imdb.com/title/tt0095348/
- TimTheTinker 5y agoThe tissue encasing the brain is called "dura mater" - Latin for "tough mother". Apparently it left quite an impression on early anatomists/neurosurgeons.
- titanomachy 5y agoIt’s also the name for the protective membrane that surrounds your brain!
- mynegation 5y agoAlso Spanish or Portuguese adjective in feminine form, meaning: "hard", "resistant", "harsh" etc.
- swills 5y agoSounds neat. For me, local scheduled periodic file system snapshots serve a similar goal, and on a wider scale.
- kuon 5y agoI use ZFS, and on my home directory I have ZFS snapshot every minute for the last hour and every hour for the last 24h. It saved me so many time.
- Eun 5y agoRunning with the same setup. It’s a perfect solution.
- doublepg23 5y agoIs there no performance hit for doing snapshots every minute?
- kuon 5y agoNo it is basically free.
- procrastitron 5y agoI built a similar tool a couple of years ago here: https://github.com/google/git-sync-changes https://github.com/google/git-sync-changes Both save uncommitted changes in a hidden ref. Based on the README, the differences seem to be: 1. dura runs as a daemon while git-sync-changes is a one shot execution. 2. dura saves locally, while git-sync-changes syncs with a remote repo. 3. dura only does the save and the restore is manual, whereas git-sync-changes does both steps automatically. I’m glad to see more people exploring this space. I think there’s a lot of untapped potential in tracking pending changes similarly to how we track committed changes.
- unqueued 5y agoOh wow, this seems pretty similar to this thing I wrote: https://github.com/unqueued/git-cache-tag https://github.com/unqueued/git-cache-tag Which saves all uncommitted changes to a tag. I wrote it because I wanted to have a complete snapshot of a build context. Sometimes composer or npm can't be relied upon to reproduce dependencies in the state they used to be, or I just want a cache of artifacts. It has been pretty handy.
- johnx123-up 5y agoDo you have any comparison with https://www.sparkleshare.org/ https://www.sparkleshare.org/ too?
- procrastitron 5y agoThanks for the pointer; I had never heard of sparkleshare before. It sounds like it addresses roughly the same use case, but I couldn’t find any technical details about it in its docs in order to see how it compares.
- ttoinou 5y agoCould we have this commit automatically ? so as to have a AutoGitFilesystem where our files modifications are always kept up to date on a server
- ekiwi 5y agoMy biggest question after looking at the readme: What happens if your computer crashes while dura is making a commit? Can it corrupt your local git repository? From my own experience, git is not crash safe, i.e., it can leave the .git directory in an inconsistent state if the computer crashes during certain git operations.
- nine_k 5y agoI wonder if the tool can be amended to commit to an independent git repo. Git can operate on two local repos reasonably efficiently, IIRC, so diffing and applying commits should be doable.
- mgirdley 5y agoYou might have a trademark problem coming your way... http://dura.software http://dura.software
- ViViDboarder 5y agoMaybe a frivolous one. They don’t have a product named Dura not anything that looks remotely similar.
- w_t_payne 5y agoI've also built a tool to support hyper-frequent commits, automatically rolling back the commit if the build, static analysis or any tests fail. This ensures a complete history of 'good/working' builds in the vcs. https://github.com/wtpayne/hiai/blob/master/a3_src/h70_internal/da/vcs/__init__.py https://github.com/wtpayne/hiai/blob/master/a3_src/h70_inter...
- sneak 5y agossh root@remotehost 'apt install -y zfs-auto-snapshot' while sleep 1 ; do rsync -avP ~/Documents/ user@remotehost:Documents/ ; done
- rubyist5eva 5y agoJust use git rebase --autosquash https://thoughtbot.com/blog/autosquashing-git-commits https://thoughtbot.com/blog/autosquashing-git-commits
- smm11 5y agoA newspaper reporter I knew in the early-90s did much the same with an external drive. Notes, then stories that came from the notes, were saved with a name-datetimestamp name, every time that person got up for some reason, or answered the phone, or felt like it. The 'master' file was the one on the local HD. That reporter was me.
- zffr 5y agoThis is cool, but for me to use it I would need a LOT of confidence that the tool wouldn't just silently stop working one day. With my luck that would probably be the one day I actually needed to use this tool. You may want to look at turning this into a systemd/launchd service so the OS can launch the tool on boot and handle restarting it on crashes.
- avgcorrection 5y agoI don’t understand these backup tools which masquerade as VCS extensions. I want my VCS commits to be intentional. If they’re not then I’m just using a fancy VCS tool[1] for backup—just set up a _dumb_ backup routine that backs up every X interval and doesn’t have to care about the intentionality behind any changes made (the domain of version control). And if you get into a situation where you haven’t committed for such a time while that you risk losing “days of work” then… seriously? You might want to get a better Git client where committing isn’t such a pain (IMO the CLI is too much typing for git(1). Magit is great). And as already mentioned there is the reflog. Which is difficult enough for me to navigate sometimes without some pseudo-backup tool making a mess (on top of _my_ mess…). [1] Git might be “stupid” but it’s also quite fancy.
- stavros 5y ago> If they’re not then I’m just using a fancy VCS tool[1] for backup Yes you are; what's wrong with that?
- avgcorrection 5y agoDon’t use a fancy tool to implement a simple tool? I’m sure that’s a rule somewhere.
- stavros 5y agoAh, I'm of the "whatever gets the job done with the least amount of effort" school.
- avgcorrection 5y agoUsing libgit2 bindings is the “least amount of effort” to implement periodic backup? And even if it may corrupt your repo?[1] [1]: https://news.ycombinator.com/item?id=29786422 https://news.ycombinator.com/item?id=29786422
- Dylan16807 5y ago
- ed-209 5y agoI'd hate to be the guy reviewing a commit constituting "days of work". Micro-commits are dual purpose, providing a hedge against lost work and making commits readable. Worse comes to worse there's always "git push origin head:my_tmp_branch"
- quickthrower2 5y agoJust watch your private keys don't end up in there!
- boring_twenties 5y ago> Without dura, you use Ctrl-Z in your editor to get back to a good state. Not quite sure how suspending my editor and returning to the shell would help ;)
- pabs3 5y agoI wonder if there is a way to get this to do commits on filesystem change notifications using fanotify/inotify/fswatch/etc rather than running every 5 seconds.
- jfnetsec 5y agoi just use this cronjob in the directory i keep all of my git repos. don't use software you can write and maintain yourself. if you have like 200+ repos it might take 15 mins to git pull for all of them. I had a plan at somepoint to use logstash or something to parallelise this so it'd be all able to be done concurrently and logged into a single json somewhere but I never got around to it. #crontab -l 0 * * * * /bin/sh /Users/MyLoginNameAndNoLolYouMayNotKnowIt/code/bitbucket/updateRepos.sh $ cat /Users/MyLoginNameAndNoLolYouMayNotKnowIt/code/bitbucket/updateRepos.sh #!/bin/sh find /Users/MyLoginNameAndNoLolYouMayNotKnowIt/code/bitbucket/ -name .git -execdir git pull \;
- fomojola 5y agoOne question I have about this approach: if I temporarily include a security token in one of my files, will that get included in the temporary commits? And if so, how can I make sure that particular piece of history never makes it off my dev machine?
- Galicarnax 5y ago
- 7demons 5y ago"Dura" in Russian language is "idiot". Specifically female idiot. Is it really hard for developers to enter word in google before naming application? This is ridiculous.
- deleted 5y ago[deleted]
- matkoniecz 5y agohttps://www.google.com/search?q=dura https://www.google.com/search?q=dura is not mentioning word in Russian for me - and I set number of results per page to maximum. https://en.wiktionary.org/wiki/dura https://en.wiktionary.org/wiki/dura is also not mentioning it. See also https://news.ycombinator.com/item?id=29785163 https://news.ycombinator.com/item?id=29785163 - it is not so clear insult anyway. And anyway, it would be anyway fitting for git using tool (git also has meaning as pejorative, typically male)
- kazinator 5y agoI use this, in my .vimrc: :set backup :set backupdir=/home/kaz/.vimbackup :let &g:backupext=("." . strftime("%y-%m-%d.%H:%M:%S")) That's it. No messing around with git; protects files that are not in git, and can save you even in he face of "rm -rf .* *".
- kristjansson 5y agoIt's impossible not to note that emacs does this well too. Setting (setq backup-directory-alist `(("." "/home/user/some/dir/you/chose/backup/)) version-control t kept-new-versions 50 kept-old-versions 50) sets up a directory with many versions of every file ever edited. Additionally (setq auto-save-file-name-transforms `((".*" "/home/user/some/dir/you/chose/auto-save/" t))) does the same for even unsaved changes.
- kazinator 5y agoVim doesn't do it "well" with the settings above, just "good enough". The time stamp suffix is calculated just once when you start Vim, set in the global backupext option. If we :e edit files in an existing Vim session, they all get backups with that time stamp. It needs to be calculated as a buffer-specific value of that option, if there is such a thing, on every new edit.
- kazinator 5y agoI just found that the Vim manual recommends, right in the doc for backupext, the use of the BufWritePre hook instead, so: :au BufWritePre * let &backupext=("." . strftime("%y-%m-%d.%H:%M:%S")) This has the right effect that every time you save with :w, a new backup is made of the previous contents.
- clktmr 5y agoThere is also the `undofile` option, which stores your undo-history permanently on disk. You can also go to an earlier version of the file from 4 hours ago with `:earlier 4h`.
- nunull 5y agoThis is really cool. One drawback is that it seems to touch the index, which I believe should be avoided, since it can disrupt the users workflow. I experimented with something similar a few years ago and avoided the index. My learnings are partially documented in the repo.[1] [1]: https://github.com/nunull/git-autosave https://github.com/nunull/git-autosave
- andybak 5y agoA lot of people seem to regard version control as an adequate substitute for an automated offsite backup. This strikes me as a dangerous habit. There are too many gaps between "what I want to commit to a repo" and "what I would hate to lose in the event of a total system failure". It's better to keep the two things separate. I'm happy with Backblaze on all my machines - although they have a disturbing habit of making unannouced changes to their default exclude filter which tripped me up (no VM images I knew about. But adding .git directories nearly lost me data). You can override these filters but they really shouldn't be changing them without clear warning.
- int_19h 5y agoWhy shouldn't the repo be treated as a backup, if it is set up to be backed up? And who doesn't back up their work repos?
- andybak 5y agoIt is a backup but it's a partial backup that excludes: 1. everything else on your system (potentially - a lot of stuff depending on your workflow 2. everything you've .gitignored (you 100% sure that's all ok?) 3. changes not yet pushed 4. branches that don't exist on remote 5. git stuff that's invaluable for disaster recovery 6. git stashes and probably other things i haven't thought of. Backups should be: 1. Offsite 2. Automated 3. Recent and up to date 4. Comprehensive Git workflows usually only handle point 1
- da39a3ee 5y ago> There are too many gaps between "what I want to commit to a repo" and "what I would hate to lose in the event of a total system failure". You’re thinking about commit wrongly. You should commit all the time, and make use of branches liberally, and push branches to a remote for backup. Then, you should form your “permanent” commits from that work. The thing is, you have to get comfortable with git. For example, one common move is: 1. Commit everything 2. Make a temp branch (remember that “branches” are just labels for a commit; they cost nothing) 3. Switch back to the first branch 4. Use git reset to uncommit the last few commits 5. Clean up the code and commit it properly, with a good commit message 6. Run tests and check the diff from your temp branch to check you didn’t make a mistake when cleaning up This tool Dura is totally unnecessary for people who are comfortable with git.
- da39a3ee 5y agoThis tool Dura is totally unnecessary for people who are comfortable with git. People are thinking about commit wrongly. You should commit all the time, and make use of branches liberally, and push branches to a remote for backup. Then, you should form your “permanent” commits from that work. The thing is, you have to get comfortable with git. For example, one common move is: 1. Commit everything 2. Make a temp branch (remember that “branches” are just labels for a commit; they cost nothing) 3. Switch back to the first branch 4. Use git reset to uncommit the last few commits 5. Clean up the code and commit it properly, with a good commit message 6. Run tests and check the diff from your temp branch to check you didn’t make a mistake when cleaning up
- castorp 5y ago> Without dura, you use Ctrl-Z in your editor to get back to a good state. I just turn on "Local History" in my NetBeans IDE which creates a new version of the file each time I save it. No need to use Ctrl-Z for that.