Re: Commiting automatically
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Sep 25, 2010, 10:05 UTC
- Message-ID
- <AANLkTimpyTVe+OhYRhsV3H8TGahgsASOPAZRqwR=V6od@mail.gmail.com>
- In-Reply-To
- <loom.20100924T224155-693@post.gmane.org>
On Fri, Sep 24, 2010 at 22:43, Maaartin <grajcar1@seznam.cz> wrote:
Show 5 quoted lines
> I'm going to run periodically a process which uses the current working tree and > I'd like to protocol what happens. As a part of the protocol I need the exact > state of the working tree and that's what is git good for, right? But it must > neither disturb my normal workflow nor interfere with my ordinal commits. I > could probably use something like
...
> Even if there were no problems, it's not very nice. It uses an additional > repository which is quite strange. Moreover, there's no way to find out how the > saved working tree snapshot is related to existing ordinal commits.
Try using low-level git commands (the "plumbing"). Take a look at GIT_INDEX_FILE environment variable and "git write-tree", "git commit-tree" and "git update-ref", in addition to "git add".
I.e. (untested):
$ ( export GIT_INDEX_FILE=.git/myindex git add . && tree=$(git write-tree) && commit=$(date |git commit-tree $tree -p protocol) && git update-ref -m autolog protocol $commit )