Here is dockerfile, which creates truly full Linux history repo. It includes truly old commits, which are absent from normal Linux repo. The code (for reconstructing history) includes Rust part.
This differs from https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git . First, I use git replace instead of obsolete grafts. Second, I added some tags, missing from that kernel.org repo.
You can see comparision of existing options here: https://stackoverflow.com/q/3264283 . None of them are okay for me, so I wrote this thing.
This dockerfile (together with Rust part) first clones https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git , then does git replace and adds some missing tags.
rename-tags/src/main.rs:
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | fn bash_empty(cmd: &str) {
let output = std::process::Command::new("bash").arg("-c").arg(format!("set -e; set -o pipefail; {cmd}")).output().unwrap();
if !output.status.success() || !output.stdout.is_empty() || !output.stderr.is_empty() {
eprintln!("bash_empty failed. command: [{cmd}]");
eprintln!("stdout: [{}]", String::from_utf8(output.stdout).unwrap_or("(not UTF-8)".to_string()));
eprintln!("stderr: [{}]", String::from_utf8(output.stderr).unwrap_or("(not UTF-8)".to_string()));
panic!("bash_empty failed");
}
}
fn bash_get_out(cmd: &str) -> String {
let output = std::process::Command::new("bash").arg("-c").arg(format!("set -e; set -o pipefail; {cmd}")).output().unwrap();
if !output.status.success() || !output.stderr.is_empty() {
eprintln!("bash_empty failed. command: [{cmd}]");
eprintln!("stdout: [{}]", String::from_utf8(output.stdout).unwrap_or("(not UTF-8)".to_string()));
eprintln!("stderr: [{}]", String::from_utf8(output.stderr).unwrap_or("(not UTF-8)".to_string()));
panic!("bash_empty failed");
}
return String::from_utf8(output.stdout).expect("Not UTF-8");
}
fn dollar(cmd: &str) -> String {
return bash_get_out(cmd).strip_suffix('\n').unwrap().to_string();
}
fn bash_out(cmd: &str) {
if !std::process::Command::new("bash").arg("-c").arg(format!("set -e; set -o pipefail; {cmd}")).status().unwrap().success() {
eprintln!("bash_out failed. command: [{cmd}]");
panic!("bash_out failed");
}
}
fn rename(old: &str, new: &str) {
() = bash_empty(&format!("git tag '{new}' '{old}'"));
() = bash_out(&format!("git tag --delete '{old}'"));
}
fn main() {
for (key, _) in std::env::vars_os() {
if !(key == "HOME" || key == "TERM" || key == "PATH" || key == "RUST_BACKTRACE") {
() = unsafe { std::env::remove_var(key) };
}
}
() = unsafe { std::env::set_var("LC_ALL", "C.UTF-8") };
() = unsafe { std::env::set_var("TZ", "UTC") };
unsafe {
assert_eq!(libc::close(0), 0);
assert_eq!(libc::open(c"/dev/null".as_ptr(), libc::O_RDONLY), 0);
}
assert_eq!(bash_get_out("git remote"), "history\norigin\n");
assert_eq!(bash_get_out("git branch --list"), "* master\n");
assert_eq!(bash_get_out("git replace"), "");
// https://stackoverflow.com/a/34443598
{
assert_eq!(bash_get_out("git diff v2.6.12-rc2-pre..v2.6.12-rc2"), "");
let rc2_pre = dollar("git rev-parse v2.6.12-rc2-pre");
let rc2 = dollar("git rev-parse v2.6.12-rc2");
() = bash_out("git tag --delete v2.6.12-rc2-pre");
() = bash_empty(&format!("git replace {rc2} {rc2_pre}"));
}
() = bash_empty("git replace --graft 7a2deb32924142696b8174cdf9b38cd72a11fc96 379a6be1eedb84ae0d476afbc4b4070383681178");
() = bash_out("git tag --delete v2.6.11-tree");
for tag in bash_get_out("git tag").lines() {
if tag.starts_with("0.") || tag.starts_with("1.") || tag.starts_with("2.") {
() = rename(tag, &format!("v{tag}"));
}
if tag.starts_with("lia64-") || tag.starts_with("pre2.0.") {
() = bash_out(&format!("git tag --delete '{tag}'"));
}
}
for (tag, commit) in [
("v2.5.2.6", "2f886464aa00cd9eb9cf46c8c155a24a752bb317"),
("v2.5.2.5", "fe48f9c8ac1f6b93d8f1371f116a2a0d95d6bc19"),
("v2.5.2.4.1", "397cbdc2c254c7650d75fc990d33a878e75fafb7"),
("v2.5.2.4", "9d6ba121b7e17085c95139233686b27a4d4c650e"),
("v2.5.2.3", "463727d199b089c420e750d43f75ea9403a45e12"),
("v2.5.2.2", "0713f0290054eb9769d588120712e3dccfb3ec34"),
("v2.5.2.1.1", "468e6d17ff42e6f291a88c87681b2b5e34e9ab33"),
("v2.5.2.1", "d694597ed5e1f6613d0933ee692333ab2542b603"),
("v2.5.1.11", "18a933102825ea1e1b7e059234537d4d927e9216"),
("v2.5.1.10", "908920b1d370e7a5c301d14cfce10c310be19be3"),
("v2.5.1.9", "d01b7e92c0020f89b4bb33fe61c0dffab7078b42"),
("v2.5.1.8", "2161cc3b1b40e4f2b34c781e4d2dc648544629a8"),
("v2.5.1.7", "39769961b842895bddecbae7d823e894a6a11d17"),
("v2.5.1.6", "a914dd8b3b9ee9ccb2659b55fc98933c9f2a9c73"),
("v2.5.1.5", "ba6edf537004b1c68a0736c95ebe39a30a2537fb"),
("v2.5.1.4", "d0415686774477153ca911a612f74c2d2bb11be6"),
("v2.5.1.3", "25aa595a676f130148eba073cdd5a8d57e9d238f"),
("v2.5.1.2", "6533333c8946e70120cc9d7fcad01e0f748d7863"),
("v2.5.1.1", "0925bad356699684440720f2a908030f98bc3284"),
("v2.5.0.11", "fe0976511d3b5cf2894da54bc451e561bd6b1482"),
("v2.5.0.10", "800446073f02f3035bffad7f1ced654ff6b474c9"),
("v2.5.0.9", "b1507c9acd944c8703612c0e38ac580bf9064e8a"),
("v2.5.0.8", "098b795507a08d023833c751381f885daa70436a"),
("v2.5.0.7", "b54cee93b40ef775f12206d68f04fb8bb5edbfe9"),
("v2.5.0.6", "ef40d49b1f2892a4cbacd534403e45bcc5cb2694"),
("v2.5.0.5", "cc5979c373db310084dc03b4cba091840dda2491"),
("v2.5.0.4", "40b1df3aaf1d7d7258b501baa805fa2c5bb2692b"),
("v2.5.0.3", "4d6c7b36fcb5b4d3a727a9d84353422bacd173a3"),
("v2.5.0.2", "e1e2cfc3fb42dbe54dd94fe97ba17a62cd7a265b"),
("v2.5.0.1", "3735375e3fd2f2286c1dc2f0131f39d438ae9a5c"),
("v2.4.15", "0c20a351a4f8508ba80e8f5b674034791e13d8e8"),
("v2.4.14.9", "1040c54c3b98ac4f8d91bc313cdc9d6669481da3"),
("v2.4.14.8", "5aa875d2cbee34727963bd81aa992b64480045ca"),
("v2.4.14.7", "6293d56ca18db9ed322b2a5550ac7b27bd538cff"),
("v2.4.14.6", "5fc4bcdeadad92d4479f9a66b4e4d57717b13219"),
("v2.4.14.5", "2d46136da942fda8496a564524dddf2ac3881221"),
("v2.4.14.4", "1fc742dd8e03a4957af9c1fee4a4e465781ba7a9"),
("v2.4.14.3", "d40d1af9f0aebf7e108f1dfb66ac5af671bc9719"),
("v2.4.14.2", "a8a2069f432c5597bdf9c83ab3045b9ef32ab5e3"),
("v2.4.14.1", "5db5272c0a5cd37e5a697e4750fbc4ce6317b7dc"),
("v2.4.14", "aad40ef3f2b9c4077e5a79606aed24a92ccb0406"),
("v2.4.13.8", "3ea86172d8f6ae13a896f78ec3f029bb410eacf2"),
("v2.4.13.7", "595cf06fad2068ed3e97caabbb92ebe71ffd97d9"),
("v2.4.13.6", "857805c6bdc445542e35347e18f1f0d21353a52c"),
("v2.4.13.5", "22a160fb095ca694e9f7ee29f131382e1faec889"),
("v2.4.13.4", "f97f22cb0b9dca2a797feccc580b3b8fdb238ac3"),
("v2.4.13.3", "ff35c838d857c189874481f52f65cf54183e908b"),
("v2.4.13.2", "4fd9cc9e607b22cca3bf5990e677fe90fc8361e6"),
("v2.4.13.1", "980adcb2cbdd20c15fe63b4c2db12ca0051d8c7d"),
("v2.4.13", "9ff086a3d48d6f6e24281e6edb6c804091eda3d1"),
("v2.4.12.6", "aed492fcb972130f11cd62fd8ca0b2af95f54d03"),
("v2.4.12.5", "2ef7e8cef81e6a091de2aebd9d30c273edf6c13c"),
("v2.4.12.4", "96c4fbbe32bf8aaace615f5ad2469f5531dae781"),
("v2.4.12.3", "975675b97f86323933d8f15b83660a60255988f7"),
("v2.4.12.2", "14450c4668484d2413b09ca77753133bce60a3e9"),
("v2.4.12.1", "ad8dcf57e93e8e5f9b815e786da35ef03fc70f89"),
("v2.4.12", "4c7ed1860c0d21292284fb044c465ba00ce89b7f"),
("v2.4.11", "6211a2d822e38a0202f3a395a96272400409d7af"),
("v2.4.10.6", "0a528ace2ea013fe60efaf633084b154962bfdbb"),
("v2.4.10.5", "8b29e8edf0ed8f63ecb35b16946f222854d74ad0"),
("v2.4.10.4", "1d23a518b19f828e6521056cf295b08c3d6eab6c"),
("v2.4.10.3", "0a97b16afbcaadbe4410d78adfe8967398454945"),
("v2.4.10.2", "5bf3be033f504f5fd79690fbb13d720407314e40"),
("v2.4.10.1", "98b8803038fa999212c37952adad1e04144f0ab7"),
("v2.4.10.0.4", "a356c406f36e65105272b1a9127c0098a113511c"),
("v2.4.10.0.3", "fbc139f54fdb7edfec470421c2cc885d3796dfcd"),
("v2.4.10.0.2", "d51c905ac6b3d259cf977038b23163d00a869c1b"),
("v2.4.10.0.1", "a41cd6e4274462df70a72f57c5a6cb85db924a08"),
("v2.4.10", "8c7cba553c8a0d9c5b0ce660c1757f33a25ac25d"),
("v2.4.9.15", "e2f6721a0a1b07612c0682d8240d3e9bc0a445a4"),
("v2.4.9.14", "269f8f707739116e68aee38d78d0cfb3d896b856"),
("v2.4.9.13", "a27c6530ff12bab100e64c5b43e84f759fa353ae"),
("v2.4.9.12", "dfc52b82fee5bc6713ecce3f81767a8565c4f874"),
("v2.4.9.11", "a880f45a48be2956d2c78a839c472287d54435c1"),
("v2.4.9.10", "c37fa164f793735b32aa3f53154ff1a7659e6442"),
("v2.4.9.9", "1d66e22e0f6b1cca563d240f90697b05860dca4d"),
("v2.4.9.8", "932f485f76f33b46e302fc390ee8e66529a2e5b4"),
("v2.4.9.7", "7df131525f431f502873361fa2f8da2039d96c79"),
("v2.4.9.6", "70a8be476e663526c3cb17a157c17ccf4fca5bd4"),
("v2.4.9.5", "1c3cefa582a6b598d204bad02676df300e457efa"),
("v2.4.9.4", "991b3ae8019276269816512425f102c4687f2291"),
("v2.4.9.3", "df0386374805089cbd09cc4a308e893be6738a93"),
("v2.4.9.2", "87f504e5c78b910b0c1d6ffb89bc95e492322c84"),
("v2.4.9.1", "f7bad91dac8ba67fbffb094f662f7444a0891314"),
("v2.4.9", "bb5b6e6c4dea4242f6ff75fa7adecea4f34935f1"),
("v2.4.8.4", "0b9ded43ee424791d9283cee2a33dcb4a97da57d"),
("v2.4.8.3", "a45eec0736717ff951f93b4a30ed605a8d95a3d4"),
("v2.4.8.2", "2be208bc58825f9b71833b4a24155689bbacc7f2"),
("v2.4.8.1", "a67f1b5da2cf8b14395596048c876247b894aa5c"),
("v2.4.8", "e9e7d7fa16122d7bfa6f87188828baf6080cb02e"),
("v2.4.7.8", "6c4b34bf750efec94cdb1b5b4851d46ea21dfffc"),
("v2.4.7.7", "dfc05323cf886ed7faca146cbee5cdad1a62157f"),
("v2.4.7.6", "52683c563e38d75819d8ac5e8e9e40505e99e117"),
("v2.4.7.5", "a931b32fc32a4c59f711ddea37ed56d414c9ded7"),
("v2.4.7.4", "70d68bd32041d22febb277038641d55c6ac7b57a"),
("v2.4.7.3", "48ad999d6fe95727a27b9ec82e522398d05cd928"),
("v2.4.7.2", "80b4c191cbea7c104e825a4e7e94980dcb33fee0"),
("v2.4.7.1", "6fbaac38b85e4bd3936b882392e3a9b45e8acb46"),
("v2.4.7", "6f267f9cc2ea3c375b3e70e336f4feb7da365fe3"),
("v2.4.6.9", "7b4d3039dfd2cbfa15127c29dcb557f314d13db1"),
("v2.4.6.8", "fff10634980710b1edd0c849b8478d3f5ec5ee95"),
("v2.4.6.7", "74f5133bc757c27c168be048b66ddfe53160a793"),
("v2.4.6.6", "08eb400cbebc7717f546845df7b87ad6f8711cf5"),
("v2.4.6.5", "9582480a60d0be5ac47e3da2777ec828278abf7f"),
("v2.4.6.4", "ccb6dd87174f4f71a0d15838a70a2b97bed6e203"),
("v2.4.6.3", "d62f43c548aa4bf76b6206b02f178a3a570d1114"),
("v2.4.6.2", "adbc4706552e90140e7d5c42b71bbd4a17a6bd4c"),
("v2.4.6.1", "170233272f5a2045a5f8fb37b980197e420c4a76"),
("v2.4.6", "740d9a78d59dc1c6584bc43bb1a64671f390c12c"),
("v2.4.5.9", "2d80cb2a5e022225b9512ccc98f7979cc4b92ce8"),
("v2.4.5.8", "75b566af5cc6f64f9ab5b66608ff8ce18098a2b4"),
("v2.4.5.7", "ff31dc0b2b944b3d08c20d4d2a79e47345ac8b16"),
("v2.4.5.6", "29f279c764808560eaceb88fef36cbc35c529aad"),
("v2.4.5.5", "396a6123577d5a9f563cc53c481731cf498bf294"),
("v2.4.5.4", "7a9a18cff5fbb3fd56e01d0436f29a9c83a3a333"),
("v2.4.5.3", "a5287abe398b74df9040d6dcd8356cf53a174e84"),
("v2.4.5.2", "4fdbe71c852f4b44203913c93a5d3a8a12041167"),
("v2.4.5.1", "d2a0e8decde7ef3354d8cdaa0ddf5517e5759ca2"),
("v2.4.5", "9c6f70be049f5a0439996107e58bf65e9a5d9a09"),
("v2.4.4.6", "c9df1e203d7efe8c93d3cdc04093f44f040f8e83"),
("v2.4.4.5", "560e89962e32171585dd95af9ac9911ebc0e02ce"),
("v2.4.4.4", "923215ae27c66dc2d25cc93ce1f7d3ef821c80bc"),
("v2.4.4.3", "02947070b658af5e0d8abdc7ad8486423a143553"),
("v2.4.4.2", "26560b559096e33ec86b09e3649e5235691a5197"),
("v2.4.4.1", "236e6127ad942fa9712f83a2d441e0ba7c3fc190"),
("v2.4.4", "7216d3e927c3b6c5d28e5ffaa54afbb34649debb"),
("v2.4.3.8", "4095b99c09e3db837b17f031da096a0213cdd527"),
("v2.4.3.7", "ed6eefe4382ab3a72d70922d401b7c8003513f13"),
("v2.4.3.6", "24579a8815132babf322c6d73608ce31f9b28ac8"),
("v2.4.3.5", "9102e0eb3e9e472dabe91d65783662d5619cf83b"),
("v2.4.3.4", "d39a11f309a4fdeeed232dd6c0f00604d11a4aea"),
("v2.4.3.3", "1a0153507ffae9cf3350e76c12d441788c0191e1"),
("v2.4.3.2", "b0683ac8928c4cf40646a6ce3eb6ffe94605acfa"),
("v2.4.3.1", "3544b3289d633721041f6d96d0efee8f79cd435b"),
("v2.4.3", "27c07b258df990ce981108198eca19b2512a202a"),
("v2.4.2.8", "8b11a705bdc5fd9f39b113f7d1dc9c8eeabe301b"),
("v2.4.2.7", "90a880a460aeb2374d6c766c08fa7786fb982aae"),
("v2.4.2.6", "94540b50ad2616f3ee1ea9f851d90f16174ed7bc"),
("v2.4.2.5", "cc80f8f99c1ba16d54b0af64cb3911cd0146259e"),
("v2.4.2.4", "8565fe850b04acbfdc4c24cdcafeed359bb0f2b3"),
("v2.4.2.3", "b56566c61ebe66fc5c9aa33385ba5b13bf6a8957"),
("v2.4.2.2", "44e8778cf19e61151a4819b771186c7e4c49bff1"),
("v2.4.2.1", "c37b3aca314d94297b0f6ce1fefdf18d8d6cece6"),
("v2.4.2", "6db68906c1bb26066a32c8e5be0c523da41cf08f"),
("v2.4.1.4", "2a7117ac7c120c085c56745f753166b821022858"),
("v2.4.1.3", "c8ebfc888f9ee93f2dc7cd62b3be66263755d99a"),
("v2.4.1.2", "5d12a58c4049a4839abbbdf87dd189505513b1b6"),
("v2.4.1.1", "1644c00da2252cb979743060056b2e2778884e99"),
("v2.4.1", "294b0fa792e0420b6d8bbbd27018fc764c1feb7d"),
("v2.4.0.12", "c9b9226830bdc88e57166ec7355bccda28eb95f5"),
("v2.4.0.11", "5e787ed514bb4b83cf5c74db1245547aecc4375a"),
("v2.4.0.10", "baf4e2cf9dddbc39fdb7dde6e3f9ebc107b67b78"),
("v2.4.0.9", "6805de5d7eb97f6e905b152b2fc1ee03fd0fb3aa"),
("v2.4.0.8", "9910fd91295aa8cad5f5d7fb88b258b191eb1630"),
("v2.4.0.7", "3175e85b413df8cecb7d9360226d2a0753da50fc"),
("v2.4.0.6", "e73dff56fdff565457c7788712e9042771bec106"),
("v2.4.0.5", "950a2b0b551d258daad060b9566910ca351d176a"),
("v2.4.0.4", "6aea16664696367eaab3ec2c00922c942a601073"),
("v2.4.0.3", "448ba078f486e18d82975e86e50bb1fee82fb5f2"),
("v2.4.0.2", "3192b2dcbe00fdfd6a50be32c8c626cf26b66076"),
("v2.4.0.1", "43e9282d088b07f03fc16a5325ff74cf49fb2990"),
("v0.01", "bb441db1a90a1801ef4e6546417a8d907c55d92f"),
] {
bash_empty(&format!("git tag '{tag}' '{commit}'"));
}
}
|
rename-tags/Cargo.toml:
Dockerfile: