db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5896) Change java/drda source code to use spaces instead of tabs and clean up tab creep in java/client
Date Mon, 13 Aug 2012 16:42:38 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13433270#comment-13433270

Kathey Marsden commented on DERBY-5896:

Below are some tips for negotiating white space differences now that  java/drda and java/client
have been reformated to have only space indentation (DERBY-5896).   The replacement of tabs
with four spaces was done for java/drda at revision 1370673 and java/client at revison 1371306.

svn merge, blame and diff commands (command line)
Specify -x -b on these svn commands to ignore white space differences.  I changed my svnmergefromtrunk
 script as follows and had no problem merging  DERBY-1400 to 10.9, a post reformat change:
#svnmergefromtrunk   e.g for change 1371677 svnmergefromtrunk  1371677
svn merge -x -b -c $1  https://svn.apache.org/repos/asf/db/derby/code/trunk

visual diff tools.
Most visual diff tools have options for ignoring white space diffs which should be set when
comparing branches or old versions.

Eclipse subclipse plugin

Set preferences under Window (or Project properties for fine project tuning)
Window->Preferences->Compare/Patch - Check ignore white space.
Window -> Preferences-> Java -> Code Style -> Formatter -> Edit -> Tab Policy
- Choose Spaces Only
Window -> Preferences-> General-> Text Editors - Check Insert spaces for tabs, show
whitespace characters.

Eclipse subclipse annotation
subclipse annotation does not allow you to specify -x -b.  To look at history prior to the
change, however, you can  specify a "To version" which can be prior to the reformat and give
the annotation prior to the large change. I think we could add a PRESPACE tag or some such
to make this easier.  For drda, this is 1370673, for client 1371306.  Another option is to
use subclipse annotation on an older branch like 10.9.

Eclipse subclipse merge
I think this will not work very well until subclipse provides a whitespace option. The only
option I know is to use svn merge from the command line.

Are there other things that folks should consider?  I only tried with eclipse IDE and do not
merge in the IDE. I am guessing subclipse merge will have issues. Tips for Netbeans other
IDE's would be welcome. 

> Change java/drda source code to use  spaces instead of tabs and clean up tab creep in
> -------------------------------------------------------------------------------------------------
>                 Key: DERBY-5896
>                 URL: https://issues.apache.org/jira/browse/DERBY-5896
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions:
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: derby-5896-align-with-tab-stops.diff.txt, derby-5896_client_diff.txt,
derby-5896_client_stat.txt, derby-5896_diff.txt, derby-5896_stat.txt
> Change all the network server code under java/drda to use spaces instead of tabs.
> Having mixed tabs and spaces can be confusing, irritating  and time consuming for developers
especially in the network code where client is all spaces and the server mostly tabs.
> With the  -x -b options on svn merge and svn diff, merges should be reasonable even if
we change all the tabs to 4 spaces in the files under java/drda with a script something like
(not yet tried):
> #!/bin/bash
> files=$@
> for file in $files
> {
>    echo $file
>    mv  $file $file.orig
>    sed -e 's/\t/    /g' < $file.orig > $file
>    rm $file.orig
> }
> Are there any objections to this change?  If not does anyone have any pending DRDA changes
they would like to get in before I make the change?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message