keeping track of local modifications

Eygene Ryabinkin rea-fbsd at codelabs.ru
Mon Dec 1 23:45:01 PST 2008


Perry, good day.

Mon, Dec 01, 2008 at 09:08:25PM -0800, perryh at pluto.rain.com wrote:
> > > Git and Mercurial cannot import Subversion $FreeBSD$ lines
> > > so far, and you may end up submitting patches that include
> > > unexpanded forms of the "$FreeBSD: xxxx $" text.  These will
> > > fail to apply if they same patch touches nearby lines.
> >
> > Ahm, yes.  "sed -e's|$FreeBSD: [^$]* \$|$FreeBSD$|g'" should help
> > in this case.
> 
> Not sure I understand what is meant by "unexpanded" here, since
> it looks as if this sed example would convert an "expanded" form
> -- containing the version info -- to an "unexpanded" one that
> merely shows where that info should go.

If you'll look at the diffs that are provided by Subversion, you'll
see that '$Id$' tags at the diff are shrinked to the '$Id' if keyword
expansion is enabled.  For example,
-----
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 40)
+++ ChangeLog   (working copy)
@@ -1,4 +1,5 @@
 $Id$
+add

 Current version:
  - Added CRL check for all certificates in chain during S/MIME
-----
while original ChangeLog reads
-----
$Id: ChangeLog 35 2008-04-11 10:02:37Z root $
add

Current version:
 - Added CRL check for all certificates in chain during S/MIME
   verification.
-----

The above sed command will normalize $FreeBSD$ tags (de-expand them,
you're right that the wording was a bit ambigious).

But I was out of coffee yesterday, so I missed an important thing: such
diffs won't also apply, because you're really right: Subversion shrinks
'Id' (think 'FreeBSD') tags for diffs it is generating, but it has no
command 'svn patch' that will shrink these tags, apply the diff and
unshink them to the original form.  And this matters when you're
generating the diff against version N, but maintainer applies it to the
version N + m.  If I am correct, there is no simple automatic solution,
but special patching as described above will be needed.

Please, correct me if I am wrong.
-- 
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual   
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook 
    {_.-``-'         {_/            #
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20081202/ba6d6e1f/attachment.pgp


More information about the freebsd-hackers mailing list