-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'en/important-misc-fixes'
Several fixes, from miscellaneous documentation improvements, up to a gnarly bug in _IDs.record_rename(), and in important improvement in how already_ran is interpreted if left around. Signed-off-by: Elijah Newren <[email protected]>
- Loading branch information
Showing
5 changed files
with
255 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
|
||
test_description='filter-repo tests with reruns' | ||
|
||
. ./test-lib.sh | ||
|
||
export PATH=$(dirname $TEST_DIRECTORY):$PATH # Put git-filter-repo in PATH | ||
|
||
DATA="$TEST_DIRECTORY/t9393" | ||
DELETED_SHA="0000000000000000000000000000000000000000" # FIXME: sha256 support | ||
|
||
test_expect_success 'a re-run that is treated as a clean slate' ' | ||
test_create_repo clean_slate_rerun && | ||
( | ||
cd clean_slate_rerun && | ||
git fast-import --quiet <$DATA/simple && | ||
FIRST_ORPHAN=$(git rev-parse orphan-me~1) && | ||
FINAL_ORPHAN=$(git rev-parse orphan-me) && | ||
FILE_A_CHANGE=$(git rev-list -1 HEAD -- fileA) && | ||
FILE_B_CHANGE=$(git rev-list -1 HEAD -- fileB) && | ||
FILE_C_CHANGE=$(git rev-list -1 HEAD -- fileC) && | ||
FILE_D_CHANGE=$(git rev-list -1 HEAD -- fileD) && | ||
ORIGINAL_TAG=$(git rev-parse v1.0) && | ||
git filter-repo --invert-paths --path fileB --force && | ||
NEW_FILE_C_CHANGE=$(git rev-list -1 HEAD -- fileC) && | ||
NEW_FILE_D_CHANGE=$(git rev-list -1 HEAD -- fileD) && | ||
FINAL_TAG=$(git rev-parse v1.0) && | ||
cat <<-EOF | sort >sha-expect && | ||
${FIRST_ORPHAN} ${FIRST_ORPHAN} | ||
${FINAL_ORPHAN} ${FINAL_ORPHAN} | ||
${FILE_A_CHANGE} ${FILE_A_CHANGE} | ||
${FILE_B_CHANGE} ${DELETED_SHA} | ||
${FILE_C_CHANGE} ${NEW_FILE_C_CHANGE} | ||
${FILE_D_CHANGE} ${NEW_FILE_D_CHANGE} | ||
EOF | ||
printf "%-40s %s\n" old new >expect && | ||
cat sha-expect >>expect && | ||
test_cmp <(sort expect) <(sort .git/filter-repo/commit-map) && | ||
cat <<-EOF | sort -k 3 >sha-expect && | ||
${FILE_D_CHANGE} ${NEW_FILE_D_CHANGE} $(git symbolic-ref HEAD) | ||
${FINAL_ORPHAN} ${FINAL_ORPHAN} refs/heads/orphan-me | ||
${ORIGINAL_TAG} ${FINAL_TAG} refs/tags/v1.0 | ||
EOF | ||
printf "%-40s %-40s %s\n" old new ref >expect && | ||
cat sha-expect >>expect && | ||
test_cmp expect .git/filter-repo/ref-map && | ||
touch -t 197001010000 .git/filter-repo/already_ran && | ||
echo no | git filter-repo --invert-paths --path fileC --force && | ||
FINAL_FILE_D_CHANGE=$(git rev-list -1 HEAD -- fileD) && | ||
REALLY_FINAL_TAG=$(git rev-parse v1.0) && | ||
cat <<-EOF | sort >sha-expect && | ||
${FIRST_ORPHAN} ${FIRST_ORPHAN} | ||
${FINAL_ORPHAN} ${FINAL_ORPHAN} | ||
${FILE_A_CHANGE} ${FILE_A_CHANGE} | ||
${NEW_FILE_C_CHANGE} ${DELETED_SHA} | ||
${NEW_FILE_D_CHANGE} ${FINAL_FILE_D_CHANGE} | ||
EOF | ||
printf "%-40s %s\n" old new >expect && | ||
cat sha-expect >>expect && | ||
test_cmp <(sort expect) <(sort .git/filter-repo/commit-map) && | ||
cat <<-EOF | sort -k 3 >sha-expect && | ||
${NEW_FILE_D_CHANGE} ${FINAL_FILE_D_CHANGE} $(git symbolic-ref HEAD) | ||
${FINAL_ORPHAN} ${FINAL_ORPHAN} refs/heads/orphan-me | ||
${FINAL_TAG} ${REALLY_FINAL_TAG} refs/tags/v1.0 | ||
EOF | ||
printf "%-40s %-40s %s\n" old new ref >expect && | ||
cat sha-expect >>expect && | ||
test_cmp expect .git/filter-repo/ref-map | ||
) | ||
' | ||
|
||
test_done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
feature done | ||
# Simple repo with a few files, and two branches with no common history. | ||
# Note that the original-oid directives are very fake, but make it easy to | ||
# track things. | ||
blob | ||
mark :1 | ||
original-oid 0000000000000000000000000000000000000001 | ||
data 16 | ||
file 1 contents | ||
|
||
blob | ||
mark :2 | ||
original-oid 0000000000000000000000000000000000000002 | ||
data 16 | ||
file 2 contents | ||
|
||
blob | ||
mark :3 | ||
original-oid 0000000000000000000000000000000000000003 | ||
data 16 | ||
file 3 contents | ||
|
||
blob | ||
mark :4 | ||
original-oid 0000000000000000000000000000000000000004 | ||
data 16 | ||
file 4 contents | ||
|
||
reset refs/heads/orphan-me | ||
commit refs/heads/orphan-me | ||
mark :5 | ||
original-oid 0000000000000000000000000000000000000009 | ||
author Little O. Me <[email protected]> 1535228562 -0700 | ||
committer Little O. Me <[email protected]> 1535228562 -0700 | ||
data 8 | ||
Initial | ||
M 100644 :1 nuke-me | ||
|
||
commit refs/heads/orphan-me | ||
mark :6 | ||
original-oid 000000000000000000000000000000000000000A | ||
author Little 'ol Me <me@laptop.(none)> 1535229544 -0700 | ||
committer Little 'ol Me <me@laptop.(none)> 1535229544 -0700 | ||
data 9 | ||
Tweak it | ||
from :5 | ||
M 100644 :4 nuke-me | ||
|
||
reset refs/heads/master | ||
commit refs/heads/master | ||
mark :7 | ||
original-oid 000000000000000000000000000000000000000B | ||
author Little O. Me <[email protected]> 1535229523 -0700 | ||
committer Little O. Me <[email protected]> 1535229523 -0700 | ||
data 15 | ||
Initial commit | ||
M 100644 :1 fileA | ||
|
||
commit refs/heads/master | ||
mark :8 | ||
original-oid 000000000000000000000000000000000000000C | ||
author Lit.e Me <[email protected]> 1535229559 -0700 | ||
committer Lit.e Me <[email protected]> 1535229580 -0700 | ||
data 10 | ||
Add fileB | ||
from :7 | ||
M 100644 :2 fileB | ||
|
||
commit refs/heads/master | ||
mark :9 | ||
original-oid 000000000000000000000000000000000000000D | ||
author Little Me <[email protected]> 1535229601 -0700 | ||
committer Little Me <[email protected]> 1535229601 -0700 | ||
data 10 | ||
Add fileC | ||
from :8 | ||
M 100644 :3 fileC | ||
|
||
commit refs/heads/master | ||
mark :10 | ||
original-oid 000000000000000000000000000000000000000E | ||
author Little Me <[email protected]> 1535229618 -0700 | ||
committer Little Me <[email protected]> 1535229618 -0700 | ||
data 10 | ||
Add fileD | ||
from :9 | ||
M 100644 :4 fileD | ||
|
||
tag v1.0 | ||
from :10 | ||
original-oid 000000000000000000000000000000000000000F | ||
tagger Little John <[email protected]> 1535229637 -0700 | ||
data 5 | ||
v1.0 | ||
|
||
done |