Strumenti Utente

Strumenti Sito


mergetooltool

Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

mergetooltool [2014/01/22 13:58]
pietro mergetooltool
mergetooltool [2014/01/23 08:32] (versione attuale)
pietro uhm
Linea 5: Linea 5:
  
 This script does something very simple, but for which I did not find a ready solution: use the ability of git to solve conflicts in merges, while providing an intuitive graphic interface. This script does something very simple, but for which I did not find a ready solution: use the ability of git to solve conflicts in merges, while providing an intuitive graphic interface.
- 
-Here's how it works: git tells you it found a conflict in file "conflicted.txt". It leaves markers in it, delimiting the different versions. 
  
 ==== How it works ==== ==== How it works ====
  
   - You just did a "git merge", or "git rebase -i", and git tells you there is a conflict for file "conflicted.txt". When it tells you, it has already put some markers in "conflicted.txt" to distinguish the two different versions.   - You just did a "git merge", or "git rebase -i", and git tells you there is a conflict for file "conflicted.txt". When it tells you, it has already put some markers in "conflicted.txt" to distinguish the two different versions.
- 
   - You then call "/path/to/mergetooltool.py conflicted.txt": it parses "conflicted.txt", recognizes the markers, and simply creates two separate files, one with each version. Then, it opens your favorite diff GUI (I use meld, you can simply set yours at line 9 of the script), lets you resolve conflicts (the version you want to use should be left in the left pane, the one showing "//filename//.local"), and when you close puts the merged version back at "conflicted.txt".   - You then call "/path/to/mergetooltool.py conflicted.txt": it parses "conflicted.txt", recognizes the markers, and simply creates two separate files, one with each version. Then, it opens your favorite diff GUI (I use meld, you can simply set yours at line 9 of the script), lets you resolve conflicts (the version you want to use should be left in the left pane, the one showing "//filename//.local"), and when you close puts the merged version back at "conflicted.txt".
- 
   - You can then do "git add conflicted.txt" and (if you don't have other conflicted files) "git commit", and you're done.   - You can then do "git add conflicted.txt" and (if you don't have other conflicted files) "git commit", and you're done.
mergetooltool.txt · Ultima modifica: 2014/01/23 08:32 da pietro