Live data from Hacker News

Dura is a background process that watches your Git repositories

github.com

91–100 of 207 posts

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

#91
post #83

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

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

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

#92
post #10

Along 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…

I use the local history in Jetbrains/IntelliJ/PyCharm all the time. Can use it on a current file, or even mark a folder if you accidentally deleted something.

It annotates the checkpoints with metadata as well. Like "this is how the file looked when you ran a test that failed".

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

#93
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.

LOL — author here — I definitely didn't intend it that way, but it does kind of jive with "Git's" other meaning. I should have known that all 4-letter words are an insult in some language.

I had originally named it "duralumin" after a magical metal in [a novel that I'm reading](https://www.amazon.com/Well-Ascension-Mistborn-Book/dp/07653...). I shortened it to "dura" after realizing that I can't even remember the name, so there's no chance anyone else will. Plus is has that "durable" vibe to it, which seemed appropriate.

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

#94

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

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

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

#95
post #8

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

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 from more discussion around this.

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

#96
post #10

Along 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…

It 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"

For me, having it be a real commit is nicer -- can switch between branches, push if I'm switching computers, look at history, &c.

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

#97
I'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_inter...

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

#98
post #10

Along 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…

I use the local history in Jetbrains/IntelliJ/PyCharm all the time. Can use it on a current file, or even mark a folder if you accidentally deleted something. It annotates the checkpoints with metadata as well. Like "this is how the file looked when you ran a test that failed".

Clearly, my JetBrains IDEs paid themselves multiple times by saving me from « oh shit » situations. Best investment my employer did without never knowing it :D

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

#99
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.

LOL — author here — I definitely didn't intend it that way, but it does kind of jive with "Git's" other meaning. I should have known that all 4-letter words are an insult in some language. I had originally named it "duralumin" after a magical metal in [a novel that I'm reading]( https://www.amazon.com/Well-Ascension-Mistborn-Book/dp/07653... ). I shortened it to "dura" after realizing that I can't even remember the n…

Off topic: great choice! I love all of Brandon Sanderson's works. Enjoy it, the first Mistborn series has a very satisfying conclusion!
Post reply on HN