[git] [filesystem] [system] [timer...] Remove useless SVN branches?
Boost library repos converted from Subversion are littered with branches created by the conversion process that seem to me to be quite useless. For example, Boost filesystem has 65 branches, yet only 10 or so have any usefulness I'm aware of. A lot of the useless branches have names that begin "sandbox" or "svn-". I go back to the subversion repo when I want to look at pre-git-conversion history. Is there any point in retaining these branches? Does anyone object if I remove these branches from the libraries where I am the maintainer? What are other maintainers doing about stale branches? --Beman
2014-08-18 16:55 GMT+04:00 Beman Dawes
Boost library repos converted from Subversion are littered with branches created by the conversion process that seem to me to be quite useless. For example, Boost filesystem has 65 branches, yet only 10 or so have any usefulness I'm aware of. A lot of the useless branches have names that begin "sandbox" or "svn-". I go back to the subversion repo when I want to look at pre-git-conversion history.
Is there any point in retaining these branches?
Does anyone object if I remove these branches from the libraries where I am the maintainer?
What are other maintainers doing about stale branches?
I've hidden them. They do not show up now, but can be restored in case of very big need. Some time ago there was a discussion called "[boost] [git] Are we free to delete old branches?" David Abrahams suggested creating 'hidden' refs for old branches and then deleting stale branches. Here is what he told about hidden branches: Branches and tags are refs (seen in .git/refs/heads and .git/refs/tags respectively). They can be referred to by their shorthand name (e.g. "master") or their fully-elaborated path ("refs/heads/master") A "hidden ref" is a branch with a non-standard path, under refs/ but not under refs/heads/ So, to hide a remote branch, you might: git push origin <thebranch>:refs/hidden/<thebranch> # create non-std ref git push origin :<thebranch> # delete the old ref There are various tools around for making this kind of stuff easier, e.g., I have this in my .gitconfig for *local* hiding: [alias] hide = "!f() { git update-ref refs/hidden/$1 $1 && git branch -D $1; }; f" unhide = "!f() { git branch $1 && git update-ref $1 refs/hidden/$1; }; f" hidden = "!f() { git show-ref | grep hidden; }; f" Also, see .https://github.com/csonto/git-private -- Best regards, Antony Polukhin
On Aug 18, 2014, at 6:16 AM, Antony Polukhin
There are various tools around for making this kind of stuff easier, e.g., I have this in my .gitconfig for *local* hiding:
[alias] hide = "!f() { git update-ref refs/hidden/$1 $1 && git branch -D $1; }; f" unhide = "!f() { git branch $1 && git update-ref $1 refs/hidden/$1; }; f" hidden = "!f() { git show-ref | grep hidden; }; f"
The last one will erroneously identify e.g. refs/heads/obfuscate-hidden-entities as a hidden branch. Try `git show-ref | grep " refs/hidden"` Josh
participants (3)
-
Antony Polukhin
-
Beman Dawes
-
Josh Juran