title: Insert your own code into another project automatically
body: <p>I'm making use of an open source project that is changing quite frequently. It is necessary for me to always have the latest version with all changes and bug fixes.</p>
  
  <p>The source code has been adjusted to make it do what I need. So it now contains my own code as well. Whenever sth changes, I currently manually read what changed in the changelog or compare files and then copy and paste everything into my own files. This is quite time consuming.</p>
  
  <p>So now I was thinking about using a different approach:</p>
  
  <ol>
  <li>Instead of long code snippets, only insert function calls and keep all of them in a separate file. Add this file to the make system.</li>
  <li>If the source code changes, download it and re-insert all the changes automatically</li>
  <li>Recompile, done</li>
  </ol>
  
  <p>This way I can now compare old and new (untouched) versions with the original source code and see what has changed between the state of the code that I used and the new one.</p>
  
  <p>My question is for step 2:</p>
  
  <p>Line numbers might change if additional code is added. How can I find the right positions to inject my own functions?</p>