{"thread":{"id":"42275","subject":"[PATCH 0/3] Introduce a perf test for interactive rebase","startedAt":"2016-05-10T15:36:30Z","lastAt":"2016-06-21T19:27:30Z","messageCount":26,"participants":["Johannes Schindelin","Junio C Hamano","Eric Sunshine","René Scharfe","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"286071","messageId":"cover.1462894344.git.johannes.schindelin@gmx.de","threadId":"42275","inReplyTo":null,"subject":"[PATCH 0/3] Introduce a perf test for interactive rebase","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-10T15:36:30Z","receivedAt":"2016-05-10T15:36:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This is the second preparatory patch series for my rebase--helper work\n(i.e. moving parts of the interactive rebase into a builtin).\n\nIt simply introduces a perf test (and ensures that it runs in my\nenvironment) so as to better determine how much the performance changes,\nreally.\n\n\nJohannes Schindelin (3):\n  perf: let's disable symlinks on Windows\n  perf: make the tests work in worktrees\n  Add a perf test for rebase -i\n\n t/perf/p3404-rebase-interactive.sh | 31 +++++++++++++++++++++++++++++++\n t/perf/perf-lib.sh                 | 18 +++++++++++-------\n 2 files changed, 42 insertions(+), 7 deletions(-)\n create mode 100755 t/perf/p3404-rebase-interactive.sh\n\nPublished-As: https://github.com/dscho/git/releases/tag/perf-rebase-i-v1\n-- \n2.8.2.465.gb077790\n"},{"id":"286073","messageId":"alpine.DEB.2.20.1605101738390.4092@virtualbox","threadId":"42275","inReplyTo":"cover.1462894344.git.johannes.schindelin@gmx.de","subject":"[PATCH 1/3] perf: let's disable symlinks on Windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-10T15:41:53Z","receivedAt":"2016-05-10T15:41:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"In Git for Windows' SDK, Git's source code is always checked out\nwith symlinks disabled. The reason is that POSIX symlinks have no\naccurate equivalent on Windows [*1*]. More precisely, though, it is\nnot just Git's source code but *all* source code that is checked\nout with symlinks disabled: core.symlinks is set to false in the\nsystem-wide gitconfig.\n\nSince the perf tests are run with the system-wide gitconfig *disabled*,\nwe have to make sure that the Git repository is initialized correctly\nby configuring core.symlinks explicitly.\n\nFootnote *1*:\nhttps://github.com/git-for-windows/git/wiki/Symbolic-Links\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/perf/perf-lib.sh | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\nindex 5cf74ed..e9020d0 100644\n--- a/t/perf/perf-lib.sh\n+++ b/t/perf/perf-lib.sh\n@@ -97,6 +97,10 @@ test_perf_create_repo_from () {\n \t\tdone &&\n \t\tcd .. &&\n \t\tgit init -q &&\n+\t\tif test_have_prereq MINGW\n+\t\tthen\n+\t\t\tgit config core.symlinks false\n+\t\tfi &&\n \t\tmv .git/hooks .git/hooks-disabled 2>/dev/null\n \t) || error \"failed to copy repository '$source' to '$repo'\"\n }\n-- \n2.8.2.465.gb077790\n"},{"id":"286072","messageId":"63972edcda32c3c927e956f2e96d5b61843d64f2.1462894344.git.johannes.schindelin@gmx.de","threadId":"42275","inReplyTo":"cover.1462894344.git.johannes.schindelin@gmx.de","subject":"[PATCH 2/3] perf: make the tests work in worktrees","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-10T15:42:00Z","receivedAt":"2016-05-10T15:42:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This patch makes perf-lib.sh more robust so that it can run correctly\neven inside a worktree. For example, it assumed that $GIT_DIR/objects is\nthe objects directory (which is not the case for worktrees) and it used\nthe commondir file verbatim, even if it contained a relative path.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/perf/perf-lib.sh | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\nindex e9020d0..e5682f7 100644\n--- a/t/perf/perf-lib.sh\n+++ b/t/perf/perf-lib.sh\n@@ -80,22 +80,22 @@ test_perf_create_repo_from () {\n \terror \"bug in the test script: not 2 parameters to test-create-repo\"\n \trepo=\"$1\"\n \tsource=\"$2\"\n-\tsource_git=$source/$(cd \"$source\" && git rev-parse --git-dir)\n+\tsource_git=\"$(cd \"$source\" && git rev-parse --git-dir)\"\n+\tobjects_dir=\"$(git rev-parse --git-path objects)\"\n \tmkdir -p \"$repo/.git\"\n \t(\n-\t\tcd \"$repo/.git\" &&\n-\t\t{ cp -Rl \"$source_git/objects\" . 2>/dev/null ||\n-\t\t\tcp -R \"$source_git/objects\" .; } &&\n+\t\t{ cp -Rl \"$objects_dir\" \"$repo/.git/\" 2>/dev/null ||\n+\t\t\tcp -R \"$objects_dir\" \"$repo/.git/\"; } &&\n \t\tfor stuff in \"$source_git\"/*; do\n \t\t\tcase \"$stuff\" in\n-\t\t\t\t*/objects|*/hooks|*/config)\n+\t\t\t\t*/objects|*/hooks|*/config|*/commondir)\n \t\t\t\t\t;;\n \t\t\t\t*)\n-\t\t\t\t\tcp -R \"$stuff\" . || exit 1\n+\t\t\t\t\tcp -R \"$stuff\" \"$repo/.git/\" || exit 1\n \t\t\t\t\t;;\n \t\t\tesac\n \t\tdone &&\n-\t\tcd .. &&\n+\t\tcd \"$repo\" &&\n \t\tgit init -q &&\n \t\tif test_have_prereq MINGW\n \t\tthen\n-- \n2.8.2.465.gb077790\n"},{"id":"286074","messageId":"alpine.DEB.2.20.1605101744060.4092@virtualbox","threadId":"42275","inReplyTo":"cover.1462894344.git.johannes.schindelin@gmx.de","subject":"[PATCH 3/3] Add a perf test for rebase -i","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-10T15:45:08Z","receivedAt":"2016-05-10T15:45:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This developer spent a lot of time trying to speed up the interactive\nrebase, in particular on Windows. And will continue to do so.\n\nTo make it easier to demonstrate the performance improvement, let's have\na reproducible performance test.\n\nThe topic branch we use to test performance was found using these shell\ncommands (essentially searching for a long-enough topic branch in Git's\nown history that touched the same file multiple times):\n\n\tgit rev-list --parents origin/master |\n\tgrep ' .* ' |\n\twhile read commit rest\n\tdo\n\t\tpatch_count=$(git rev-list --count $commit^..$commit^2)\n\t\ttest $patch_count -gt 20 || continue\n\n\t\tmerges=\"$(git rev-list --parents $commit^..$commit^2 |\n\t\t\tgrep ' .* ')\"\n\t\ttest -z \"$merges\" || continue\n\n\t\tpatches_per_file=\"$(git log --pretty=%H --name-only \\\n\t\t\t\t$commit^..$commit^2 |\n\t\t\tgrep -v '^$' |\n\t\t\tsort |\n\t\t\tuniq -c -d |\n\t\t\tsort -n -r)\"\n\t\ttest -n \"$patches_per_file\" &&\n\t\ttest 20 -lt $(echo \"$patches_per_file\" |\n\t\t\tsed -n '1s/^ *\\([0-9]*\\).*/\\1/p') || continue\n\n\t\tprintf 'commit %s\\n%s\\n' \"$commit\" \"$patches_per_file\"\n\tdone\n\nNote that we can get away with *not* having to reset to the original\nbranch tip before rebasing: we switch the first two \"pick\" lines every\ntime, so we end up with the same patch order after two rebases, and the\ncomplexity of both rebases is equivalent.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/perf/p3404-rebase-interactive.sh | 31 +++++++++++++++++++++++++++++++\n 1 file changed, 31 insertions(+)\n create mode 100755 t/perf/p3404-rebase-interactive.sh\n\ndiff --git a/t/perf/p3404-rebase-interactive.sh b/t/perf/p3404-rebase-interactive.sh\nnew file mode 100755\nindex 0000000..382163c\n--- /dev/null\n+++ b/t/perf/p3404-rebase-interactive.sh\n@@ -0,0 +1,31 @@\n+#!/bin/sh\n+\n+test_description='Tests rebase -i performance'\n+. ./perf-lib.sh\n+\n+test_perf_default_repo\n+\n+# This commit merges a sufficiently long topic branch for reasonable\n+# performance testing\n+branch_merge=ba5312d\n+export branch_merge\n+\n+write_script swap-first-two.sh <<\\EOF\n+case \"$1\" in\n+*/COMMIT_EDITMSG)\n+\tmv \"$1\" \"$1\".bak &&\n+\tsed -e '1{h;d}' -e 2G <\"$1\".bak >\"$1\"\n+\t;;\n+esac\n+EOF\n+\n+test_expect_success 'setup' '\n+\tgit config core.editor \"\\\"$PWD\"/swap-first-two.sh\\\" &&\n+\tgit checkout -f $branch_merge^2\n+'\n+\n+test_perf 'rebase -i' '\n+\tgit rebase -i $branch_merge^\n+'\n+\n+test_done\n-- \n2.8.2.465.gb077790\n"},{"id":"286102","messageId":"xmqqoa8dofmu.fsf@gitster.mtv.corp.google.com","threadId":"42275","inReplyTo":"alpine.DEB.2.20.1605101738390.4092@virtualbox","subject":"Re: [PATCH 1/3] perf: let's disable symlinks on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-10T19:51:53Z","receivedAt":"2016-05-10T19:51:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> In Git for Windows' SDK, Git's source code is always checked out\n> with symlinks disabled. The reason is that POSIX symlinks have no\n> accurate equivalent on Windows [*1*]. More precisely, though, it is\n> not just Git's source code but *all* source code that is checked\n> out with symlinks disabled: core.symlinks is set to false in the\n> system-wide gitconfig.\n>\n> Since the perf tests are run with the system-wide gitconfig *disabled*,\n> we have to make sure that the Git repository is initialized correctly\n> by configuring core.symlinks explicitly.\n\nIs MINGW the right prerequisite to use here, or is SIMLINKS more\nappropriate?\n\n>\n> Footnote *1*:\n> https://github.com/git-for-windows/git/wiki/Symbolic-Links\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  t/perf/perf-lib.sh | 4 ++++\n>  1 file changed, 4 insertions(+)\n>\n> diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n> index 5cf74ed..e9020d0 100644\n> --- a/t/perf/perf-lib.sh\n> +++ b/t/perf/perf-lib.sh\n> @@ -97,6 +97,10 @@ test_perf_create_repo_from () {\n>  \t\tdone &&\n>  \t\tcd .. &&\n>  \t\tgit init -q &&\n> +\t\tif test_have_prereq MINGW\n> +\t\tthen\n> +\t\t\tgit config core.symlinks false\n> +\t\tfi &&\n>  \t\tmv .git/hooks .git/hooks-disabled 2>/dev/null\n>  \t) || error \"failed to copy repository '$source' to '$repo'\"\n>  }\n"},{"id":"286107","messageId":"xmqq7ff1ody6.fsf@gitster.mtv.corp.google.com","threadId":"42275","inReplyTo":"63972edcda32c3c927e956f2e96d5b61843d64f2.1462894344.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 2/3] perf: make the tests work in worktrees","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-10T20:28:17Z","receivedAt":"2016-05-10T20:28:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> This patch makes perf-lib.sh more robust so that it can run correctly\n> even inside a worktree. For example, it assumed that $GIT_DIR/objects is\n> the objects directory (which is not the case for worktrees) and it used\n> the commondir file verbatim, even if it contained a relative path.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  t/perf/perf-lib.sh | 14 +++++++-------\n>  1 file changed, 7 insertions(+), 7 deletions(-)\n>\n> diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n> index e9020d0..e5682f7 100644\n> --- a/t/perf/perf-lib.sh\n> +++ b/t/perf/perf-lib.sh\n> @@ -80,22 +80,22 @@ test_perf_create_repo_from () {\n>  \terror \"bug in the test script: not 2 parameters to test-create-repo\"\n>  \trepo=\"$1\"\n>  \tsource=\"$2\"\n> -\tsource_git=$source/$(cd \"$source\" && git rev-parse --git-dir)\n> +\tsource_git=\"$(cd \"$source\" && git rev-parse --git-dir)\"\n> +\tobjects_dir=\"$(git rev-parse --git-path objects)\"\n\nI do not quite understand this change.  Whose object_dir is this\nlooking into?  The original wanted to peek into $source/.git/objects/\nwhich may have been wrong when $source is borrowing from some other\nrepository, but the new invocation of rev-parse --git-path objects\nis done inside what repository?  It does not seem to pay any attention\nto $source and the change below just copies from there into $repo.\n\nConfused.\n\n>  \tmkdir -p \"$repo/.git\"\n>  \t(\n> -\t\tcd \"$repo/.git\" &&\n> -\t\t{ cp -Rl \"$source_git/objects\" . 2>/dev/null ||\n> -\t\t\tcp -R \"$source_git/objects\" .; } &&\n> +\t\t{ cp -Rl \"$objects_dir\" \"$repo/.git/\" 2>/dev/null ||\n> +\t\t\tcp -R \"$objects_dir\" \"$repo/.git/\"; } &&\n>  \t\tfor stuff in \"$source_git\"/*; do\n>  \t\t\tcase \"$stuff\" in\n> -\t\t\t\t*/objects|*/hooks|*/config)\n> +\t\t\t\t*/objects|*/hooks|*/config|*/commondir)\n>  \t\t\t\t\t;;\n>  \t\t\t\t*)\n> -\t\t\t\t\tcp -R \"$stuff\" . || exit 1\n> +\t\t\t\t\tcp -R \"$stuff\" \"$repo/.git/\" || exit 1\n>  \t\t\t\t\t;;\n>  \t\t\tesac\n>  \t\tdone &&\n> -\t\tcd .. &&\n> +\t\tcd \"$repo\" &&\n>  \t\tgit init -q &&\n>  \t\tif test_have_prereq MINGW\n>  \t\tthen\n"},{"id":"286157","messageId":"alpine.DEB.2.20.1605111004020.4092@virtualbox","threadId":"42275","inReplyTo":"xmqq7ff1ody6.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/3] perf: make the tests work in worktrees","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-11T08:08:01Z","receivedAt":"2016-05-11T08:08:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 10 May 2016, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n> > index e9020d0..e5682f7 100644\n> > --- a/t/perf/perf-lib.sh\n> > +++ b/t/perf/perf-lib.sh\n> > @@ -80,22 +80,22 @@ test_perf_create_repo_from () {\n> >  \terror \"bug in the test script: not 2 parameters to test-create-repo\"\n> >  \trepo=\"$1\"\n> >  \tsource=\"$2\"\n> > -\tsource_git=$source/$(cd \"$source\" && git rev-parse --git-dir)\n> > +\tsource_git=\"$(cd \"$source\" && git rev-parse --git-dir)\"\n> > +\tobjects_dir=\"$(git rev-parse --git-path objects)\"\n> \n> I do not quite understand this change.  Whose object_dir is this\n> looking into?  The original wanted to peek into $source/.git/objects/\n> which may have been wrong when $source is borrowing from some other\n> repository, but the new invocation of rev-parse --git-path objects\n> is done inside what repository?  It does not seem to pay any attention\n> to $source and the change below just copies from there into $repo.\n\nBah. This got messed up in one of my interactive rebases. And then I\nmissed it in my final look-over before sending. Sorry. Fixed in v2.\n\nCiao,\nDscho\n"},{"id":"286158","messageId":"alpine.DEB.2.20.1605110857510.4092@virtualbox","threadId":"42275","inReplyTo":"xmqqoa8dofmu.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 1/3] perf: let's disable symlinks on Windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-11T08:09:14Z","receivedAt":"2016-05-11T08:09:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 10 May 2016, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > In Git for Windows' SDK, Git's source code is always checked out\n> > with symlinks disabled. The reason is that POSIX symlinks have no\n> > accurate equivalent on Windows [*1*]. More precisely, though, it is\n> > not just Git's source code but *all* source code that is checked\n> > out with symlinks disabled: core.symlinks is set to false in the\n> > system-wide gitconfig.\n> >\n> > Since the perf tests are run with the system-wide gitconfig *disabled*,\n> > we have to make sure that the Git repository is initialized correctly\n> > by configuring core.symlinks explicitly.\n> \n> Is MINGW the right prerequisite to use here, or is SIMLINKS more\n> appropriate?\n\nOh, you're absolutely correct! It has nothing to do with MINGW itself, of\ncourse.\n\nFixed in v2,\nDscho\n"},{"id":"286159","messageId":"cover.1462955446.git.johannes.schindelin@gmx.de","threadId":"42275","inReplyTo":"cover.1462894344.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 0/3] Introduce a perf test for interactive rebase","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-11T08:31:17Z","receivedAt":"2016-05-11T08:31:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This is the second preparatory patch series for my rebase--helper work\n(i.e. moving parts of the interactive rebase into a builtin).\n\nIt simply introduces a perf test (and ensures that it runs in my\nenvironment) so as to better determine how much the performance changes,\nreally.\n\n\nJohannes Schindelin (3):\n  perf: let's disable symlinks when they are not available\n  perf: make the tests work in worktrees\n  Add a perf test for rebase -i\n\n t/perf/p3404-rebase-interactive.sh | 31 +++++++++++++++++++++++++++++++\n t/perf/perf-lib.sh                 | 18 +++++++++++-------\n 2 files changed, 42 insertions(+), 7 deletions(-)\n create mode 100755 t/perf/p3404-rebase-interactive.sh\n\nPublished-As: https://github.com/dscho/git/releases/tag/perf-rebase-i-v2\nInterdiff vs v1:\n\n diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n index e5682f7..cb88b08 100644\n --- a/t/perf/perf-lib.sh\n +++ b/t/perf/perf-lib.sh\n @@ -81,7 +81,7 @@ test_perf_create_repo_from () {\n  \trepo=\"$1\"\n  \tsource=\"$2\"\n  \tsource_git=\"$(cd \"$source\" && git rev-parse --git-dir)\"\n -\tobjects_dir=\"$(git rev-parse --git-path objects)\"\n +\tobjects_dir=\"$(cd \"$source\" && git rev-parse --git-path objects)\"\n  \tmkdir -p \"$repo/.git\"\n  \t(\n  \t\t{ cp -Rl \"$objects_dir\" \"$repo/.git/\" 2>/dev/null ||\n @@ -97,10 +97,10 @@ test_perf_create_repo_from () {\n  \t\tdone &&\n  \t\tcd \"$repo\" &&\n  \t\tgit init -q &&\n -\t\tif test_have_prereq MINGW\n -\t\tthen\n +\t\tgit init -q && {\n +\t\t\ttest_have_prereq SYMLINKS ||\n  \t\t\tgit config core.symlinks false\n -\t\tfi &&\n +\t\t} &&\n  \t\tmv .git/hooks .git/hooks-disabled 2>/dev/null\n  \t) || error \"failed to copy repository '$source' to '$repo'\"\n  }\n\n-- \n2.8.2.465.gb077790\n"},{"id":"286163","messageId":"96acc54c20962376d5438f8d9613dc9c8a6d5d1c.1462955446.git.johannes.schindelin@gmx.de","threadId":"42275","inReplyTo":"cover.1462955446.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 3/3] Add a perf test for rebase -i","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-11T08:42:34Z","receivedAt":"2016-05-11T08:42:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This developer spent a lot of time trying to speed up the interactive\nrebase, in particular on Windows. And will continue to do so.\n\nTo make it easier to demonstrate the performance improvement, let's have\na reproducible performance test.\n\nThe topic branch we use to test performance was found using these shell\ncommands (essentially searching for a long-enough topic branch in Git's\nown history that touched the same file multiple times):\n\n\tgit rev-list --parents origin/master |\n\tgrep ' .* ' |\n\twhile read commit rest\n\tdo\n\t\tpatch_count=$(git rev-list --count $commit^..$commit^2)\n\t\ttest $patch_count -gt 20 || continue\n\n\t\tmerges=\"$(git rev-list --parents $commit^..$commit^2 |\n\t\t\tgrep ' .* ')\"\n\t\ttest -z \"$merges\" || continue\n\n\t\tpatches_per_file=\"$(git log --pretty=%H --name-only \\\n\t\t\t\t$commit^..$commit^2 |\n\t\t\tgrep -v '^$' |\n\t\t\tsort |\n\t\t\tuniq -c -d |\n\t\t\tsort -n -r)\"\n\t\ttest -n \"$patches_per_file\" &&\n\t\ttest 20 -lt $(echo \"$patches_per_file\" |\n\t\t\tsed -n '1s/^ *\\([0-9]*\\).*/\\1/p') || continue\n\n\t\tprintf 'commit %s\\n%s\\n' \"$commit\" \"$patches_per_file\"\n\tdone\n\nNote that we can get away with *not* having to reset to the original\nbranch tip before rebasing: we switch the first two \"pick\" lines every\ntime, so we end up with the same patch order after two rebases, and the\ncomplexity of both rebases is equivalent.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/perf/p3404-rebase-interactive.sh | 31 +++++++++++++++++++++++++++++++\n 1 file changed, 31 insertions(+)\n create mode 100755 t/perf/p3404-rebase-interactive.sh\n\ndiff --git a/t/perf/p3404-rebase-interactive.sh b/t/perf/p3404-rebase-interactive.sh\nnew file mode 100755\nindex 0000000..382163c\n--- /dev/null\n+++ b/t/perf/p3404-rebase-interactive.sh\n@@ -0,0 +1,31 @@\n+#!/bin/sh\n+\n+test_description='Tests rebase -i performance'\n+. ./perf-lib.sh\n+\n+test_perf_default_repo\n+\n+# This commit merges a sufficiently long topic branch for reasonable\n+# performance testing\n+branch_merge=ba5312d\n+export branch_merge\n+\n+write_script swap-first-two.sh <<\\EOF\n+case \"$1\" in\n+*/COMMIT_EDITMSG)\n+\tmv \"$1\" \"$1\".bak &&\n+\tsed -e '1{h;d}' -e 2G <\"$1\".bak >\"$1\"\n+\t;;\n+esac\n+EOF\n+\n+test_expect_success 'setup' '\n+\tgit config core.editor \"\\\"$PWD\"/swap-first-two.sh\\\" &&\n+\tgit checkout -f $branch_merge^2\n+'\n+\n+test_perf 'rebase -i' '\n+\tgit rebase -i $branch_merge^\n+'\n+\n+test_done\n-- \n2.8.2.465.gb077790\n"},{"id":"286164","messageId":"d783290cabe601ee8623044482b2992fb7936534.1462955446.git.johannes.schindelin@gmx.de","threadId":"42275","inReplyTo":"cover.1462955446.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 2/3] perf: make the tests work in worktrees","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-11T08:42:38Z","receivedAt":"2016-05-11T08:42:38Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This patch makes perf-lib.sh more robust so that it can run correctly\neven inside a worktree. For example, it assumed that $GIT_DIR/objects is\nthe objects directory (which is not the case for worktrees) and it used\nthe commondir file verbatim, even if it contained a relative path.\n\nFurthermore, the setup code expected `git rev-parse --git-dir` to spit\nout a relative path, which is also not true for worktrees. Let's just\nchange the code to accept both relative and absolute paths, by avoiding\nthe `cd` into the copied working directory.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/perf/perf-lib.sh | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\nindex 50c8c39..cb88b08 100644\n--- a/t/perf/perf-lib.sh\n+++ b/t/perf/perf-lib.sh\n@@ -80,22 +80,22 @@ test_perf_create_repo_from () {\n \terror \"bug in the test script: not 2 parameters to test-create-repo\"\n \trepo=\"$1\"\n \tsource=\"$2\"\n-\tsource_git=$source/$(cd \"$source\" && git rev-parse --git-dir)\n+\tsource_git=\"$(cd \"$source\" && git rev-parse --git-dir)\"\n+\tobjects_dir=\"$(cd \"$source\" && git rev-parse --git-path objects)\"\n \tmkdir -p \"$repo/.git\"\n \t(\n-\t\tcd \"$repo/.git\" &&\n-\t\t{ cp -Rl \"$source_git/objects\" . 2>/dev/null ||\n-\t\t\tcp -R \"$source_git/objects\" .; } &&\n+\t\t{ cp -Rl \"$objects_dir\" \"$repo/.git/\" 2>/dev/null ||\n+\t\t\tcp -R \"$objects_dir\" \"$repo/.git/\"; } &&\n \t\tfor stuff in \"$source_git\"/*; do\n \t\t\tcase \"$stuff\" in\n-\t\t\t\t*/objects|*/hooks|*/config)\n+\t\t\t\t*/objects|*/hooks|*/config|*/commondir)\n \t\t\t\t\t;;\n \t\t\t\t*)\n-\t\t\t\t\tcp -R \"$stuff\" . || exit 1\n+\t\t\t\t\tcp -R \"$stuff\" \"$repo/.git/\" || exit 1\n \t\t\t\t\t;;\n \t\t\tesac\n \t\tdone &&\n-\t\tcd .. &&\n+\t\tcd \"$repo\" &&\n \t\tgit init -q &&\n \t\tgit init -q && {\n \t\t\ttest_have_prereq SYMLINKS ||\n-- \n2.8.2.465.gb077790\n"},{"id":"286165","messageId":"d651a7fdd7af6e1e7c32599bca9efeb6fd923e7c.1462955446.git.johannes.schindelin@gmx.de","threadId":"42275","inReplyTo":"cover.1462955446.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 1/3] perf: let's disable symlinks when they are not available","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-11T08:42:44Z","receivedAt":"2016-05-11T08:42:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"We already have a perfectly fine prereq to tell us whether it is safe to\nuse symlinks. So let's use it.\n\nThis fixes the performance tests in Git for Windows' SDK, where symlinks\nare not really available ([*1*]). This is not an issue with Git for\nWindows itself because it configures core.symlinks=false in its system\nconfig.  However, the system config is disabled for the performance\ntests, for obvious reasons: we want them to be independent of the\nvagaries of any local configuration.\n\nFootnote *1*: Windows has symbolic links. Git for Windows disables them\nby default, though (for example: in standard setups, non-admins lack the\nprivilege to create symbolic links). For details, see\nhttps://github.com/git-for-windows/git/wiki/Symbolic-Links\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/perf/perf-lib.sh | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\nindex 5cf74ed..50c8c39 100644\n--- a/t/perf/perf-lib.sh\n+++ b/t/perf/perf-lib.sh\n@@ -97,6 +97,10 @@ test_perf_create_repo_from () {\n \t\tdone &&\n \t\tcd .. &&\n \t\tgit init -q &&\n+\t\tgit init -q && {\n+\t\t\ttest_have_prereq SYMLINKS ||\n+\t\t\tgit config core.symlinks false\n+\t\t} &&\n \t\tmv .git/hooks .git/hooks-disabled 2>/dev/null\n \t) || error \"failed to copy repository '$source' to '$repo'\"\n }\n-- \n2.8.2.465.gb077790\n"},{"id":"286279","messageId":"CAPig+cR=MeXZXA-Xdr-7A4nxfNvBrOy2ZtmzJOLHq5YGFiuNyA@mail.gmail.com","threadId":"42275","inReplyTo":"d783290cabe601ee8623044482b2992fb7936534.1462955446.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 2/3] perf: make the tests work in worktrees","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-05-11T17:40:44Z","receivedAt":"2016-05-11T17:40:44Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, May 11, 2016 at 4:42 AM, Johannes Schindelin\n<johannes.schindelin@gmx.de> wrote:\n> This patch makes perf-lib.sh more robust so that it can run correctly\n> even inside a worktree. For example, it assumed that $GIT_DIR/objects is\n> the objects directory (which is not the case for worktrees) and it used\n> the commondir file verbatim, even if it contained a relative path.\n>\n> Furthermore, the setup code expected `git rev-parse --git-dir` to spit\n> out a relative path, which is also not true for worktrees. Let's just\n> change the code to accept both relative and absolute paths, by avoiding\n> the `cd` into the copied working directory.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n> diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n> @@ -80,22 +80,22 @@ test_perf_create_repo_from () {\n> -       source_git=$source/$(cd \"$source\" && git rev-parse --git-dir)\n> +       source_git=\"$(cd \"$source\" && git rev-parse --git-dir)\"\n> +       objects_dir=\"$(cd \"$source\" && git rev-parse --git-path objects)\"\n\nWould it be out of the scope of this patch to simplify these by using -C?\n\n    source_git=$(git -C \"$source\" rev-parse --git-dir)\n"},{"id":"286287","messageId":"xmqqr3d8jnvo.fsf@gitster.mtv.corp.google.com","threadId":"42275","inReplyTo":"96acc54c20962376d5438f8d9613dc9c8a6d5d1c.1462955446.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 3/3] Add a perf test for rebase -i","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-11T21:17:15Z","receivedAt":"2016-05-11T21:17:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> diff --git a/t/perf/p3404-rebase-interactive.sh b/t/perf/p3404-rebase-interactive.sh\n> new file mode 100755\n> index 0000000..382163c\n> --- /dev/null\n> +++ b/t/perf/p3404-rebase-interactive.sh\n> @@ -0,0 +1,31 @@\n> +#!/bin/sh\n> +\n> +test_description='Tests rebase -i performance'\n> +. ./perf-lib.sh\n> +\n> +test_perf_default_repo\n> +\n> +# This commit merges a sufficiently long topic branch for reasonable\n> +# performance testing\n> +branch_merge=ba5312d\n> +export branch_merge\n\nt/perf/README mentions the possibility to use your own repository as\na test data via GIT_PERF_REPO, but doing so would obviously break\nthis test.\n\nI wonder if there is a way to say \"running this perf script with\ncustom GIT_PERF_REPO is not supported\" and error out.  That may\nhelp other existing tests that (incorrectly) assume that their test\ndata is this project (if there is any).\n\n> +\n> +write_script swap-first-two.sh <<\\EOF\n> +case \"$1\" in\n> +*/COMMIT_EDITMSG)\n> +\tmv \"$1\" \"$1\".bak &&\n> +\tsed -e '1{h;d}' -e 2G <\"$1\".bak >\"$1\"\n> +\t;;\n> +esac\n> +EOF\n> +\n> +test_expect_success 'setup' '\n> +\tgit config core.editor \"\\\"$PWD\"/swap-first-two.sh\\\" &&\n> +\tgit checkout -f $branch_merge^2\n> +'\n> +\n> +test_perf 'rebase -i' '\n> +\tgit rebase -i $branch_merge^\n> +'\n> +\n> +test_done\n"},{"id":"286453","messageId":"alpine.DEB.2.20.1605131352540.4092@virtualbox","threadId":"42275","inReplyTo":"CAPig+cR=MeXZXA-Xdr-7A4nxfNvBrOy2ZtmzJOLHq5YGFiuNyA@mail.gmail.com","subject":"Re: [PATCH v2 2/3] perf: make the tests work in worktrees","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-13T13:14:10Z","receivedAt":"2016-05-13T13:14:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Eric,\n\nOn Wed, 11 May 2016, Eric Sunshine wrote:\n\n> On Wed, May 11, 2016 at 4:42 AM, Johannes Schindelin\n> <johannes.schindelin@gmx.de> wrote:\n> > This patch makes perf-lib.sh more robust so that it can run correctly\n> > even inside a worktree. For example, it assumed that $GIT_DIR/objects is\n> > the objects directory (which is not the case for worktrees) and it used\n> > the commondir file verbatim, even if it contained a relative path.\n> >\n> > Furthermore, the setup code expected `git rev-parse --git-dir` to spit\n> > out a relative path, which is also not true for worktrees. Let's just\n> > change the code to accept both relative and absolute paths, by avoiding\n> > the `cd` into the copied working directory.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> > diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n> > @@ -80,22 +80,22 @@ test_perf_create_repo_from () {\n> > -       source_git=$source/$(cd \"$source\" && git rev-parse --git-dir)\n> > +       source_git=\"$(cd \"$source\" && git rev-parse --git-dir)\"\n> > +       objects_dir=\"$(cd \"$source\" && git rev-parse --git-path objects)\"\n> \n> Would it be out of the scope of this patch to simplify these by using -C?\n> \n>     source_git=$(git -C \"$source\" rev-parse --git-dir)\n\nThanks for educating me: I had not known about this option.\n\nWill send another iteration in a moment.\n\nCiao,\nDscho\n"},{"id":"286454","messageId":"alpine.DEB.2.20.1605131515410.4092@virtualbox","threadId":"42275","inReplyTo":"xmqqr3d8jnvo.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2 3/3] Add a perf test for rebase -i","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-13T13:16:51Z","receivedAt":"2016-05-13T13:16:51Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 11 May 2016, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > diff --git a/t/perf/p3404-rebase-interactive.sh b/t/perf/p3404-rebase-interactive.sh\n> > new file mode 100755\n> > index 0000000..382163c\n> > --- /dev/null\n> > +++ b/t/perf/p3404-rebase-interactive.sh\n> > @@ -0,0 +1,31 @@\n> > +#!/bin/sh\n> > +\n> > +test_description='Tests rebase -i performance'\n> > +. ./perf-lib.sh\n> > +\n> > +test_perf_default_repo\n> > +\n> > +# This commit merges a sufficiently long topic branch for reasonable\n> > +# performance testing\n> > +branch_merge=ba5312d\n> > +export branch_merge\n> \n> t/perf/README mentions the possibility to use your own repository as\n> a test data via GIT_PERF_REPO, but doing so would obviously break\n> this test.\n\nRight.\n\n> I wonder if there is a way to say \"running this perf script with\n> custom GIT_PERF_REPO is not supported\" and error out.  That may\n> help other existing tests that (incorrectly) assume that their test\n> data is this project (if there is any).\n\nGood point. I will change it so that the test is skipped if that commit is\nnot found.\n\nCiao,\nDscho\n"},{"id":"286455","messageId":"cover.1463145936.git.johannes.schindelin@gmx.de","threadId":"42275","inReplyTo":"cover.1462955446.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 0/3] Introduce a perf test for interactive rebase","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-13T13:25:46Z","receivedAt":"2016-05-13T13:25:46Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This is the second preparatory patch series for my rebase--helper work\n(i.e. moving parts of the interactive rebase into a builtin).\n\nIt simply introduces a perf test (and ensures that it runs in my\nenvironment) so as to better determine how much the performance changes,\nreally.\n\n\nJohannes Schindelin (3):\n  perf: let's disable symlinks when they are not available\n  perf: make the tests work in worktrees\n  Add a perf test for rebase -i\n\n t/perf/p3404-rebase-interactive.sh | 36 ++++++++++++++++++++++++++++++++++++\n t/perf/perf-lib.sh                 | 19 +++++++++++--------\n 2 files changed, 47 insertions(+), 8 deletions(-)\n create mode 100755 t/perf/p3404-rebase-interactive.sh\n\nPublished-As: https://github.com/dscho/git/releases/tag/perf-rebase-i-v3\nInterdiff vs v2:\n\n diff --git a/t/perf/p3404-rebase-interactive.sh b/t/perf/p3404-rebase-interactive.sh\n index 382163c..88f47de 100755\n --- a/t/perf/p3404-rebase-interactive.sh\n +++ b/t/perf/p3404-rebase-interactive.sh\n @@ -7,9 +7,14 @@ test_perf_default_repo\n  \n  # This commit merges a sufficiently long topic branch for reasonable\n  # performance testing\n -branch_merge=ba5312d\n +branch_merge=ba5312da19c6fdb6c6747d479f58932aae6e900c^{commit}\n  export branch_merge\n  \n +git rev-parse --verify $branch_merge >/dev/null 2>&1 || {\n +\tskip_all='skipping because $branch_merge was not found'\n +\ttest_done\n +}\n +\n  write_script swap-first-two.sh <<\\EOF\n  case \"$1\" in\n  */COMMIT_EDITMSG)\n diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n index cb88b08..5ef1744 100644\n --- a/t/perf/perf-lib.sh\n +++ b/t/perf/perf-lib.sh\n @@ -80,8 +80,8 @@ test_perf_create_repo_from () {\n  \terror \"bug in the test script: not 2 parameters to test-create-repo\"\n  \trepo=\"$1\"\n  \tsource=\"$2\"\n -\tsource_git=\"$(cd \"$source\" && git rev-parse --git-dir)\"\n -\tobjects_dir=\"$(cd \"$source\" && git rev-parse --git-path objects)\"\n +\tsource_git=\"$(git -C \"$source\" rev-parse --git-dir)\"\n +\tobjects_dir=\"$(git -C \"$source\" rev-parse --git-path objects)\"\n  \tmkdir -p \"$repo/.git\"\n  \t(\n  \t\t{ cp -Rl \"$objects_dir\" \"$repo/.git/\" 2>/dev/null ||\n @@ -96,7 +96,6 @@ test_perf_create_repo_from () {\n  \t\t\tesac\n  \t\tdone &&\n  \t\tcd \"$repo\" &&\n -\t\tgit init -q &&\n  \t\tgit init -q && {\n  \t\t\ttest_have_prereq SYMLINKS ||\n  \t\t\tgit config core.symlinks false\n\n-- \n2.8.2.465.gb077790\n"},{"id":"286457","messageId":"5d8189c4306b44c9fc7d3f3c2fba4adb2a343249.1463145936.git.johannes.schindelin@gmx.de","threadId":"42275","inReplyTo":"cover.1463145936.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 1/3] perf: let's disable symlinks when they are not available","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-13T13:25:51Z","receivedAt":"2016-05-13T13:25:51Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"We already have a perfectly fine prereq to tell us whether it is safe to\nuse symlinks. So let's use it.\n\nThis fixes the performance tests in Git for Windows' SDK, where symlinks\nare not really available ([*1*]). This is not an issue with Git for\nWindows itself because it configures core.symlinks=false in its system\nconfig.  However, the system config is disabled for the performance\ntests, for obvious reasons: we want them to be independent of the\nvagaries of any local configuration.\n\nFootnote *1*: Windows has symbolic links. Git for Windows disables them\nby default, though (for example: in standard setups, non-admins lack the\nprivilege to create symbolic links). For details, see\nhttps://github.com/git-for-windows/git/wiki/Symbolic-Links\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/perf/perf-lib.sh | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\nindex 5cf74ed..9fa0706 100644\n--- a/t/perf/perf-lib.sh\n+++ b/t/perf/perf-lib.sh\n@@ -96,7 +96,10 @@ test_perf_create_repo_from () {\n \t\t\tesac\n \t\tdone &&\n \t\tcd .. &&\n-\t\tgit init -q &&\n+\t\tgit init -q && {\n+\t\t\ttest_have_prereq SYMLINKS ||\n+\t\t\tgit config core.symlinks false\n+\t\t} &&\n \t\tmv .git/hooks .git/hooks-disabled 2>/dev/null\n \t) || error \"failed to copy repository '$source' to '$repo'\"\n }\n-- \n2.8.2.465.gb077790\n"},{"id":"286456","messageId":"0f0bc7ac7b6eebed22b05c277cf7352122d164d2.1463145936.git.johannes.schindelin@gmx.de","threadId":"42275","inReplyTo":"cover.1463145936.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 2/3] perf: make the tests work in worktrees","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-13T13:25:58Z","receivedAt":"2016-05-13T13:25:58Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This patch makes perf-lib.sh more robust so that it can run correctly\neven inside a worktree. For example, it assumed that $GIT_DIR/objects is\nthe objects directory (which is not the case for worktrees) and it used\nthe commondir file verbatim, even if it contained a relative path.\n\nFurthermore, the setup code expected `git rev-parse --git-dir` to spit\nout a relative path, which is also not true for worktrees. Let's just\nchange the code to accept both relative and absolute paths, by avoiding\nthe `cd` into the copied working directory.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/perf/perf-lib.sh | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\nindex 9fa0706..5ef1744 100644\n--- a/t/perf/perf-lib.sh\n+++ b/t/perf/perf-lib.sh\n@@ -80,22 +80,22 @@ test_perf_create_repo_from () {\n \terror \"bug in the test script: not 2 parameters to test-create-repo\"\n \trepo=\"$1\"\n \tsource=\"$2\"\n-\tsource_git=$source/$(cd \"$source\" && git rev-parse --git-dir)\n+\tsource_git=\"$(git -C \"$source\" rev-parse --git-dir)\"\n+\tobjects_dir=\"$(git -C \"$source\" rev-parse --git-path objects)\"\n \tmkdir -p \"$repo/.git\"\n \t(\n-\t\tcd \"$repo/.git\" &&\n-\t\t{ cp -Rl \"$source_git/objects\" . 2>/dev/null ||\n-\t\t\tcp -R \"$source_git/objects\" .; } &&\n+\t\t{ cp -Rl \"$objects_dir\" \"$repo/.git/\" 2>/dev/null ||\n+\t\t\tcp -R \"$objects_dir\" \"$repo/.git/\"; } &&\n \t\tfor stuff in \"$source_git\"/*; do\n \t\t\tcase \"$stuff\" in\n-\t\t\t\t*/objects|*/hooks|*/config)\n+\t\t\t\t*/objects|*/hooks|*/config|*/commondir)\n \t\t\t\t\t;;\n \t\t\t\t*)\n-\t\t\t\t\tcp -R \"$stuff\" . || exit 1\n+\t\t\t\t\tcp -R \"$stuff\" \"$repo/.git/\" || exit 1\n \t\t\t\t\t;;\n \t\t\tesac\n \t\tdone &&\n-\t\tcd .. &&\n+\t\tcd \"$repo\" &&\n \t\tgit init -q && {\n \t\t\ttest_have_prereq SYMLINKS ||\n \t\t\tgit config core.symlinks false\n-- \n2.8.2.465.gb077790\n"},{"id":"286458","messageId":"d5d1a6251a2e80700bd295bcdb48a99ab976493f.1463145936.git.johannes.schindelin@gmx.de","threadId":"42275","inReplyTo":"cover.1463145936.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 3/3] Add a perf test for rebase -i","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-13T13:26:03Z","receivedAt":"2016-05-13T13:26:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This developer spent a lot of time trying to speed up the interactive\nrebase, in particular on Windows. And will continue to do so.\n\nTo make it easier to demonstrate the performance improvement, let's have\na reproducible performance test.\n\nThe topic branch we use to test performance was found using these shell\ncommands (essentially searching for a long-enough topic branch in Git's\nown history that touched the same file multiple times):\n\n\tgit rev-list --parents origin/master |\n\tgrep ' .* ' |\n\twhile read commit rest\n\tdo\n\t\tpatch_count=$(git rev-list --count $commit^..$commit^2)\n\t\ttest $patch_count -gt 20 || continue\n\n\t\tmerges=\"$(git rev-list --parents $commit^..$commit^2 |\n\t\t\tgrep ' .* ')\"\n\t\ttest -z \"$merges\" || continue\n\n\t\tpatches_per_file=\"$(git log --pretty=%H --name-only \\\n\t\t\t\t$commit^..$commit^2 |\n\t\t\tgrep -v '^$' |\n\t\t\tsort |\n\t\t\tuniq -c -d |\n\t\t\tsort -n -r)\"\n\t\ttest -n \"$patches_per_file\" &&\n\t\ttest 20 -lt $(echo \"$patches_per_file\" |\n\t\t\tsed -n '1s/^ *\\([0-9]*\\).*/\\1/p') || continue\n\n\t\tprintf 'commit %s\\n%s\\n' \"$commit\" \"$patches_per_file\"\n\tdone\n\nNote that we can get away with *not* having to reset to the original\nbranch tip before rebasing: we switch the first two \"pick\" lines every\ntime, so we end up with the same patch order after two rebases, and the\ncomplexity of both rebases is equivalent.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/perf/p3404-rebase-interactive.sh | 36 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 36 insertions(+)\n create mode 100755 t/perf/p3404-rebase-interactive.sh\n\ndiff --git a/t/perf/p3404-rebase-interactive.sh b/t/perf/p3404-rebase-interactive.sh\nnew file mode 100755\nindex 0000000..88f47de\n--- /dev/null\n+++ b/t/perf/p3404-rebase-interactive.sh\n@@ -0,0 +1,36 @@\n+#!/bin/sh\n+\n+test_description='Tests rebase -i performance'\n+. ./perf-lib.sh\n+\n+test_perf_default_repo\n+\n+# This commit merges a sufficiently long topic branch for reasonable\n+# performance testing\n+branch_merge=ba5312da19c6fdb6c6747d479f58932aae6e900c^{commit}\n+export branch_merge\n+\n+git rev-parse --verify $branch_merge >/dev/null 2>&1 || {\n+\tskip_all='skipping because $branch_merge was not found'\n+\ttest_done\n+}\n+\n+write_script swap-first-two.sh <<\\EOF\n+case \"$1\" in\n+*/COMMIT_EDITMSG)\n+\tmv \"$1\" \"$1\".bak &&\n+\tsed -e '1{h;d}' -e 2G <\"$1\".bak >\"$1\"\n+\t;;\n+esac\n+EOF\n+\n+test_expect_success 'setup' '\n+\tgit config core.editor \"\\\"$PWD\"/swap-first-two.sh\\\" &&\n+\tgit checkout -f $branch_merge^2\n+'\n+\n+test_perf 'rebase -i' '\n+\tgit rebase -i $branch_merge^\n+'\n+\n+test_done\n-- \n2.8.2.465.gb077790\n"},{"id":"287756","messageId":"574B1C3D.3000706@web.de","threadId":"42275","inReplyTo":"0f0bc7ac7b6eebed22b05c277cf7352122d164d2.1463145936.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v3 2/3] perf: make the tests work in worktrees","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2016-05-29T16:43:41Z","receivedAt":"2016-05-29T16:43:41Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 13.05.2016 um 15:25 schrieb Johannes Schindelin:\n> This patch makes perf-lib.sh more robust so that it can run correctly\n> even inside a worktree. For example, it assumed that $GIT_DIR/objects is\n> the objects directory (which is not the case for worktrees) and it used\n> the commondir file verbatim, even if it contained a relative path.\n> \n> Furthermore, the setup code expected `git rev-parse --git-dir` to spit\n> out a relative path, which is also not true for worktrees. Let's just\n> change the code to accept both relative and absolute paths, by avoiding\n> the `cd` into the copied working directory.\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>   t/perf/perf-lib.sh | 14 +++++++-------\n>   1 file changed, 7 insertions(+), 7 deletions(-)\n> \n> diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n> index 9fa0706..5ef1744 100644\n> --- a/t/perf/perf-lib.sh\n> +++ b/t/perf/perf-lib.sh\n> @@ -80,22 +80,22 @@ test_perf_create_repo_from () {\n>   \terror \"bug in the test script: not 2 parameters to test-create-repo\"\n>   \trepo=\"$1\"\n>   \tsource=\"$2\"\n> -\tsource_git=$source/$(cd \"$source\" && git rev-parse --git-dir)\n> +\tsource_git=\"$(git -C \"$source\" rev-parse --git-dir)\"\n> +\tobjects_dir=\"$(git -C \"$source\" rev-parse --git-path objects)\"\n>   \tmkdir -p \"$repo/.git\"\n>   \t(\n> -\t\tcd \"$repo/.git\" &&\n> -\t\t{ cp -Rl \"$source_git/objects\" . 2>/dev/null ||\n> -\t\t\tcp -R \"$source_git/objects\" .; } &&\n> +\t\t{ cp -Rl \"$objects_dir\" \"$repo/.git/\" 2>/dev/null ||\n> +\t\t\tcp -R \"$objects_dir\" \"$repo/.git/\"; } &&\n>   \t\tfor stuff in \"$source_git\"/*; do\n>   \t\t\tcase \"$stuff\" in\n> -\t\t\t\t*/objects|*/hooks|*/config)\n> +\t\t\t\t*/objects|*/hooks|*/config|*/commondir)\n>   \t\t\t\t\t;;\n>   \t\t\t\t*)\n> -\t\t\t\t\tcp -R \"$stuff\" . || exit 1\n> +\t\t\t\t\tcp -R \"$stuff\" \"$repo/.git/\" || exit 1\n>   \t\t\t\t\t;;\n>   \t\t\tesac\n>   \t\tdone &&\n> -\t\tcd .. &&\n> +\t\tcd \"$repo\" &&\n>   \t\tgit init -q && {\n>   \t\t\ttest_have_prereq SYMLINKS ||\n>   \t\t\tgit config core.symlinks false\n> \n\nThis breaks perf for the non-worktree case:\n\nlsr@debian:~/src/git/t/perf$ make\nrm -rf test-results\n./run\n=== Running 12 tests in this tree ===\ncp: cannot stat '.git/objects': No such file or directory\nerror: failed to copy repository '/home/lsr/src/git/t/..' to '/tmp/trash directory.p0000-perf-lib-sanity'\ncp: cannot stat '.git/objects': No such file or directory\nerror: failed to copy repository '/home/lsr/src/git/t/..' to '/tmp/trash directory.p0001-rev-list'\n...\n\nHere's a fix:\n\n-- >8 --\nSubject: perf: make the tests work without a worktree\n\nIn regular repositories $source_git and $objects_dir contain relative\npaths based on $source.  Go there to allow cp to resolve them.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n t/perf/perf-lib.sh | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\nindex 5ef1744..1888790 100644\n--- a/t/perf/perf-lib.sh\n+++ b/t/perf/perf-lib.sh\n@@ -84,6 +84,7 @@ test_perf_create_repo_from () {\n \tobjects_dir=\"$(git -C \"$source\" rev-parse --git-path objects)\"\n \tmkdir -p \"$repo/.git\"\n \t(\n+\t\tcd \"$source\" &&\n \t\t{ cp -Rl \"$objects_dir\" \"$repo/.git/\" 2>/dev/null ||\n \t\t\tcp -R \"$objects_dir\" \"$repo/.git/\"; } &&\n \t\tfor stuff in \"$source_git\"/*; do\n-- \n2.8.3\n"},{"id":"287792","messageId":"alpine.DEB.2.20.1605301026430.4449@virtualbox","threadId":"42275","inReplyTo":"574B1C3D.3000706@web.de","subject":"Re: [PATCH v3 2/3] perf: make the tests work in worktrees","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-05-30T08:28:04Z","receivedAt":"2016-05-30T08:28:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi René,\n\nOn Sun, 29 May 2016, René Scharfe wrote:\n\n> Am 13.05.2016 um 15:25 schrieb Johannes Schindelin:\n> > This patch makes perf-lib.sh more robust so that it can run correctly\n> > even inside a worktree. For example, it assumed that $GIT_DIR/objects is\n> > the objects directory (which is not the case for worktrees) and it used\n> > the commondir file verbatim, even if it contained a relative path.\n> > \n> > Furthermore, the setup code expected `git rev-parse --git-dir` to spit\n> > out a relative path, which is also not true for worktrees. Let's just\n> > change the code to accept both relative and absolute paths, by avoiding\n> > the `cd` into the copied working directory.\n> > \n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >   t/perf/perf-lib.sh | 14 +++++++-------\n> >   1 file changed, 7 insertions(+), 7 deletions(-)\n> > \n> > diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n> > index 9fa0706..5ef1744 100644\n> > --- a/t/perf/perf-lib.sh\n> > +++ b/t/perf/perf-lib.sh\n> > @@ -80,22 +80,22 @@ test_perf_create_repo_from () {\n> >   \terror \"bug in the test script: not 2 parameters to test-create-repo\"\n> >   \trepo=\"$1\"\n> >   \tsource=\"$2\"\n> > -\tsource_git=$source/$(cd \"$source\" && git rev-parse --git-dir)\n> > +\tsource_git=\"$(git -C \"$source\" rev-parse --git-dir)\"\n> > +\tobjects_dir=\"$(git -C \"$source\" rev-parse --git-path objects)\"\n> >   \tmkdir -p \"$repo/.git\"\n> >   \t(\n> > -\t\tcd \"$repo/.git\" &&\n> > -\t\t{ cp -Rl \"$source_git/objects\" . 2>/dev/null ||\n> > -\t\t\tcp -R \"$source_git/objects\" .; } &&\n> > +\t\t{ cp -Rl \"$objects_dir\" \"$repo/.git/\" 2>/dev/null ||\n> > +\t\t\tcp -R \"$objects_dir\" \"$repo/.git/\"; } &&\n> >   \t\tfor stuff in \"$source_git\"/*; do\n> >   \t\t\tcase \"$stuff\" in\n> > -\t\t\t\t*/objects|*/hooks|*/config)\n> > +\t\t\t\t*/objects|*/hooks|*/config|*/commondir)\n> >   \t\t\t\t\t;;\n> >   \t\t\t\t*)\n> > -\t\t\t\t\tcp -R \"$stuff\" . || exit 1\n> > +\t\t\t\t\tcp -R \"$stuff\" \"$repo/.git/\" || exit 1\n> >   \t\t\t\t\t;;\n> >   \t\t\tesac\n> >   \t\tdone &&\n> > -\t\tcd .. &&\n> > +\t\tcd \"$repo\" &&\n> >   \t\tgit init -q && {\n> >   \t\t\ttest_have_prereq SYMLINKS ||\n> >   \t\t\tgit config core.symlinks false\n> > \n> \n> This breaks perf for the non-worktree case:\n\nOh drats!\n\n> lsr@debian:~/src/git/t/perf$ make\n> rm -rf test-results\n> ./run\n> === Running 12 tests in this tree ===\n> cp: cannot stat '.git/objects': No such file or directory\n> error: failed to copy repository '/home/lsr/src/git/t/..' to '/tmp/trash directory.p0000-perf-lib-sanity'\n> cp: cannot stat '.git/objects': No such file or directory\n> error: failed to copy repository '/home/lsr/src/git/t/..' to '/tmp/trash directory.p0001-rev-list'\n> ...\n> \n> Here's a fix:\n> \n> -- >8 --\n> Subject: perf: make the tests work without a worktree\n> \n> In regular repositories $source_git and $objects_dir contain relative\n> paths based on $source.  Go there to allow cp to resolve them.\n> \n> Signed-off-by: Rene Scharfe <l.s.r@web.de>\n> ---\n>  t/perf/perf-lib.sh | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n> index 5ef1744..1888790 100644\n> --- a/t/perf/perf-lib.sh\n> +++ b/t/perf/perf-lib.sh\n> @@ -84,6 +84,7 @@ test_perf_create_repo_from () {\n>  \tobjects_dir=\"$(git -C \"$source\" rev-parse --git-path objects)\"\n>  \tmkdir -p \"$repo/.git\"\n>  \t(\n> +\t\tcd \"$source\" &&\n\nI fear that interacts badly with the `cd \"$repo\"` I introduced later\n(replacing a `cd ..`)...\n\nCiao,\nDscho"},{"id":"287837","messageId":"xmqqr3cjo23d.fsf@gitster.mtv.corp.google.com","threadId":"42275","inReplyTo":"alpine.DEB.2.20.1605301026430.4449@virtualbox","subject":"Re: [PATCH v3 2/3] perf: make the tests work in worktrees","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-30T18:03:18Z","receivedAt":"2016-05-30T18:03:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> This breaks perf for the non-worktree case:\n>\n> Oh drats!\n>\n>> lsr@debian:~/src/git/t/perf$ make\n>> rm -rf test-results\n>> ./run\n>> === Running 12 tests in this tree ===\n>> cp: cannot stat '.git/objects': No such file or directory\n>> error: failed to copy repository '/home/lsr/src/git/t/..' to '/tmp/trash directory.p0000-perf-lib-sanity'\n>> cp: cannot stat '.git/objects': No such file or directory\n>> error: failed to copy repository '/home/lsr/src/git/t/..' to '/tmp/trash directory.p0001-rev-list'\n>> ...\n>> \n>> Here's a fix:\n>> \n>> -- >8 --\n>> Subject: perf: make the tests work without a worktree\n>> \n>> In regular repositories $source_git and $objects_dir contain relative\n>> paths based on $source.  Go there to allow cp to resolve them.\n>> \n>> Signed-off-by: Rene Scharfe <l.s.r@web.de>\n>> ---\n>>  t/perf/perf-lib.sh | 1 +\n>>  1 file changed, 1 insertion(+)\n>> \n>> diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n>> index 5ef1744..1888790 100644\n>> --- a/t/perf/perf-lib.sh\n>> +++ b/t/perf/perf-lib.sh\n>> @@ -84,6 +84,7 @@ test_perf_create_repo_from () {\n>>  \tobjects_dir=\"$(git -C \"$source\" rev-parse --git-path objects)\"\n>>  \tmkdir -p \"$repo/.git\"\n>>  \t(\n>> +\t\tcd \"$source\" &&\n>\n> I fear that interacts badly with the `cd \"$repo\"` I introduced later\n> (replacing a `cd ..`)...\n\nWhat do you want to do then?  For now before -rc1 we can revert the\nwhole thing so that we can get a tested thing that works in both\nlayouts.\n"},{"id":"287841","messageId":"574C8571.6080607@web.de","threadId":"42275","inReplyTo":"xmqqr3cjo23d.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v3 2/3] perf: make the tests work in worktrees","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2016-05-30T18:24:49Z","receivedAt":"2016-05-30T18:24:49Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 30.05.2016 um 20:03 schrieb Junio C Hamano:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n>>> This breaks perf for the non-worktree case:\n>>\n>> Oh drats!\n>>\n>>> lsr@debian:~/src/git/t/perf$ make\n>>> rm -rf test-results\n>>> ./run\n>>> === Running 12 tests in this tree ===\n>>> cp: cannot stat '.git/objects': No such file or directory\n>>> error: failed to copy repository '/home/lsr/src/git/t/..' to '/tmp/trash directory.p0000-perf-lib-sanity'\n>>> cp: cannot stat '.git/objects': No such file or directory\n>>> error: failed to copy repository '/home/lsr/src/git/t/..' to '/tmp/trash directory.p0001-rev-list'\n>>> ...\n>>>\n>>> Here's a fix:\n>>>\n>>> -- >8 --\n>>> Subject: perf: make the tests work without a worktree\n>>>\n>>> In regular repositories $source_git and $objects_dir contain relative\n>>> paths based on $source.  Go there to allow cp to resolve them.\n>>>\n>>> Signed-off-by: Rene Scharfe <l.s.r@web.de>\n>>> ---\n>>>   t/perf/perf-lib.sh | 1 +\n>>>   1 file changed, 1 insertion(+)\n>>>\n>>> diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\n>>> index 5ef1744..1888790 100644\n>>> --- a/t/perf/perf-lib.sh\n>>> +++ b/t/perf/perf-lib.sh\n>>> @@ -84,6 +84,7 @@ test_perf_create_repo_from () {\n>>>   \tobjects_dir=\"$(git -C \"$source\" rev-parse --git-path objects)\"\n>>>   \tmkdir -p \"$repo/.git\"\n>>>   \t(\n>>> +\t\tcd \"$source\" &&\n>>\n>> I fear that interacts badly with the `cd \"$repo\"` I introduced later\n>> (replacing a `cd ..`)...\n\nOh, right, it does if $repo is a relative path.\n\n> What do you want to do then?  For now before -rc1 we can revert the\n> whole thing so that we can get a tested thing that works in both\n> layouts.\n\nPut it in its own subshell, e.g. like this?\n\n---\n t/perf/perf-lib.sh | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\nindex 5ef1744..18c363e 100644\n--- a/t/perf/perf-lib.sh\n+++ b/t/perf/perf-lib.sh\n@@ -84,6 +84,7 @@ test_perf_create_repo_from () {\n \tobjects_dir=\"$(git -C \"$source\" rev-parse --git-path objects)\"\n \tmkdir -p \"$repo/.git\"\n \t(\n+\t\tcd \"$source\" &&\n \t\t{ cp -Rl \"$objects_dir\" \"$repo/.git/\" 2>/dev/null ||\n \t\t\tcp -R \"$objects_dir\" \"$repo/.git/\"; } &&\n \t\tfor stuff in \"$source_git\"/*; do\n@@ -94,7 +95,9 @@ test_perf_create_repo_from () {\n \t\t\t\t\tcp -R \"$stuff\" \"$repo/.git/\" || exit 1\n \t\t\t\t\t;;\n \t\t\tesac\n-\t\tdone &&\n+\t\tdone\n+\t) &&\n+\t(\n \t\tcd \"$repo\" &&\n \t\tgit init -q && {\n \t\t\ttest_have_prereq SYMLINKS ||\n-- \n2.8.3\n"},{"id":"287937","messageId":"xmqqa8j553ak.fsf@gitster.mtv.corp.google.com","threadId":"42275","inReplyTo":"574C8571.6080607@web.de","subject":"Re: [PATCH v3 2/3] perf: make the tests work in worktrees","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-31T21:24:35Z","receivedAt":"2016-05-31T21:24:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <l.s.r@web.de> writes:\n\n>>> I fear that interacts badly with the `cd \"$repo\"` I introduced later\n>>> (replacing a `cd ..`)...\n>\n> Oh, right, it does if $repo is a relative path.\n>\n>> What do you want to do then?  For now before -rc1 we can revert the\n>> whole thing so that we can get a tested thing that works in both\n>> layouts.\n>\n> Put it in its own subshell, e.g. like this?\n\nOK. I've squashed it and merged the result to 'next'.  We'll see if\nanybody screams and merge it to 'master' before -rc2.\n\nThanks.\n"},{"id":"289799","messageId":"20160621192557.GA2311@sigill.intra.peff.net","threadId":"42275","inReplyTo":"0f0bc7ac7b6eebed22b05c277cf7352122d164d2.1463145936.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v3 2/3] perf: make the tests work in worktrees","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-06-21T19:25:57Z","receivedAt":"2016-06-21T19:27:30Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 13, 2016 at 03:25:58PM +0200, Johannes Schindelin wrote:\n\n> This patch makes perf-lib.sh more robust so that it can run correctly\n> even inside a worktree. For example, it assumed that $GIT_DIR/objects is\n> the objects directory (which is not the case for worktrees) and it used\n> the commondir file verbatim, even if it contained a relative path.\n> \n> Furthermore, the setup code expected `git rev-parse --git-dir` to spit\n> out a relative path, which is also not true for worktrees. Let's just\n> change the code to accept both relative and absolute paths, by avoiding\n> the `cd` into the copied working directory.\n\nI was trying to run the perf scripts today and got bit by this patch.\nThe problem is this line:\n\n> +\tobjects_dir=\"$(git -C \"$source\" rev-parse --git-path objects)\"\n\nWhen the perf script is running, the \"git\" in its PATH is the version of\ngit being perf-tested, not the most recent one. And --git-path wasn't\nintroduced until v2.5.0. So if you try to compare results against an\nolder git, it fails:\n\n  $ cd t/perf\n  $ ./run v2.4.0 v2.9.0 -- p0000-perf-lib-sanity.sh\n  [...]\n\n  === Running 1 tests in build/67308bd628c6235dbc1bad60c9ad1f2d27d576cc/bin-wrappers ===\n  fatal: ambiguous argument 'objects': unknown revision or path not in the working tree.\n  Use '--' to separate paths from revisions, like this:\n  'git <command> [<revision>...] -- [<file>...]'\n  cp: unrecognized option '--git-path\n  objects'\n  Try 'cp --help' for more information.\n  error: failed to copy repository '/home/peff/compile/git/t/..' to '/var/ram/git-tests/trash directory.p0000-perf-lib-sanity'\n\n  [...]\n  Test                                                       v2.4.0      v2.9.0         \n  --------------------------------------------------------------------------------------\n  0000.1: test_perf_default_repo works                       <missing>   0.00(0.00+0.00)\n  0000.2: test_checkout_worktree works                       <missing>   0.01(0.00+0.00)\n  0000.4: export a weird var                                 <missing>   0.00(0.00+0.00)\n  0000.6: important variables available in subshells         <missing>   0.00(0.00+0.00)\n  0000.7: test-lib-functions correctly loaded in subshells   <missing>   0.00(0.00+0.00)\n\nI know that running modern perf tests against older versions isn't\nguaranteed to work (the tests might rely on newer options, for example),\nbut it at least generally worked up until this point.\n\nIMHO the problem is in the design of t/perf, though. It should always\nuse your modern git for the harness setup, and only use the git-to-test\ninside test_expect and test_perf blocks.\n\n-Peff\n"}]}