Opened 8 years ago

Closed 5 years ago

#6547 closed task (wontfix)

Cleanup svn keyword substitution

Reported by: Kurt Schwehr Owned by: Kurt Schwehr
Priority: low Milestone: closed_because_of_github_migration
Component: default Version: svn-trunk
Severity: minor Keywords: svn keywords
Cc:

Description

This isn't really a big deal, but it is a bit of unnecessary noise in all the commits. Almost all files have both a comment and a CPL_CVSID with $Id:$. Some files even have $Id:$, but the keyword property has not been set. I do a lot of diff'ing and merging, so reducing this to just the CPL_CVSID would be nice (for me). But, before I go and cleanup the svn keywords and get red of the comment Id line, I think it needs to be discussed. If anyone feels we need to keep both, can you explain why?

Just looking at the C and C++ code in trunk/gdal, not looking at trunk/autotest.

And what should we have for libraries brought in from elsewhere like libjpeg, giflib, etc?

  • ogrmulticurve.cpp

    diff -u ogrmulticurve.cpp ~/src/gdal/gdal/ogr/ogrmulticurve.cpp 
    old new  
    11/******************************************************************************
    2  * $Id: ogrmulticurve.cpp 33631 2016-03-04 06:28:09Z goatbar $
     2 * $Id: ogrmulticurve.cpp 34357 2016-06-16 13:19:28Z goatbar $
    33 *
    44 * Project:  OpenGIS Simple Features Reference Implementation
    55 * Purpose:  The OGRMultiCurve class.
     
    3131#include "ogr_geometry.h"
    3232#include "ogr_p.h"
    3333
    34 CPL_CVSID("$Id: ogrmulticurve.cpp 33631 2016-03-04 06:28:09Z goatbar $");
     34CPL_CVSID("$Id: ogrmulticurve.cpp 34357 2016-06-16 13:19:28Z goatbar $");

Files with Id keyword that is not set:

find . -name \*.cpp -o -name "*.[ch]" | xargs egrep '[$]Id:[ ]*[$]'
./frmts/postgisraster/postgisrastertilerasterband.cpp: * Last changes: $Id: $
./frmts/postgisraster/postgisrasterdataset.cpp: * Last changes: $Id: $
./frmts/postgisraster/postgisraster.h: * Last changes: $Id: $
./frmts/postgisraster/postgisrastertiledataset.cpp: * Last changes: $Id: $
./frmts/postgisraster/postgisrastertools.cpp: * Last changes: $Id: $
./frmts/postgisraster/postgisrasterrasterband.cpp: * Last changes: $Id: $
./frmts/postgisraster/postgisrasterdriver.cpp: * Last changes: $Id: $
./frmts/georaster/oci_wrapper.h: * $Id: $
./frmts/georaster/oci_wrapper.cpp: * $Id: $
./frmts/georaster/georaster_priv.h: * $Id: $
./frmts/georaster/georaster_rasterband.cpp: * $Id: $
./frmts/georaster/georaster_dataset.cpp: * $Id: $
./frmts/georaster/georaster_wrapper.cpp: * $Id: $
./frmts/raw/eirdataset.cpp: * $Id:  $
./frmts/raw/eirdataset.cpp:CPL_CVSID("$Id:  $");
./frmts/ingr/JpegHelper.cpp: * $Id:  $
./frmts/ingr/JpegHelper.h: * $Id:  $
./frmts/dds/ddsdataset.cpp: * $Id: $
./frmts/dds/ddsdataset.cpp:CPL_CVSID("$Id: $");
find . -name \*.cpp -o -name "*.[ch]" | xargs -n 1 svn propget svn:keywords | sort -u
Author Date Id Revision
Id
Id Date Author Rev

Looking at Author Date and Revision, it looks like we don't use them (and they are really redundant to Id unless someone is setting a specific thing in doxygen docs or some such, but that's not happening in the code.

find . -name \*.cpp -o -name "*.[ch]" | xargs egrep '[$](Author|Date|Revision):'
./alg/libqhull/poly.h:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/global.c:   $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
./alg/libqhull/io.c:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/merge.h:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/mem.c:  $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/stat.h:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/libqhull.c:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/libqhull.h:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/poly.c:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/merge.c:   $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
./alg/libqhull/mem.h:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/poly2.c:   $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
./alg/libqhull/geom.c:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/geom2.c:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/io.h:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/stat.c:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/qhull_a.h:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/qset.c:   $DateTime: 2012/01/27 22:32:16 $$Author: bbarber $
./alg/libqhull/geom.h:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/random.h:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./alg/libqhull/qset.h:   $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
./frmts/gtiff/gt_wkt_srs.cpp:   GTCitationGeoKey (Ascii,215): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 34309 $ $Date: 2016-05-29 11:29:40 -0700 (Sun, 29 May 2016) $\nProjection Name = UTM\nUnits = meters\nGeoTIFF Units = meters"
./frmts/gtiff/gt_wkt_srs.cpp:   GeogCitationGeoKey (Ascii,267): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 34309 $ $Date: 2016-05-29 11:29:40 -0700 (Sun, 29 May 2016) $\nUnable to match Ellipsoid (Datum) to a GeographicTypeGeoKey value\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"
./frmts/gtiff/gt_wkt_srs.cpp:   PCSCitationGeoKey (Ascii,214): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 34309 $ $Date: 2016-05-29 11:29:40 -0700 (Sun, 29 May 2016) $\nUTM Zone 10N\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"

So, I would also propose that we set the svn:keywords to just be "Id" for source files.

find . -name \*.cpp -o -name "*.[ch]" | xargs -n 1 svn propget svn:keywords > keywords
grep '^Id$' keywords | wc -l
528
egrep '^Author Date Id Revision' keywords | wc -l
864
grep '^Id Date' keywords | wc -l
3

For reference:

http://svnbook.red-bean.com/en/1.7/svn.advanced.props.special.keywords.html

Change History (5)

comment:1 by Kurt Schwehr, 8 years ago

Demonstrated propset with r34506.

svn propget svn:keywords gdaltransformgeolocs.cpp gdal_rpc.cpp 
gdal_rpc.cpp - Author Date Id Revision

svn propget svn:keywords gdaltransformgeolocs.cpp 
# Nothing

svn propset svn:keywords Id gdal_rpc.cpp
svn propset svn:keywords Id gdaltransformgeolocs.cpp
svn commit

svn propget svn:keywords gdaltransformgeolocs.cpp 
Id

grep Id gdal_rpc.cpp gdaltransformgeolocs.cpp 
gdal_rpc.cpp: * $Id: gdal_rpc.cpp 34506 2016-07-01 17:08:58Z goatbar $
gdal_rpc.cpp:CPL_CVSID("$Id: gdal_rpc.cpp 34506 2016-07-01 17:08:58Z goatbar $");
gdaltransformgeolocs.cpp: * $Id: gdaltransformgeolocs.cpp 34506 2016-07-01 17:08:58Z goatbar $
gdaltransformgeolocs.cpp:CPL_CVSID("$Id: gdaltransformgeolocs.cpp 34506 2016-07-01 17:08:58Z goatbar $");

comment:2 by Kurt Schwehr, 8 years ago

Cleaning up svn:keywords: r34518 r34519 r34520 r34521

comment:3 by Kurt Schwehr, 8 years ago

Cleaning up svn:keywords: r34522 r34524 r34525

comment:4 by Kurt Schwehr, 8 years ago

r34557 r34556 r34558 in port

find . -name \*.cpp | xargs egrep --files-without-match CPL_CVS | wc -l
     328

comment:5 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.