Paolo Redaelli personal blog

Author: Paolo Redaelli

How to copy a file or directory from another GIT repository while preserving its history?

Internet is full of magic formulas each one more complex.

Here I’m proposing a much simpler and faster one that is to make a git format-patch for the entire history of the file or subdirectory that we want and then import it into the destination repository.

mkdir /tmp/mergepatchs
cd ~/repo/org
export reposrc=myfile.c #or mydir
git format-patch -o /tmp/mergepatchs $(git log $reposrc|grep ^commit|tail -1|awk '{print $2}')^..HEAD $reposrc
cd ~/repo/dest
git am /tmp/mergepatchs/*.patch

Simple and fast :)

Source synaptic fault http://blog.neutrino.es/2012/git-copy-a-file-or-directory-from-another-repository-preserving-history/

There’s actually plenty of open source apps that are objectively far superior to their proprietary counterparts, especially lately.

Name hijacking

I like the programming language named Eiffel, at least since 1998. Now I discover its name is somehow being robbed by a CI/CD project. I simply had to let Bertrand Meyer, father of Eiffel know it. The easiest way I found is throught X (once known as Twitter): Dear professor @Bertrand_Meyer, I’m sure you have…

Creare un piano di preparazione alle emergenze. Dipende cosa si intende per “emergenza”. Una bomba nucleare su Milano? L’interruzione della corrente elettrica per enne mesi? Quando hanno iniziato a ventilare le serrate all’inizio del 2020 ho fatto incetta di riso pasta e legumi secchi. Li ho ancora in cantina. La questione ĆØ come cucinarli se…

Gli allenamenti

“In questo preciso momento, da qualche parte del mondo, una studentessa si sta lagnando con il suo professore di matematica. Il professore le ha appena chiesto di trascorrere una sostanziosa porzione del fine settimana a calcolare un elenco di trenta integrali definiti.La studentessa preferirebbe fare altre cose.Anzi, non c’ĆØ praticamente nulla che non preferirebbe fare.Lo…

Huge chances?

I know I know the Observer Pattern. I just wanted to be sure what was the best practice in Python. I found this: Risky Implementations: If the pattern is not implemented carefully, there are huge chances that you will end up with large complexity code. From https://www.geeksforgeeks.org/observer-method-python-design-patterns/ With all the complex code out there having…

Audio oh, audio

As I tend to meddle a lot more than necessary with my strange machine which is stable/testing/unstable and somehow experimental I tend to mess it up. So today I had to issue to get audio back on my Gnome desktop

Fico come Ryo

Queste devo copiarla, anche se giunge da FaceBook! PerchĆ© tutto il mondo sta adorando il vincitore della medaglia d’Argento nella Pistola 10m? PerchĆ© tutto il mondo sta adorando il turcoYusuf Dikec? PerchĆ© il vincitore della medaglia d’oro…tutto il mondo, non sa manco chi sia? PerchĆ© Yusuf non porta lenti da migliaia di euro ma occhiali…