From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: PVE development discussion <pve-devel@pve.proxmox.com>
Subject: Re: [pve-devel] Plan for (invasive) shrink of pve-manager git repository
Date: Sun, 28 May 2023 20:38:22 +0200 [thread overview]
Message-ID: <2686c33f-a31b-2e3e-1807-fd1640f9ae5b@proxmox.com> (raw)
In-Reply-To: <e220f733-e96d-f83d-5afb-606199bc6fdc@proxmox.com>
Am 26/05/2023 um 11:45 schrieb Thomas Lamprecht:
> I'll use the git filter-repo [0] tool, a replacement for filter-branch with
> better UX and less potential for getting it wrong, to rewrite the history,
> filtering out any problematic artefact or directory.
>
> For this I'll use the following file-list
>
> www/ext6
> www/ext5
> www/ext4
> www/touch
> po
> glob:*.zip
>
> used as inverted match via the following command:
>
> git filter-repo --invert-paths --paths-from-file
> ~/pve-manager-inverted-filter-paths
>
> Then, I'd rename the current "pve-manager.git" hosted at git.proxmox.com to
> "pve-manager-legacy.git", so it will still be able as reference for ancient
> history, providing the possibility to build pre PVE 5 pve-manager packages
> (why ever one would want/needs to do that).
>
> A new repo, with the same name "pve-manager.git", would then get created and
> the now cleaned up git repo pushed to it.
Above has been carried out now.
Old repo is still available here:
https://git.proxmox.com/?p=pve-manager-legacy.git;a=summary
If you fetch in an existing pve-manager.git repository you'll see something like:
From git://git.proxmox.com/git/pve-manager
+ f548e4fca...4a8501a8b master -> origin/master (forced update)
+ 40ccc11c4...d26a7c43e stable-3 -> origin/stable-3 (forced update)
+ 08ba4d2dd...789b4067b stable-4 -> origin/stable-4 (forced update)
+ d0ec33c69...b80838a2f stable-5 -> origin/stable-5 (forced update)
+ 6ba2c0bcf...b31a318d0 stable-6 -> origin/stable-6 (forced update)
For re-aligning your local master branch you can do a hard-reset, BUT check
if you got any local commits yet (move them over to another branch with e.g.
`git checkout -b feature-to-re-apply-on-master`
git checkout master
git reset --hard origin/master
Then re-create your active development branches freshly from the master
and cherry-pick the relevant patches from the old branch.
After that you can delete the old branches.
> # Fallout
>
> This naturally has some fallout for developers currently working patch series,
> similar to any force-push (which we normally avoid at all cost).
>
> Rebasing won't work IIUC, but as the source file layout won't change, you can
> simply use "git cherry-pick <rev-range>" if you have the before filter and
> after filter remotes & branches in the same git repo. Otherwise, one can
> always use "git format-patch -o ~/patches/ <rev-range>" in the old repo to
> export patches cleanly, and then use "git am -3 ~/patches/*.patch" in the new
> repo.
FWIW, I migrated over my branches, and cherry-picking worked well.
>
> Note that git commit hash references inside commit messages of pve-manager will
> get rewritten, so here won't notice anything. Commit references from other
> repos are naturally untouched, but pve-manager being a leave package means that
> it won't have that many in other repos.
Note that above is wrong, my test for that was misguided, but filter-repo does
check for this and outputs it as "suboptimal-issues" file (see below), it luckily
ain't that many as we only (relatively) recently began to track stuff like "Fixes"
in there.
> I'll safe a copy of the old -> new commit reference map that git filter-repo
> produces, ensuring we got full transparency.
This is publicly available here:
https://pve.proxmox.com/pve-manager-filter-repo-result/
Most interesting will be the "commit-map" file.
In the "ref-map" I marked those branches which I did not copy over, mostly some
ancient hot fix branches; OTOH, all stable-X branches *got* copied over.
Again, sorry for any trouble and headache this may cause, if you have specific
question (or see something that is off) -> ask me (e.g., reply to this mail on
the list)
cheers,
Thomas
next prev parent reply other threads:[~2023-05-28 18:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 9:45 Thomas Lamprecht
2023-05-28 18:38 ` Thomas Lamprecht [this message]
2023-05-28 18:51 ` Thomas Lamprecht
2023-05-30 8:36 ` Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2686c33f-a31b-2e3e-1807-fd1640f9ae5b@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=pve-devel@pve.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox