Live data from Hacker News

Dura is a background process that watches your Git repositories

github.com

161–170 of 207 posts

Re: Dura is a background process that watches your Git repositories

#161

I built a similar tool a couple of years ago here: 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 b…

Oh wow, this seems pretty similar to this thing I wrote: 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.

Re: Dura is a background process that watches your Git repositories

#162

Earlier quoted context omitted.

If there was a machine-parseable `dura status` command, a Hammerspoon menu bar icon could poll that every N seconds and make a status icon!

Yes! 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 fro…

Alright, I'm half-way there. It now write JSON logs to `~/.config/dura/logs/*.json`

Re: Dura is a background process that watches your Git repositories

#165
post #61

This 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.

VS Code has a local history extension: https://marketplace.visualstudio.com/items?itemName=xyz.loca...

Jetbrains adds tags like "commited to VCS", "test failed/succeeded", "reverted", and much more. It's more than just a history of changes.

Re: Dura is a background process that watches your Git repositories

#166
I 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 .* *".

Re: Dura is a background process that watches your Git repositories

#167

Hmmm...rm -fr .git Now what?

Nothing 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.

> Nothing protects against rm -rf by design

You mean, other than backups? Including editor backups, in a separate directory.

Re: Dura is a background process that watches your Git repositories

#168

I built a similar tool a couple of years ago here: 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 b…

Do you have any comparison with https://www.sparkleshare.org/ too?

Re: Dura is a background process that watches your Git repositories

#169

I 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 .* *".

It'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.

Re: Dura is a background process that watches your Git repositories

#170
post #53

As 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.

It's pretty hard to name something without having it accidentally stand out in one of thousands of languages (or even a few major ones). I wouldn't read too much into the intention.
Post reply on HN