View previous topic :: View next topic |
Author |
Message |
ecatmur Advocate


Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
Posted: Thu Nov 17, 2005 10:46 pm Post subject: Using vimdiff to merge config changes from dispatch-conf |
|
|
dispatch-conf is a great way to manage configuration files, but the default merging program, sdiff, leaves a lot to be desired. Wouldn't it be better to use your favourite editor to merge differences?
Simply place this line:
Code: | merge="vimdiff -c 'saveas %s' -c next -c 'setlocal nomodifiable readonly' -c prev %s %s" |
(or
Code: | merge="gvimdiff -f -c 'saveas %s' -c next -c 'setlocal nomodifiable readonly' -c prev %s %s" | to use gvim) in /etc/dispatch-conf.conf, and you will be able to see all the proposed changes and also make changes to the new configuration file.
Note: the left pane will hold the original config file saved as the merge output, so make changes in the left pane and save that pane. To help you remember the right hand pane (containing the new config file) will be marked unmodifiable and read-only.
Use ":wqa" to write and exit. _________________ No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS? |
|
Back to top |
|
 |
scooper n00b


Joined: 13 Dec 2004 Posts: 32
|
Posted: Fri Nov 18, 2005 5:21 pm Post subject: |
|
|
Thanks for the great tip! I assume the diff= line could be replaced with a similar vimdiff command? I'm not familiar with the vimdiff command line options. How would they differ from the ones you used for merge?
Thanks again.
Steve |
|
Back to top |
|
 |
ecatmur Advocate


Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
|
Back to top |
|
 |
gi1242 Tux's lil' helper


Joined: 29 Jul 2004 Posts: 146
|
Posted: Mon Feb 12, 2007 1:24 am Post subject: |
|
|
I've been using this vimdiff trick for a while. Unfortunately after a recent portage update (2.1.2-r9), it doesn't work any more! For some reason I think dispatch-conf doesn't quote it's arguments properly. Namely '-c setreadonly' is seen as two words, not one quoted word.
This causes lots of trouble. Anyone know a work around?
Thanks,
GI |
|
Back to top |
|
 |
gi1242 Tux's lil' helper


Joined: 29 Jul 2004 Posts: 146
|
Posted: Wed Feb 14, 2007 7:45 pm Post subject: |
|
|
Well it looks like all I had to do was switch to double quotes, and backslash single quote arguments.
GI |
|
Back to top |
|
 |
mrsteven Veteran


Joined: 04 Jul 2003 Posts: 1939
|
Posted: Thu Feb 15, 2007 12:24 pm Post subject: |
|
|
I don't understand... Please post your correct line... |
|
Back to top |
|
 |
gi1242 Tux's lil' helper


Joined: 29 Jul 2004 Posts: 146
|
Posted: Thu Feb 15, 2007 7:18 pm Post subject: |
|
|
mrsteven wrote: | I don't understand... Please post your correct line... |
Code: | merge="vimdiff -c \'saveas %s\' -c next -c \'setlocal nomodifiable readonly\' -c prev %s %s" |
|
|
Back to top |
|
 |
mrsteven Veteran


Joined: 04 Jul 2003 Posts: 1939
|
Posted: Fri Feb 16, 2007 11:09 am Post subject: |
|
|
Ah, thank you very much!  |
|
Back to top |
|
 |
lkraav Tux's lil' helper


Joined: 13 Oct 2004 Posts: 130 Location: Estonia
|
Posted: Sat Apr 23, 2011 10:14 pm Post subject: |
|
|
is anyone noticing that vimdiff drops out of diff mode when you give :next command to it? i'm running 7.3.50. |
|
Back to top |
|
 |
|