git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Dumb "continuous" commit dumb question

From
Marcus Griep <neoeinstein@gmail.com>
Date
Aug 19, 2008, 04:13 UTC
Message-ID
<48AA4873.4040107@gmail.com>
In-Reply-To
<48AA4263.8090606@gmail.com>
Pat LeSmithe wrote:
Show 6 quoted lines
> Hello,
> 
> Is it possible to enable git to automatically and continuously "softly"
> commit or stage *all* changes to a [subset of] files in a repository,
> without my intervention, as they happen?  Perhaps via a daemon which
> monitors the disk for explicit file-saving?

Perhaps with a cron job running a script every minute or so. You'd want to verify that changes actually took place before attempting a commit. Also, what log messages would you be providing? Log messages can be very important to the context of a change and the ability to later find them.

If you're using a specific application, such as a Wiki, it may work nicely, as log messages can be easily gleaned, and many offer post-edit hooks that you could use to invoke git.

> Of course, I would still be able to perform explicit commits (with
> descriptive comments) and other git commands, in which case there
> probably should be smart handling of the recent soft history.  For
> example, it could simply be discarded.

You may want to use StGit as that may allow you to make such lightweight commits easily while still allowing reordering, etc., though I am not familiar with that application porcelain.

Show 6 quoted lines
> I understand that I could simply remember to commit and/or branch early
> and often.  But given that changes by an individual on a given branch
> are well-ordered by time, and that the "continuous" operation may be
> cheap in many situations, a "live" journal could be useful.
> 
> Perhaps a better term is branch-aware undo or git with microstructure.

Obviously, my final caution is that while this is possible with some configuration, you may lose valuable "signal" information in the "noise" of commits that such a continuous operation might incur. This low SNR may make it more difficult to find and revert changes you didn't actually want to happen or to glean a meaningful history of your working tree.

While in the operable borders of Git, it's outside the normal usage patterns. If you have success, let us know how it worked for you.

-- 
Marcus Griep
GPG Key ID: 0x5E968152
——
http://www.boohaunt.net
את.ψο´
Previous: Pat LeSmitheNext: David Tweed
Message 2 of 9 in “Dumb "continuous" commit dumb question”
  1. Pat LeSmitheAug 19, 2008
  2. Marcus GriepAug 19, 2008
  3. David TweedAug 19, 2008
  4. Shawn O. PearceAug 19, 2008
  5. Jeff KingAug 19, 2008
  6. Avery PennarunAug 19, 2008
  7. David TweedAug 19, 2008
  8. Avery PennarunAug 19, 2008
  9. David TweedAug 19, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.