This seems to be an impossible problem, by definition.
Suppose that you had a set of .txt
files, one for each .cpp
file, containing your comments - separate ones for each function, of course.
Then when downloading a newer version of the package, you would still be faced with (a) renamed source files and (b) renamed functions within source files, not to mention (c) altered detail within those functions. So you would still have the same merging problem that you have now.
Basically, your comments are dependent on the source code wherever you store them: whether in /*…*/
inside the source code or outside it, in a neatly tagged text file with the same name as the source file. You will always have to re-merge on each update.
That said, build yourself some tools.
A filleter, which takes the extra-commented source files you've got, writes the comments to a text file or multiple text files or a database, noting which function and file each comment belongs to, and removing those comments from the original source file. This last is important, because then you can look through the source file yourself to see if any of your comments got left behind, and tune and rewrite the filleter until it really has filleted everything.
A stuffer, which takes a source file without extra comments, and the text file(s)/database created by the filleter, and stuffs the comments into the source file in the appropriate place. If it can't find where to put a comment, then it outgribes in one way or another and leaves you to do that bit of the work by hand.
You can easily test the stuffer by filleting the source code you've got and then stuffing it. If what you get back is what you started with, it's all working.