{"thread":{"id":"35952","subject":"Can't use difftool to selectively revert changes","startedAt":"2014-02-25T15:22:35Z","lastAt":"2014-02-25T15:28:04Z","messageCount":2,"participants":["Robert Dailey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"235321","messageId":"CAHd499BGt8KhU=QU7dZ+-AR67=3Rf7VhBXfiHg7Ks=vSg6YOQQ@mail.gmail.com","threadId":"35952","inReplyTo":null,"subject":"Can't use difftool to selectively revert changes","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2014-02-25T15:22:35Z","receivedAt":"2014-02-25T15:22:35Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"I have a branch called topic1 that is based on 'master'. For a\nparticular file in my topic branch, I want to revert some changes by\nusing my diff tool. I do this by comparing the original revision of\nthe file with HEAD like so:\n\n$ git difftool $(git merge-base topic1 master) HEAD -- Path/SourceFile.cpp\n\nWhen I make changes to the right side (HEAD) through my diff tool, and\nexit, the changes aren't picked up and applied to my working copy.\nSince I'm modifying HEAD, I think it should carry over the changes I\nmake. Is this by design or a defect? I don't know how else to\nselectively revert changes to a file through my diff viewer.\n"},{"id":"235324","messageId":"CAHd499CfVNwpoeKhzSqHd-gd9XLsGjUtk7dXd0dWPJgkd+a-Kg@mail.gmail.com","threadId":"35952","inReplyTo":"CAHd499BGt8KhU=QU7dZ+-AR67=3Rf7VhBXfiHg7Ks=vSg6YOQQ@mail.gmail.com","subject":"Re: Can't use difftool to selectively revert changes","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2014-02-25T15:28:04Z","receivedAt":"2014-02-25T15:28:04Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"Sorry I'm going to go ahead and answer my own question:\n\n$ git difftool $(git merge-base topic1 master) -- Path/SourceFile.cpp\n\nI removed 'HEAD' from the command and now it picks up my changes and\ncompares to my working copy version (which is actually what I wanted).\nI thought HEAD would point to my working copy version but that's\nwrong.\n\nSorry for the superfluous post!\n\nOn Tue, Feb 25, 2014 at 9:22 AM, Robert Dailey <rcdailey.lists@gmail.com> wrote:\n> I have a branch called topic1 that is based on 'master'. For a\n> particular file in my topic branch, I want to revert some changes by\n> using my diff tool. I do this by comparing the original revision of\n> the file with HEAD like so:\n>\n> $ git difftool $(git merge-base topic1 master) HEAD -- Path/SourceFile.cpp\n>\n> When I make changes to the right side (HEAD) through my diff tool, and\n> exit, the changes aren't picked up and applied to my working copy.\n> Since I'm modifying HEAD, I think it should carry over the changes I\n> make. Is this by design or a defect? I don't know how else to\n> selectively revert changes to a file through my diff viewer.\n"}]}