-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
:squash()
for histories containing an empty orphan
The implementation relied on the orphan commit being dropped by the normal drop rules, but those have an exception to keep empty trees. Change: squash-empty-orphan
- Loading branch information
1 parent
4a6eec2
commit 68b2300
Showing
55 changed files
with
113 additions
and
66 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,54 @@ | ||
$ export RUST_BACKTRACE=1 | ||
$ git init -q 1> /dev/null | ||
|
||
$ git commit -m "Empty initial" --allow-empty 1> /dev/null | ||
|
||
$ git log --graph --pretty=%s | ||
* Empty initial | ||
|
||
$ git checkout -b branch2 | ||
Switched to a new branch 'branch2' | ||
|
||
$ echo contents2 > file1 | ||
$ git add . | ||
$ git commit -m "mod file1" 1> /dev/null | ||
|
||
$ echo contents3 > file3 | ||
$ git add . | ||
$ git commit -m "mod file3" 1> /dev/null | ||
|
||
$ git checkout master | ||
Switched to branch 'master' | ||
|
||
$ echo contents3 > file2 | ||
$ git add . | ||
$ git commit -m "add file2" 1> /dev/null | ||
|
||
$ git merge -q branch2 --no-ff | ||
|
||
$ git log --graph --decorate --pretty=oneline | ||
* 882f2656a5075936eb37bfefde740e0b453e4479 (HEAD -> master) Merge branch 'branch2' | ||
|\ | ||
| * 87bb87b63d1745136cb2ea167ef3ffc82c7ef3f0 (branch2) mod file3 | ||
| * 2db14eafe99deeeab5db07bf33e332d523a298ab mod file1 | ||
* | 54d8f704681c3b44a468cef655fa3b5bc5229a4c add file2 | ||
|/ | ||
* 8c26fa0172bda17bafcbcf9684e639c6b0bae9c4 Empty initial | ||
|
||
$ josh-filter -s --squash-pattern "refs/tags/*" --update refs/heads/filtered | ||
Warning: reference refs/heads/filtered wasn't updated | ||
$ git log --graph --decorate --pretty=oneline refs/heads/filtered | ||
fatal: ambiguous argument 'refs/heads/filtered': unknown revision or path not in the working tree. | ||
Use '--' to separate paths from revisions, like this: | ||
'git <command> [<revision>...] -- [<file>...]' | ||
[128] | ||
|
||
$ git tag -a tag_a -m "created a tag" 882f2656a5075936eb37bfefde740e0b453e4479 | ||
$ josh-filter -s --squash-pattern "refs/tags/*" :author=\"New\ Author\"\;\"new@e.mail\" --update refs/heads/filtered | ||
[1] :author="New Author";"new@e.mail" | ||
[1] :squash( | ||
882f2656a5075936eb37bfefde740e0b453e4479:"refs/tags/tag_a" | ||
) | ||
$ git log --graph --decorate --pretty=oneline refs/heads/filtered | ||
* d8aa5a9937f4f0bd645dbc0b591bae5cd6b6d91b (tag: filtered/tag_a, filtered) refs/tags/tag_a |
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 |
---|---|---|
|
@@ -124,7 +124,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -124,7 +124,7 @@ | |
"real_repo.git" = ["::sub1/"] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -53,7 +53,7 @@ | |
"real_repo.git" = ["::sub1/"] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
$ bash ${TESTDIR}/destroy_test_env.sh | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -111,7 +111,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -74,7 +74,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -87,7 +87,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -85,7 +85,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -78,7 +78,7 @@ | |
"real_repo.git" = [":/sub1"] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -115,7 +115,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -129,7 +129,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
$ bash ${TESTDIR}/destroy_test_env.sh | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -59,7 +59,7 @@ | |
"real_repo.git" = [":prefix=sub1"] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -340,7 +340,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -69,7 +69,7 @@ | |
"real_repo.git" = ["::sub1/"] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -114,7 +114,7 @@ Check the branch again | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -56,7 +56,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -48,7 +48,7 @@ test for that. | |
"real_repo.git" = [] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
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 |
---|---|---|
|
@@ -85,7 +85,7 @@ Flushed credential cache | |
] | ||
. | ||
|-- josh | ||
| `-- 20 | ||
| `-- 21 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
Oops, something went wrong.