Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » How to move packages from bazaar to github repo and UppHub
How to move packages from bazaar to github repo and UppHub [message #56180] Thu, 04 February 2021 15:21 Go to next message
mirek is currently offline  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
..correctly, with the history.

This is based on https://docs.github.com/en/github/using-git/splitting-a-subf older-out-into-a-new-repository

I will demonstrate this on moving bazaar/plugin/gdal.

First, clone U++ into some temporary working folder:

git clone https://github.com/ultimatepp/ultimatepp.git
cd ultimatepp


Remove all unwanted history and files:

git filter-branch --prune-empty --subdirectory-filter bazaar/plugin/gdal master

This will put content of bazaar/plugin/gdal to ., so we need to move it where it belongs:

mkdir plugin
mkdir plugin/gdal
git mv -k * plugin/gdal
git commit -m "Reorganized for UppHub"


Now it is time to create a new repo in github, in this case I have created https://github.com/mirek-fidler/gdal. The git remote path is https://github.com/mirek-fidler/gdal.git

git remote set-url origin https://github.com/mirek-fidler/gdal.git


And push it to the new repo:

git push -u -f origin master


The last step is to announce a new shiny UppHub module here, UppHub maintainers will pick up from that...

[Updated on: Thu, 04 February 2021 15:22]

Report message to a moderator

Re: How to move packages from bazaar to github repo and UppHub [message #56218 is a reply to message #56180] Wed, 10 February 2021 17:51 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Quote:
The last step is to announce a new shiny UppHub module here, UppHub maintainers will pick up from that...

You mean RIGHT here ? in this post ?
Re: How to move packages from bazaar to github repo and UppHub [message #56220 is a reply to message #56218] Wed, 10 February 2021 18:41 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1087
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Xemuth,

Please read following instructions on the GitHub. The easiest way in term of maitainability for us is to create PR for UppHub repository. Pasting data from forum to repository, doesn't seem for me like to optimal approach and I will lose time to do it manually.

Klugier


U++ - one framework to rule them all.
Re: How to move packages from bazaar to github repo and UppHub [message #56223 is a reply to message #56218] Wed, 10 February 2021 21:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
Xemuth wrote on Wed, 10 February 2021 17:51
Quote:
The last step is to announce a new shiny UppHub module here, UppHub maintainers will pick up from that...

You mean RIGHT here ? in this post ?


As far as I am concerned, it can be right in this post Smile

Klugier: this is just a very start, we can be more formal when we know what is really needed....

Mirek
Re: How to move packages from bazaar to github repo and UppHub [message #56288 is a reply to message #56223] Wed, 17 February 2021 12:07 Go to previous message
mirek is currently offline  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
Just a little followup inspiration (and backup), here is the simple code I have used to move all Libraries4U modules:

#include <Core/Core.h>

using namespace Upp;

void Cd(const char *dir)
{
	RLOG("cd " << dir);
	chdir(dir);
	RLOG("current dir: " << GetCurrentDirectory());
}

void BaseDir()
{
	Cd(GetHomeDirFile("xxx"));
}

void Syx(const char *cmd)
{
	RLOG(cmd);
	system(cmd);
}

JsonArray json;

void Do(String nest, String package = "", String examples = "")
{
	package = Nvl(package, nest);
	BaseDir();
	Syx("rm -rf " + nest);
	Syx("cp -r ultimatepp " + nest);
	Cd(nest);
	Syx("git filter-branch --prune-empty --subdirectory-filter bazaar/" + package + " master");
	Syx("mkdir -p " + package);
	Syx("git mv -k * " + package);
	Vector<String> x = Split(examples, ';');
	if(x.GetCount()) {
		Syx("mkdir examples");
		for(String p : x)
			Syx("cp -r ../ultimatepp/bazaar/" + p + " examples");
		Syx("git add examples");
	}
	Syx("git commit -m \"Reorganized for UppHub\"");
	
	String repo = "https://github.com/Libraries4U/" + nest + ".git";

	Syx("git branch -M main");
	Syx("git remote set-url origin " + repo);
	Syx("git push -u -f https://" + LoadFile(GetHomeDirFile("gitk")) + "@github.com/Libraries4U/" + nest + ".git");
	json << Json("name", nest)
	            ("packages", JsonArray() << package)
	            ("description", "")
	            ("repository", repo)
	            ("status", "stable")
	            ("category", "")
	            ("readme", "https://raw.githubusercontent.com/Libraries4U/" + nest + "/main/README.md")
	;
}

CONSOLE_APP_MAIN
{
	StdLogSetup(LOG_COUT|LOG_FILE);
	
	BaseDir();
	chdir("ultimatepp");
	Syx("git pull");
	Do("Functions4U", "", "Functions4U_Demo");
	Do("SysInfo", "", "SysInfo_demo_console;SysInfo_demo_gui");
	Do("Controls4U", "", "Controls4U_Demo");
	Do("STEM4U", "", "STEM4U_DemoTest");
	Do("matio", "plugin/matio");
	Do("sundials", "plugin/sundials");
	Do("GLCanvas", "", "GLCanvas_demo");
	Do("Surface");
	Do("OfficeAutomation", "", "OfficeAutomation_demo_console");
	Do("assimp", "plugin/assimp");
	
	RLOG("List:");
	RLOG(AsJSON(ParseJSON(~json), true));
}
Previous Topic: Library for Selenium WebDriver
Next Topic: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
Goto Forum:
  


Current Time: Sat Dec 14 15:05:51 CET 2024

Total time taken to generate the page: 0.03166 seconds