Re: Avoid wasting memory in git-rev-list
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 15, 2005, 22:38 UTC
- Message-ID
- <Pine.LNX.4.63.0509160034170.20360@wgmdd8.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <7v7jdiyop9.fsf@assigned-by-dhcp.cox.net>
Hi Linus, hi Junio,
On Thu, 15 Sep 2005, Junio C Hamano wrote:
Show 17 quoted lines
> So using this I could also avoid wasting memory by the "are we
> already walking the commit reachable from our existing refs"
> check by doing something like this?
>
> ------------
> git diff
> diff --git a/fetch.c b/fetch.c
> --- a/fetch.c
> +++ b/fetch.c
> @@ -207,6 +207,7 @@ int pull(char *target)
> unsigned char sha1[20];
> int fd = -1;
>
> + save_commit_buffer = 0;
> if (write_ref && current_ref) {
> fd = lock_ref_sha1(write_ref, current_ref);
> if (fd < 0)Together with both of Linus' patches, this works wonders! It uses _lots_ less of memory. Actually, the performance impact on my tiny server was negligible.
Ciao, Dscho