Date: Sun, 14 Sep 2003 17:01:32 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Rob Lahaye <lahaye@snu.ac.kr> Cc: freebsd-questions@freebsd.org Subject: Re: Q: mergemaster 'm'-merge option results in empty file Message-ID: <20030914160132.GB26949@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <3F64552C.7060900@snu.ac.kr> References: <3F64552C.7060900@snu.ac.kr>
next in thread | previous in thread | raw e-mail | index | archive | help
--f2QGlHpHGjS2mn6Y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 14, 2003 at 08:46:52PM +0900, Rob Lahaye wrote: > What is left and right in the mergemaster context??? > 'man sdiff' doesn't seem to help out here. > I've tried a bit (I typed 'v' and 'q'), but then found /etc/hosts > totally empty!! >=20 > Any idea where I went wrong? 'sdiff' does a side-by-side comparison of two files, and lets you generate a file where some or all of those differences have been merged together. 'left' and 'right' in this context refer to the two columns that sdiff divides the screen into, where it shows you the blocks of lines that differ between the two files you're comparing. Perhaps an example is in order. Run these commands to get two different versions of the GENERIC kernel configuration from cvs: # cd /tmp # fetch -o GENERIC-CURRENT 'http://www.freebsd.org/cgi/cvsweb.cgi/~chec= kout~/src/sys/i386/conf/GENERIC?rev=3D1.246.2.51.2.2&content-type=3Dtext/pl= ain' # fetch -o GENERIC-STABLE 'http://www.freebsd.org/cgi/cvsweb.cgi/~check= out~/src/sys/i386/conf/GENERIC?rev=3D1.246.2.54&content-type=3Dtext/plain' (As the names suggest, those are just the latest versions from the HEAD and RELENG_4 branches) Now, assuming you're in an xterm or similar, stretch the window until it is at least 160 characters wide. If you're in a fixed width window, substitute the width of the window for the number after '-w' below. It's clearer to see what's going on if you can use as wide a screen as possible. Now run: # setenv EDITOR=3Dvi # sdiff -o GENERIC.n -s -w 160 GENERIC-STABLE GENERIC-CURRENT The first output you will see is: # $FreeBSD: /repoman/r/ncvs/src/sys/i386/conf/GENERIC,v 1.246.2.54 2003/04/= 28 | # $FreeBSD: /repoman/r/ncvs/src/sys/i386/conf/GENERIC,v 1.246.2.51.2.2= 2003/0 % (Which probably won't make a lot of sense unless your mail client doesn't automatically wrap long lines and you happen to be reading this in a fairly wide screen) What this is doing is asking which $FreeBSD$ tag should go into the merged file. Choose 'l' for the left-hand version, which comes from GENERIC-STABLE. If you're in a narrow window, you probably can't see the difference between those two lines as it's too far over to be displayed. The next chunk looks like: = < # FireWire support = < device firewire # FireWire bus code = < device sbp # SCSI over FireWire (Requires scbus and da= ) < device fwe # Ethernet over FireWire (non-standard!) = < % because the firewire support is only in the GENERIC-STABLE kernel config. Here, choose 'r' for the right hand version which comes from GENERIC-CURRENT. What you should end up with is a new file GENERIC.n where: % diff -u GENERIC-STABLE GENERIC.n --- GENERIC-STABLE Mon Apr 28 04:41:46 2003 +++ GENERIC.n Sun Sep 14 16:51:22 2003 @@ -264,8 +264,3 @@ device aue # ADMtek USB ethernet device cue # CATC USB ethernet device kue # Kawasaki LSI USB ethernet - -# FireWire support -device firewire # FireWire bus code -device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) and % diff -u GENERIC-CURRENT GENERIC.n --- GENERIC-CURRENT Tue Mar 25 23:35:15 2003 +++ GENERIC.n Sun Sep 14 16:51:22 2003 @@ -15,7 +15,7 @@ # device lines is also present in the ./LINT configuration file. If you are # in doubt as to the purpose or necessity of a line, check first in LINT. # -# $FreeBSD: /repoman/r/ncvs/src/sys/i386/conf/GENERIC,v 1.246.2.51.2.2 200= 3/03/25 23:35:15 jhb Exp $ +# $FreeBSD: /repoman/r/ncvs/src/sys/i386/conf/GENERIC,v 1.246.2.54 2003/04= /28 03:41:46 simokawa Exp $ =20 machine i386 cpu I386_CPU One thing that may trip you up: don't set your $EDITOR variable to 'emacs' -- because of the way emacs works by immediately copying the temporary file sdiff(1) generates, and renaming the original as a backup, it confuses sdiff(1), and you won't see any of your edits in the output. vi(1) just works directly on the temporary file and all is well. =20 Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --f2QGlHpHGjS2mn6Y Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/ZJDcdtESqEQa7a0RAjh6AJ9MeRZLqs44Esds/+fcjFEb+D+8VQCfe777 +V4LaaxK36DCG6HkWtrvkJk= =tCRm -----END PGP SIGNATURE----- --f2QGlHpHGjS2mn6Y--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030914160132.GB26949>