Re: [ANNOUNCE] chronoversion: chronological archiving script with temporary commits

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

 



Hi,

On Tue, 13 Mar 2007, Johannes Schindelin wrote:

> Hi,
> 
> On Tue, 13 Mar 2007, Shawn O. Pearce wrote:
> 
> > David Tweed <david.tweed@xxxxxxxxx> wrote:
> > > A question for those who understand things: I stash the last written
> > > _tree_'s hash in a tag and then when a new "commit's" directory tree
> > > is written starts look to see if it's the same SHA value. If it is I
> > > know I can avoid the commit. At the moment I'm using
> > > 
> > >    if os.path.exists(lastTreeFile) and
> > > tree==open(lastTreeFile,"r").read()[:40]:
> > > 
> > > to be safe just in case a user, eg, goes mad and manually deletes that
> > > record. Clearly this is going to hit trouble if git ever decides to
> > > put this tag into a packed refs file.
> > > Is there any neat way of using builtin stuff like git-rev-parse to ask
> > > if a ref has a given SHA1 value and return an easily parsed yes/no
> > > answer?
> > 
> > The common idiom if you want to compare trees to see if you
> > need to make a commit is:
> > 
> > 	oldc=`git rev-parse $tagname^{commit}`
> > 	oldt=`git rev-parse $oldc^{tree}`
> > 	newt`git write-tree`
> 
> 	new=`git write-tree`

D'OH!

	newt=`git write-tree`

Oh, well...

-
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]