git/list[1] front-page[2] threads[3] people[4] search[5] about
 

re-running merge on a single file

From
Chris Packham <judge.packham@gmail.com>
Date
Mar 11, 2010, 18:54 UTC
Message-ID
<a038bef51003111054n5bcecd2eud531dcc80509f952@mail.gmail.com>
Hi List,

I'm in the middle of updating our copy of another projects repository. So far its been OK, we haven't diverged too much so it was a fairly simple operation to add the projects repository as a 'vendor' remote and get git merge to do most of the heavy lifting then use git merge tool to fix up the things that git merge couldn't resolve. So right now I have a history something like this.

-o-o-o-o-o           master
 \           \
  \           m        update
   \         /
    \-o-o-o            vendor

Now I'm finding that when I first used git mergetool for some things I messed up and need to fix the code. In some cases this is because some naming schemes changed in the vendor branch so I need to make equivalent changes to the code we've added, no problem thats just more commits on the update branch. In other cases I'm actually thinking that it'd be easier to ask git to try the merge again on that one file. I can ask git difftool to show me the pre-merge differences with 'git difftool master..vendor <file>' but what I'd really like to do is ask git mergetool to do something similar so I can re-do my manual merging.

Alternatively I could manually drive and external merge tool like kdiff3 if I had a recipe for getting the common ancestor revision. Something like

git checkout <magic pathspec> -- file mv file file.base

git checkout master -- file mv file file.ours

git checkout vendor -- file mv file file.theirs

kdiff3 file.base file.ours file.theirs -o file

--- Thanks, Chris

Next: Chris Packham
Message 1 of 14 in “re-running merge on a single file”
  1. Chris PackhamMar 11, 2010
  2. Chris PackhamMar 11, 2010
  3. Markus HeidelbergMar 11, 2010
  4. Chris PackhamMar 11, 2010
  5. Jakub NarebskiMar 11, 2010
  6. Chris PackhamMar 12, 2010
  7. Johannes SixtMar 12, 2010
  8. Junio C HamanoMar 12, 2010
  9. Chris PackhamMar 12, 2010
  10. Chris PackhamMar 12, 2010
  11. Junio C HamanoMar 12, 2010
  12. Chris PackhamMar 12, 2010
  13. Kris ShannonMar 14, 2010
  14. Jakub NarebskiMar 12, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.