1
1

13 Коммитов

Автор SHA1 Сообщение Дата
Dave Goodell
33da7d6f23 gkcommit.pl: fix UTF-8 and other encoding issues
The gatekeeper script was not correctly respecting the locale specified
in the user's environment.  So basically this scenario could (and did)
easily happen:

1. A committer writes a valid message in UTF-8 and runs `svn commit` with
   a correct locale setting of `LANG=en_US.UTF-8`.

2. SVN transcodes that to UTF-8 for internal storage (a no-op in this
   case).

3. The gatekeeper, also with `LANG=en_US.UTF-8` set, runs
   `gkcommit.pl ...`.  This breaks down into the following steps:

   A. run `svn log --xml ...`, which SVN correctly transcodes from UTF-8
      into the current locale, which happens to also be UTF-8

   B. Perl reads this in and assumes this is a sequence of raw 8-bit
      bytes in a "native" latin1-type encoding.

   C. Perl's XML::Parser module spots the XML declaration stating the
      content is UTF-8 encoded: `<?xml version="1.0" encoding="UTF-8"?>`.
      Perl internally stores the parsed strings as proper Unicode
      strings (UTF-8 encoded internally, but that's irrelevant here).

   D. Perl writes out the commit message file in the _latin1_ encoding,
      transcoding characters from internal UTF-8.  This causes
      characters like "ä" (Unicode code point: 0xe4, UTF-8 encoding:
      0xc3 0xa4) to be encoded as a single byte: 0xe4.

This fix changes the behavior at steps 3A and 3D to transparently treat
the incoming/outgoing data as UTF-8 (assuming a UTF-8 locale is set in
the user's environment).

There can still be problems if either the committer or the gatekeeper
have locale settings that do not agree with the encoding that their
editor is producing, but such is i18n :(

Helpful references for anyone debugging this sort of issue in the
future:

* http://perldoc.perl.org/perllocale.html#Unicode-and-UTF-8
* http://perldoc.perl.org/perluniintro.html#Unicode-I%2fO

Refs trac:4217

Reviewed-by: Jeff Squyres <jsquyres@cisco.com>

cmr=v1.7.5:reviewer=ompi-rm1.7

This commit was SVN r30709.

The following Trac tickets were found above:
  Ticket 4217 --> https://svn.open-mpi.org/trac/ompi/ticket/4217
2014-02-13 03:56:01 +00:00
Jeff Squyres
a951fde1ec Run a final "svn up" at the end of a successful gkcommit so that we
get a stable svnversion number (thereby allowing the next merge).

This commit was SVN r28128.
2013-02-27 15:04:51 +00:00
Jeff Squyres
de512db1fd Simpler scheme than r27195: if the gk commit file ends up being 0
bytes long, then abort the commit.  This avoids asking an extra
question in the most common case (where the GK doesn't edit the file
at all).

This commit was SVN r27198.

The following SVN revision numbers were found above:
  r27195 --> open-mpi/ompi@70aa879ed3
2012-08-31 16:05:09 +00:00
Jeff Squyres
70aa879ed3 Add 2 new features to the gkcommit script:
1. Warn the GK if the commit message didn't change (just like svn).
    If it didn't change, give the GK the option to abort, continue, or
    edit the file again.
 1. Include in the GK commit message the output of "svn status", so
    that the GK can see what files changed, etc.

This commit was SVN r27195.
2012-08-31 13:26:46 +00:00
Jeff Squyres
ec874b5fe2 Allow gkcommit.pl to accept lists of r numbers and trac ticket numbers
This commit was SVN r27033.
2012-08-14 18:08:42 +00:00
Jeff Squyres
87ca716daf Use a little better wiki formatting so that not everything is jumbled
onto a single line when viewing the commit message in trac.

This commit was SVN r26735.
2012-07-03 19:21:41 +00:00
Jeff Squyres
50ab8d893c Recent (as of 3 Aug 2011) versions of LWP in Macports seem to have
broken SSL certificate verification.  The IU CA is in my Mac system
keychain (and has been there for quite a long time), but after a
recent ports update, LWP fails the SSL certificate verification.
Fine.  So we'll just turn it off, per
http://search.cpan.org/~gaas/libwww-perl-6.02/lib/LWP/UserAgent.pm.

This commit was SVN r24983.
2011-08-03 13:50:23 +00:00
Jeff Squyres
cebd1837e5 Add special token to gkcommit commit messages so that the SVN
pre-commit hook doesn't try to re-close tickets that are referred to
in the original SVN commit messages.

This commit was SVN r24981.
2011-08-03 13:02:45 +00:00
Rainer Keller
9a8b794eb4 - Allow -r=r<NUM>, and -r=<NUM> for easier copy-pasting...
This commit was SVN r22915.
2010-03-30 14:02:35 +00:00
Jeff Squyres
e307df8a85 * Fix help message
* Fix to use SVN log messages relative to the trunk
 * Fix error message printing when LWP fails

This commit was SVN r22892.
2010-03-26 14:13:56 +00:00
Jeff Squyres
f9f85692f2 Add a dry-run mode.
This commit was SVN r22891.
2010-03-26 12:36:05 +00:00
Jeff Squyres
3179daa5e0 Add in Ralph's suggestion of running "svn up". Also add a command
line option to ''not'' run it if you don't want to.  Also add a --help
output so that you can see the command line options.

This commit was SVN r22883.
2010-03-25 15:00:17 +00:00
Jeff Squyres
370c987486 Add a helper script for the gatekeepers -- automatically create a
suggested SVN commit message for when closing a CMR (containing CMR
#s, CMR subject lines, and SVN commit log messages).

This commit was SVN r22882.
2010-03-25 14:38:21 +00:00