Replies: 1 comment 2 replies
-
|
I am assuming that it is not a good idea to force push overwrite all of the old history. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion replaces #2011
The problem
Ever since I started trying understand Vienna's code, "played around" with Xcode and learned how to use Git (my first commit was in January 2012), I have been annoyed by some changes that occurred during the second half of year 2011.
Vienna's history has been marked by the succession of various version control systems: CVS, then SVN and currently Git.
Historically, the disk layout was : a folder per branch. So, in June 2011, we had 7 folders, numbered 2.0.0, 2.1.0… up to 2.6.0.
When we look back at this, some drawbacks of this situation become apparent: although 2.3.0 inherits from 2.2.0, finding out when and how they diverged is not always evident. To try to guess the purpose of the new branch and understand its timing, we can use commands like:
However, commands like
git blame fba5e0fe 2.3.0/AppController.mprovide no information prior to the start of version 2.3.0.A particular case is 2.4.0. The output of:
is not really helpful.
Similarly, if you run
git blame Vienna/Sources/Application/AppController.mtoday, you won't see anything prior to August 2011.Why? Because the repository got completely empty at some point.
The workaround
Through some combinations of backdated
giv mv,git cp,git mergeand sometimesgit cherry-pick, I created temporary branches that bypass the problematic situations.I then used
git replace --graft <child-commit> <new-'foster-parent'>to inducegitto retrieve the rectified history when the user runsgit logorgit blame.Once I was satisfied, I created (also backdated) tag objects in order to make the changes more visible and ensure they won't disappear from my repository.
The table below summarizes the changes and why they were needed:
The limits
git replacecreates refs underrefs/replace/*in `.git.Github will store these replacement references if you explicitly push them, but when viewing commits, diffs, or history, Github's web interface does not honor or expose replace refs. Gitlab and Forgejo/Codeberg behave similarly.
You will therefore only be able to view the changes in your local repository, using supporting tools (such as git command line, GitX or tig), after explicitly fetching the replacements:
My intent
After one week or two, I plan to:
git push ViennaRSS 'refs/replace/*'repl/*tagsBeta Was this translation helpful? Give feedback.
All reactions