You are not logged in.

#1 2009-05-08 04:45:50

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Micro-commits in Git

So we had a power outage at my college today and a bunch of seniors were angry coz they hadn't saved when the power went out and lost hours of work. Sucks to be them. Anyways, I save regularly and I also version control all my files using Git and this gave me and idea. I would like to be able to set things up so that whenever I make a change to a git controlled file and save it, Git records it but not actually as an individual commit with a message. This way every change I made is added to version control and i'm not stuck with just linear undo and redo. However, I'm not an advanced Git user by any means so i don't know how I could go about setting this up. I'm also mostly a Emacs user, so ideally I would be able to browse these microcommits and reload them at will. When I'm done for one session i can make an actual commit with a proper message. Any ideas on how to set this up?
Thanks,
Basu


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#2 2009-05-08 13:28:27

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Micro-commits in Git

Look on lifehacker, there is a tool that does this that was featured recently.

Offline

#3 2009-05-08 13:39:18

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: Micro-commits in Git

I believe there's a way to execute a command each time you save a given file with emacs.
(don't ask me, I'm a vim user)

So you could just do something like
git commit  -a -m $(date)

but not sure this is useful.


Theres's also stgit that could be useful.


EDIT: http://lifehacker.com/5232049/flashbake … dy-writers

(funny to see this software is also a git interface written in Python ...)

Offline

#4 2009-05-08 17:32:35

bwalk
Member
Registered: 2007-03-21
Posts: 177

Re: Micro-commits in Git

Stupid idea imho. If it is saved, it is on the disc. If you save only every few hours, you're to blame. If you have critical a power supply, get an USV. It is nowhere safer to have each change in a vcs.

Offline

#5 2009-05-08 22:28:14

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Re: Micro-commits in Git

I have heard about flashbake and I think I'll look into. However, I would like to be able to 'hide' or fold these auto commits from view when I see the git logs (not sure if that's possible). Also I'd like to be able to quickly browse the recent autocommits (preferably from inside Emacs). Can anyone recommend Git elisp packages that can do what I'm looking for. Additionally if there is an emacs package that allows non-linear undo/restore, I could not go the VCS route.

@bwalk, I don't think you quite understood what I meant. I do backup regularly (hitting C-x C-s has become something of a reflex whenever I pause typing), but I would like the individual changes to be saved so that I could browse and rollback without depending on a linear undo buffer.


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

Board footer

Powered by FluxBB