2010-12-21 19:50:47 +01:00
|
|
|
#!/bin/sh
|
2010-09-19 11:59:27 +02:00
|
|
|
|
|
|
|
test_description='git rebase - test patch id computation'
|
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
2014-06-09 23:03:10 +02:00
|
|
|
scramble () {
|
2010-09-19 11:59:27 +02:00
|
|
|
i=0
|
|
|
|
while read x
|
|
|
|
do
|
|
|
|
if test $i -ne 0
|
|
|
|
then
|
|
|
|
echo "$x"
|
|
|
|
fi
|
2010-12-21 19:50:47 +01:00
|
|
|
i=$((($i+1) % 10))
|
2014-06-09 23:03:10 +02:00
|
|
|
done <"$1" >"$1.new"
|
2010-09-19 11:59:27 +02:00
|
|
|
mv -f "$1.new" "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
test_expect_success 'setup' '
|
2011-12-08 14:10:17 +01:00
|
|
|
git commit --allow-empty -m initial &&
|
2010-09-19 11:59:27 +02:00
|
|
|
git tag root
|
|
|
|
'
|
|
|
|
|
t3419: drop EXPENSIVE tests
When t3419 was originally written, it was designed to run a smaller test
for correctness, and then the same test with a larger number of patches
for performance. But it seems unlikely the latter was helping us:
- it was marked with EXPENSIVE, so hardly anybody ran it anyway
- there's no indication that it was more likely to find bugs than the
smaller case (the commit message isn't very helpful, but the original
cover letter describes it as: "The first patch adds correctness and
(optional) performance tests".
- the timing results are shown only via test_debug(). So also not run
unless the user says "-d", and then not provided in any
machine-readable form.
If we're interested in performance regressions, a script in t/perf would
be more appropriate. I didn't add one here, because it's not at all
clear to me that what the script is timing is even all that interesting.
Let's simplify the script by dropping the EXPENSIVE run. That in turn
lets us drop the do_tests() wrapper, which lets us consistently use
single-quotes for our test snippets. And we can drop the useless
test_debug() timings, as well as their run() helper. And finally, while
we're here, we can replace the count() helper with the standard
test_seq().
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-22 08:51:40 +01:00
|
|
|
test_expect_success 'setup: 500 lines' '
|
|
|
|
rm -f .gitattributes &&
|
|
|
|
git checkout -q -f master &&
|
|
|
|
git reset --hard root &&
|
|
|
|
test_seq 500 >file &&
|
|
|
|
git add file &&
|
|
|
|
git commit -q -m initial &&
|
|
|
|
git branch -f other &&
|
|
|
|
|
|
|
|
scramble file &&
|
|
|
|
git add file &&
|
|
|
|
git commit -q -m "change big file" &&
|
|
|
|
|
|
|
|
git checkout -q other &&
|
|
|
|
: >newfile &&
|
|
|
|
git add newfile &&
|
|
|
|
git commit -q -m "add small file" &&
|
|
|
|
|
|
|
|
git cherry-pick master >/dev/null 2>&1
|
|
|
|
'
|
2010-09-19 11:59:27 +02:00
|
|
|
|
t3419: drop EXPENSIVE tests
When t3419 was originally written, it was designed to run a smaller test
for correctness, and then the same test with a larger number of patches
for performance. But it seems unlikely the latter was helping us:
- it was marked with EXPENSIVE, so hardly anybody ran it anyway
- there's no indication that it was more likely to find bugs than the
smaller case (the commit message isn't very helpful, but the original
cover letter describes it as: "The first patch adds correctness and
(optional) performance tests".
- the timing results are shown only via test_debug(). So also not run
unless the user says "-d", and then not provided in any
machine-readable form.
If we're interested in performance regressions, a script in t/perf would
be more appropriate. I didn't add one here, because it's not at all
clear to me that what the script is timing is even all that interesting.
Let's simplify the script by dropping the EXPENSIVE run. That in turn
lets us drop the do_tests() wrapper, which lets us consistently use
single-quotes for our test snippets. And we can drop the useless
test_debug() timings, as well as their run() helper. And finally, while
we're here, we can replace the count() helper with the standard
test_seq().
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-22 08:51:40 +01:00
|
|
|
test_expect_success 'setup attributes' '
|
|
|
|
echo "file binary" >.gitattributes
|
|
|
|
'
|
2010-09-19 11:59:27 +02:00
|
|
|
|
t3419: drop EXPENSIVE tests
When t3419 was originally written, it was designed to run a smaller test
for correctness, and then the same test with a larger number of patches
for performance. But it seems unlikely the latter was helping us:
- it was marked with EXPENSIVE, so hardly anybody ran it anyway
- there's no indication that it was more likely to find bugs than the
smaller case (the commit message isn't very helpful, but the original
cover letter describes it as: "The first patch adds correctness and
(optional) performance tests".
- the timing results are shown only via test_debug(). So also not run
unless the user says "-d", and then not provided in any
machine-readable form.
If we're interested in performance regressions, a script in t/perf would
be more appropriate. I didn't add one here, because it's not at all
clear to me that what the script is timing is even all that interesting.
Let's simplify the script by dropping the EXPENSIVE run. That in turn
lets us drop the do_tests() wrapper, which lets us consistently use
single-quotes for our test snippets. And we can drop the useless
test_debug() timings, as well as their run() helper. And finally, while
we're here, we can replace the count() helper with the standard
test_seq().
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-22 08:51:40 +01:00
|
|
|
test_expect_success 'detect upstream patch' '
|
|
|
|
git checkout -q master &&
|
|
|
|
scramble file &&
|
|
|
|
git add file &&
|
|
|
|
git commit -q -m "change big file again" &&
|
|
|
|
git checkout -q other^{} &&
|
|
|
|
git rebase master &&
|
2020-04-22 22:42:42 +02:00
|
|
|
git rev-list master...HEAD~ >revs &&
|
|
|
|
test_must_be_empty revs
|
t3419: drop EXPENSIVE tests
When t3419 was originally written, it was designed to run a smaller test
for correctness, and then the same test with a larger number of patches
for performance. But it seems unlikely the latter was helping us:
- it was marked with EXPENSIVE, so hardly anybody ran it anyway
- there's no indication that it was more likely to find bugs than the
smaller case (the commit message isn't very helpful, but the original
cover letter describes it as: "The first patch adds correctness and
(optional) performance tests".
- the timing results are shown only via test_debug(). So also not run
unless the user says "-d", and then not provided in any
machine-readable form.
If we're interested in performance regressions, a script in t/perf would
be more appropriate. I didn't add one here, because it's not at all
clear to me that what the script is timing is even all that interesting.
Let's simplify the script by dropping the EXPENSIVE run. That in turn
lets us drop the do_tests() wrapper, which lets us consistently use
single-quotes for our test snippets. And we can drop the useless
test_debug() timings, as well as their run() helper. And finally, while
we're here, we can replace the count() helper with the standard
test_seq().
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-22 08:51:40 +01:00
|
|
|
'
|
2010-09-19 11:59:27 +02:00
|
|
|
|
t3419: drop EXPENSIVE tests
When t3419 was originally written, it was designed to run a smaller test
for correctness, and then the same test with a larger number of patches
for performance. But it seems unlikely the latter was helping us:
- it was marked with EXPENSIVE, so hardly anybody ran it anyway
- there's no indication that it was more likely to find bugs than the
smaller case (the commit message isn't very helpful, but the original
cover letter describes it as: "The first patch adds correctness and
(optional) performance tests".
- the timing results are shown only via test_debug(). So also not run
unless the user says "-d", and then not provided in any
machine-readable form.
If we're interested in performance regressions, a script in t/perf would
be more appropriate. I didn't add one here, because it's not at all
clear to me that what the script is timing is even all that interesting.
Let's simplify the script by dropping the EXPENSIVE run. That in turn
lets us drop the do_tests() wrapper, which lets us consistently use
single-quotes for our test snippets. And we can drop the useless
test_debug() timings, as well as their run() helper. And finally, while
we're here, we can replace the count() helper with the standard
test_seq().
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-22 08:51:40 +01:00
|
|
|
test_expect_success 'do not drop patch' '
|
|
|
|
git branch -f squashed master &&
|
|
|
|
git checkout -q -f squashed &&
|
|
|
|
git reset -q --soft HEAD~2 &&
|
|
|
|
git commit -q -m squashed &&
|
|
|
|
git checkout -q other^{} &&
|
|
|
|
test_must_fail git rebase squashed &&
|
|
|
|
git rebase --quit
|
|
|
|
'
|
2010-09-19 11:59:27 +02:00
|
|
|
|
|
|
|
test_done
|