Re: [PATCH v5 2/4] t3427: accelerate this test by using fast-export and fast-import

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

 



Elijah Newren <newren@xxxxxxxxx> writes:

> +extract_files_subtree () {
> +	git fast-export --no-data HEAD -- files_subtree/ |
> +		sed -e "s%\([0-9a-f]\{40\} \)files_subtree/%\1%" |
> +		git fast-import --force --quiet
> +}

Clever, if a bit filthy ;-).  We expect to see something like

	M 100644 dead...beef files_subtree/bar
	M 100755 c0f.....fee files_subtree/foo

in the --no-data output, and the assumption here is that 40-hex
followed by " files_subtree/" would never appear anywhere in the
stream other than these tree dump, so the sed script can rewrite
the above to

	M 100644 dead...beef bar
	M 100755 c0f.....fee foo

by getting rid of the leading directory name (plus the slash at the
end).

Thanks.



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

  Powered by Linux