-
Notifications
You must be signed in to change notification settings - Fork 0
/
interleave.sh
executable file
·54 lines (43 loc) · 1.7 KB
/
interleave.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
set -eEuo pipefail
. base.sh
mkdir -p wspace
cd wspace
# Interleave the Git histories.
clone_submodule https://github.com/kspalaiologos/recreational kspalaiologos-recreational.interleaved
codegolf_submodule="$(submodule_path https://github.com/wspace/kspalaiologos-codegolf)"
cd kspalaiologos-recreational.interleaved
git remote add codegolf-submissions "$codegolf_submodule"
git fetch -q codegolf-submissions
# Interleave histories in date order, resolving merge conflicts (in README.md)
# in favor of recreational (“theirs”).
GIT_SEQUENCE_EDITOR='git log main codegolf-submissions/main --format="pick %h %ai %s" --reverse > ' \
git rebase -i --root -Xtheirs
# Remove now-duplicate files that started in codegolf-submissions and were added
# to recreational under different names or extracted in commit b0b31d9 (more
# stuff from cgse, 2023-11-12).
7z x 3815.7z
cmp 3815.mu 3815.mb
rm 3815.mu
7z x 196192.7z
mv stuff.hell 196192.hell
cmp stuff.mu 196192.mb
rm stuff.mu
cmp 138547.mu 138547.mb
cmp 190971.mu 190971.mb
cmp 191101.mu 191101.mb
cmp 201508.mu 201508.mb
git add 196192.hell
git rm 3815.7z 196192.7z 138547.mu 190971.mu 191101.mu 201508.mu
# Some files from codegolf-submissions were not manually added to recreational
# and are now reintroduced by the rebase. You should review them to see if you
# want them. Delete any you don't want here.
# Apply those deletions to the rebased version of b0b31d9 (more stuff from cgse,
# 2023-11-12).
cgse_commit="$(git log --grep='more stuff from cgse' --format=%H)"
git commit --fixup="$cgse_commit"
git rebase --autosquash "$cgse_commit^"
# TODO:
# - Committer ident is mangled.
# - Rebased commits are now unsigned.
git remote remove codegolf-submissions