Re: fetching packs and storing them as packs

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

 



Shawn Pearce <spearce@xxxxxxxxxxx> writes:

> Shawn Pearce <spearce@xxxxxxxxxxx> wrote:
>> Why not just use create a new flag file?
>> 
>> Lets say that a pack X is NOT eligible to be repacked if
>> "$GIT_DIR/objects/pack/pack-X.keep" exists.
>
> Here's the `git repack -a -d` portion of that.
> Thoughts?

> +	args=--unpacked
> +	active=
> +	if test -d "$PACKDIR"
> +	then
> +		for p in `find "$PACKDIR" -type f -name '*.pack' -print`

This change to run 'find "$PACKDIR"' is fragile when your
$GIT_OBJECT_DIRECTORY has $IFS in it; running "find ." after
"cd" in a subprocess was done very much on purpose to avoid that
issue.  Please don't break it.

> +		do
> +			n=`basename "$p" .pack`
> +			d=`dirname "$p"`
> +			if test -e "$d/$n.keep"
> +			then
> +				: keep
> +			else
> +				args="$args --unpacked=$p"
> +				active="$active $n"
> +			fi
> +		done
> +	fi
> +	if test "X$args" = X--unpacked
> +	then
> +		args='--unpacked --incremental'
> +	fi
>  	;;
>  esac

I do not remember offhand what --incremental meant, but
presumably this is for the very initial "repack" (PACKDIR did
not exist or find loop did not find anything to repack) and the
flag would not make a difference?  Care to explain?

Other than that, the overall structure seems quite sane.


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