help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

complex patch/diff usage


From: Ian Stevenson
Subject: complex patch/diff usage
Date: 28 Jul 2004 21:22:49 -0700

Hi all,

I'm trying to figure out the following puzzle - for work of course.

Say I have a file called 'A', and then make changes to this file and
call it 'A1'. I then go back to 'A' and make some different changes
and call it 'A2'.

I then make more changes to 'A1' and so call it 'A11', and then for
fun make a small addition to 'A2' and call the file 'A22'.

Now the interesting bit.

That small addition that created 'A22' I want to merge into 'A11' but
I DON'T want the other changes that are in 'A2' - only that small
addition that made 'A22'.

How can this be done with diff and patch?

To help understanding, here is an attempt at a diagram:
   A
  / \
A1   A2
 |   | x
A11  A22

The x marks the changes that we want to go into A11.

To further help you understand this, think of CVS branches - as that's
how this came about. A college made a change on the branch, when it
was meant to be on the trunk. Luckly he did not commit it so we wanted
to do an external merge and leave the branch alone. In the end, we did
it manually - but I'd love to know if we could have done with
diff/patch.

Thanks for any help you provide,
Ian.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]