What I would like to do is as follows;
Branch A;
|
|
main.c
void foo() {...}
void bar() {}
Branch B;
|
|
bar.c
void bar() {...}
That is to say, with A
as the main branch, and B
as the child branch, I would like to merge the contents of bar.c
from B
into main.c
from A
. The only shared content between bar.c
and main.c
is the definition void bar()
(and this is, in fact, the only contents of bar.c
); the contents of this function are written in B
to be merged into A
. Alterations to void bar()
should only occur in bar.c
, within branch B
to be patched in, as necessary.
I have seen similar functionality in ‘diff’ files (see here, for instance) and appreciate something of an answer is available here but this seems to pertain to files which are identical, unless I have misunderstood, where I intend the file in branch B
to only contain a part of the primary file, main.c
.
Thank you.