Re: Advice on strategy for "temporary" commits
- From
- Mark Wooding <mdw@distorted.org.uk>
- Date
- Mar 8, 2007, 18:02 UTC
- Message-ID
- <slrnev0jtg.7lh.mdw@metalzone.distorted.org.uk>
- In-Reply-To
- <e1dab3980703080907v58739287p18bc2797db7d209e@mail.gmail.com>
David Tweed <david.tweed@gmail.com> wrote:
Show 8 quoted lines
> a-----------a-----------a-----------a > \ $ $ $ > \-t---t---t---t---t---t---t---t---t > > AIUI neither git-branch nor git-checkout provide > a way to do this. (Clearly the git datastructures > can represent this situation, I'm just not sure how > to ask the tools to do it.)
You want the raw git-commit-tree tool. Suppose your branches are tmp and hourly (both in refs/heads). Something like this should make your hourly commit:
commit=$(
echo hourly-commit |
git commit-tree refs/heads/tmp^{tree} -p refs/heads/hourly)
git update-ref -m "hourly commit" refs/heads/hourly $commitIt might be that you should then start basing your temporary commits on the most recent archive, so you should also
git update-ref -m "hourly commit" refs/heads/tmp $commit
Then what you'll end up with is something like
a-----------a-----------a-----------a \ $\ $\ $ \-t---t---t \-t---t---t \-t---t---t
Does that seem sane?
-- [mdw]