Re: Advice on strategy for "temporary" commits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Tweed <david.tweed@xxxxxxxxx> wrote:

> 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 $commit

It 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]
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]