0

Say I have the following commits on the two branches:

(trunk) A - B - C

(produ) A 

I want to merge the work done in C but not necessarily B.

There is a chance that the code in C never touched any of the areas changed by B (ideal).

But it could also be possible that C changed some of the same areas as B. So when I do a merge I get some of B's changes (specifically the changes C made to B's changes).

Is there a way to detect when one commit's changes 'depends' on another commit's changes?

I know I can examine both sets of changes and eyeball it, but surely there must be a better way.

jmathew
  • 1,522
  • 17
  • 29
  • You're using a 3-way merge tool, correct? – Ben Sep 15 '14 at 03:19
  • No I just run merge on the command line and when a conflict appears I resolve it inline with an editor. I can see how a merge tool would help a little but ideally I'd like to run a command that detects this situation for me without me having to look at the code. – jmathew Sep 15 '14 at 14:58
  • I'm pretty sure there is no such tool to cherry-pick changes to a single line automatically. I suggest using a graphical 3-way merge tool so you can manually see the changes more easily. For example, kDiff3 or Meld. I'm sure there are many others out there. – Ben Sep 15 '14 at 15:59
  • I don't even need to know on a line by line basis, just that once commit modifies the changes of another commit in general. However, getting a merge tool is a good suggestion regardless. – jmathew Sep 15 '14 at 17:02

0 Answers0