Re: Making custom git-remove-tree command

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

 



Teemu Likonen schrieb:
> * 2010-02-04 10:55 (+0100), Johannes Sixt wrote:
> 
>> I think you should be able to reduce all of this to just
>>
>> git read-tree --index-output=/tmp/empty.index -m -u \
>> 	4b825dc642cb6eb9a060e54bf8d69288fbee4904 # empty tree
>> rm -f /tmp/empty.index
>>
>> (with the usual caveats about temporary files).
> 
> Thanks, it works. It's also _much_ faster than my "git ls-tree" with
> shell loop thing. It prints ugly error, though:
> 
>     fatal: unable to write new index file

Then put the temporary index into your git-dir:

   gitdir=$(git rev-parse --git-dir)
   git read-tree --index-ouput="$gitdir/tmpindex" ...
   rm -f "$gitdir/tmpindex"

The purpose of this temporary index is only that your real index is not
cleared. If you don't mind that your index is purged as well, then you can
just drop the --index-output parameter.

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