Re: [PATCH v2 2/4] t3427: accelerate this test by using fast-export and fast-import
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Aug 28, 2019, 06:00 UTC
- Message-ID
- <CAPig+cQco8vtj498G_3tbsF_PFxXidUPgPZtOdNYqySGuz5c_A@mail.gmail.com>
- In-Reply-To
- <20190828002210.8862-3-newren@gmail.com>
On Tue, Aug 27, 2019 at 8:22 PM Elijah Newren <newren@gmail.com> wrote:
Show 12 quoted lines
> fast-export and fast-import can easily handle the simple rewrite that
> was being done by filter-branch, and should be significantly faster on
> systems with a slow fork. Timings from before and after on two laptops
> that I have access to (measured via `time ./t3427-rebase-subtree.sh`,
> i.e. including everything in this test -- not just the filter-branch or
> fast-export/fast-import pair):
> [...]
> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---
> diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
> @@ -11,6 +11,12 @@ commit_message() {
> +extract_files_subtree() {Style nit: add space before opening '('(However, commit_message() function just above this doesn't follow that style, so...)
> + git fast-export --no-data HEAD -- files_subtree/ \
> + | sed -e "s%\([0-9a-f]\{40\} \)files_subtree/%\1%" \
> + | git fast-import --force --quietThis would be a bit less noisy if you ended each line with the pipe operator, allowing you to drop the backslashes:
git fast-export --no-data HEAD -- files_subtree/ |
sed -e "s%\([0-9a-f]\{40\} \)files_subtree/%\1%" |
git fast-import --force --quiet> +}
Not sure any of this is worth a re-roll.