Here is a "real-world" example:

The original repository is this one:
https://github.com/PascalCoin/PascalCoin

My restructured repository is this one:
https://github.com/SkybuckFlying/PascalCoinRestructured

The original repository is a big mess and it's very hard to find any class 
in it. 

While the restructured repository is splitted into folders and more files, 
a bit like java where each class is in it's own file.

By restructuring classes into folders and files it becomes much easier to 
find those classes in the project manager.

No other option exists in Delphi to find classes through the entire project 
besides "search in all files" this however requires to know what you are 
searching for in the first place which is less ideal but ok.

Anyway. Now PascalCoin original repository has "advanced" there is more new 
code in some of the files that were splitted.

It would be interesting if there was a way to incorporate those changes 
into the restructured folders/files.

There seem to be many possibilities to only selectively choose what changes:

For example:
https://stackoverflow.com/questions/449541/how-can-i-selectively-merge-or-pick-changes-from-another-branch-in-git

The one that looks somewhat promising is the diff to patch file option 
where a patch is created.

Then the patch could be applied to some file.

I haven't tried this yet, though I see some down sides... 

First of all the current changes are many, second I would need to know and 
specify where these changes/patches need to go to what file. 
This gets a bit difficult to automate, hence my suggestion for tags in the 
files themselfes or some other technique to specify what goes where.

The idea of "hunks" or interactive mode also sounds a little bit 
interesting.

Anyway if you take a look at both repositories can you make any 
recommendations how to apply the changes from original to restructured in 
an efficient way as possible ?

I do admit that I changed a whole bunch of stuff at the same time without 
making many commits. At the time I made those changes I wasn't really used 
to git that much.

I am used to working incredibly fast and making many changes if necessary 
and therefore git may not entirely fit with my coding experiences which is 
incredibly fast.

Making many small commits would slow my development down drastically. 
Describing each little change for example would also require a lot of time. 
This workflow style of small little commits could be tried but at great 
expense to me and I am not sure if that would be worth it at all and if it 
is the way forward.

I doubt this will be any use to the current situation. A possibility is to 
try and work together with original repository owner and apply 
restructuring there, but then I would loose the already done work.

For git it doesn't really matter if it's small or big changes/commits. It 
can either recgonize chunks or not, it knows where to put them or not.

I am willing to go through some kind of big interactive mode or something 
to try and incorporate the changes from the original to the restructured 
repository just to see if it can be done with git.

So what I am looking for is any assistance from git commands, tricks, 
scripts, tools or anything to basically do the following:

git init
git remote add Restructured 
https://github.com/SkybuckFlying/PascalCoinRestructured
git remote add PascalCoin https://github.com/PascalCoin/PascalCoin
git fetch Restructured
git fetch PascalCoin
git merge Restructured/master
git merge PascalCoin/master
^
above command may have to be something different more advanced ???

Right now this seems to produce many merge conflicts and original files are 
imported back again, instead of split into already existing files... 

Bye for now.
  Skybuck.
On Sunday, September 12, 2021 at 3:09:20 AM UTC+2 skybuck2000 wrote:

> Problem description:
>
> Background:
> Original fork does not want to split a file.
> Child fork does want to split the file and does so.
> Child fork can no longer benefit from changes from original fork.
>
> Problem:
> Git is incapable of transferring the changes of orignal fork file to child 
> fork splitted files.
>
> Suggested Solution:
> Use deep learning networks and machine learning to develop a neural brain 
> which is capable of detecting which changes/pieces of code belong together 
> and in what file they belong.
>
> Bye for now,
>   Skybuck.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/2ce32d3e-620d-4188-8890-84f46d413861n%40googlegroups.com.

Reply via email to