[Bps-public-commit] SD branch, config-gitlike, updated. f55c04f93606dab43fd9dc9b99c695c2abbf651e

spang at bestpractical.com spang at bestpractical.com
Tue Jun 23 05:51:04 EDT 2009


The branch, config-gitlike has been updated
       via  f55c04f93606dab43fd9dc9b99c695c2abbf651e (commit)
       via  bdfa44778b5ca8caf2c831900bff07f3f89f682a (commit)
       via  b579dd8a176e9a787707ec63df888b3c6ae88f38 (commit)
      from  eaf67947af885b073cc2c0ba01c1284ecd547ddc (commit)

Summary of changes:
 bin/sd                                             |    5 +-
 lib/App/SD/CLI/Command/Help.pm                     |    2 +-
 lib/App/SD/CLI/Command/Help/Aliases.pm             |   40 ++++++++----
 lib/App/SD/CLI/Command/Help/Config.pm              |   65 ++++++++++++--------
 lib/App/SD/CLI/Command/Help/Environment.pm         |    2 +
 ...y_format_ticket.pm => ticket_summary_format.pm} |    9 ++-
 lib/App/SD/CLI/Command/Ticket/Search.pm            |    8 +-
 lib/App/SD/CLI/Dispatcher.pm                       |    3 +-
 t/07-sort-group.t                                  |   10 ++--
 9 files changed, 88 insertions(+), 56 deletions(-)
 rename lib/App/SD/CLI/Command/Help/{summary_format_ticket.pm => ticket_summary_format.pm} (83%)

- Log -----------------------------------------------------------------
commit b579dd8a176e9a787707ec63df888b3c6ae88f38
Author: Christine Spang <spang at bestpractical.com>
Date:   Tue Jun 23 11:03:26 2009 +0300

    Update sd alias help.

diff --git a/lib/App/SD/CLI/Command/Help/Aliases.pm b/lib/App/SD/CLI/Command/Help/Aliases.pm
index 965326a..5a31235 100644
--- a/lib/App/SD/CLI/Command/Help/Aliases.pm
+++ b/lib/App/SD/CLI/Command/Help/Aliases.pm
@@ -9,32 +9,43 @@ sub run {
 
 print <<EOF
 
-You can create custom command aliases in your local configuration file.
-The format is as follows:
+You can create custom command aliases in the aliases section of
+your local configuration files. The format is as follows:
 
-    alias command to type = command to translate it to
+    [alias]
+        command to type = command to translate it to
 
 As an example, you could create an alias to show all tickets assigned
 to you with the alias 'mine':
 
-    alias mine = ticket list -- owner=you\@domain.com status !~closed|rejected
+    mine = ticket list -- owner=you\@domain.com status !~closed|rejected
 
 SD also provides a command for managing aliases: '${cmd}aliases'. If
-given no arguments, the aliases command will present you with an editor
-window in which aliases can be modified. Aliases will be saved to your
+given no arguments, the aliases command will print the active aliases
+for the current repository (including all non-overridden user-wide
+and global aliases, if any). '${cmd}aliases edit' will present you with an
+editor window in which aliases can be modified. Aliases will be saved to your
 local configuration file when editing is done.
 
-The following arguments are supported:
+Examples (in all examples, 'alias' can be used anywhere 'aliases' appears):
 
-    --show (or -s)
-      Don't present an editor window, just print the current aliases
-      to STDOUT.
+    ${cmd}aliases
+    ${cmd}aliases show
+      Show currently active aliases.
 
-    --add (or -a) 'command to type = command to translate to'
-      Add a new alias from the command line.
+    ${cmd}aliases edit
+      Edit aliases in an editor window.
 
-    --delete (or -d) 'command to type'
-      Delete an existing alias from the command line.
+    ${cmd}aliases set command to type = command to translate to
+    ${cmd}alias command to type = command to translate to
+      Set the given alias (or change it if it already exists).
+
+    ${cmd}aliases delete command to type
+      Delete the given alias.
+
+The --user and --global arguments can be used in conjunction with the
+set (and edit) commands to change what configuration file to use.
+By default, the repository-specific configuration file is used.
 
 For more information on local configuration files, see '${cmd}help config'.
 

commit bdfa44778b5ca8caf2c831900bff07f3f89f682a
Author: Christine Spang <spang at bestpractical.com>
Date:   Tue Jun 23 11:53:49 2009 +0300

    More help updates.

diff --git a/lib/App/SD/CLI/Command/Help.pm b/lib/App/SD/CLI/Command/Help.pm
index 6c21682..8d82889 100644
--- a/lib/App/SD/CLI/Command/Help.pm
+++ b/lib/App/SD/CLI/Command/Help.pm
@@ -52,7 +52,7 @@ ${cmd}help sync        -  Publishing and importing ticket databases
 ${cmd}help history     -  Viewing repository history
 ${cmd}help environment -  Environment variables which affect sd
 ${cmd}help config      -  Local configuration variables
-${cmd}help summary_format_ticket  -  Details of this config variable
+${cmd}help ticket.summary_format  -  Details of this config variable
 ${cmd}help aliases     -  Command aliases
 ${cmd}help settings    -  Database configuration variables
 
diff --git a/lib/App/SD/CLI/Command/Help/Aliases.pm b/lib/App/SD/CLI/Command/Help/Aliases.pm
index 5a31235..d589482 100644
--- a/lib/App/SD/CLI/Command/Help/Aliases.pm
+++ b/lib/App/SD/CLI/Command/Help/Aliases.pm
@@ -27,7 +27,8 @@ and global aliases, if any). '${cmd}aliases edit' will present you with an
 editor window in which aliases can be modified. Aliases will be saved to your
 local configuration file when editing is done.
 
-Examples (in all examples, 'alias' can be used anywhere 'aliases' appears):
+Examples (in all examples, 'alias' can be used anywhere 'aliases' appears
+and vice-versa):
 
     ${cmd}aliases
     ${cmd}aliases show
diff --git a/lib/App/SD/CLI/Command/Help/Config.pm b/lib/App/SD/CLI/Command/Help/Config.pm
index 1b6e78c..dd71cdd 100644
--- a/lib/App/SD/CLI/Command/Help/Config.pm
+++ b/lib/App/SD/CLI/Command/Help/Config.pm
@@ -8,43 +8,58 @@ sub run {
     my ${cmd}= $self->_get_cmd_name;
 
 print <<EOF
-SD supports both a user-wide configuration file (\$HOME/.sdrc and
-per-database configuration file (/path/to/repo/config). If both configuration
-files are present, the database-specific config file will be used.
+SD supports a layered configuration system with three configuration
+files: a global file (/etc/sdrc), a user-wide configuration file
+(\$HOME/.sdrc) and per-replica configuration file (/path/to/replica/config).
+Configuration variables in more local configuration files override
+those in more global ones.
 
-You can use the '${cmd}config' command to view what configuration file
-SD is loading and what it contains.
+You can use the '${cmd}config' command to view what configuration files
+SD has loaded and all loaded configuration variables, as they apply
+to the current replica.
 
-Currently, the following configuration variables are available:
+The configuration file format is similar to that of the VCS 'Git'. See
+http://www.kernel.org/pub/software/scm/git/docs/git-config.html for
+specifics. The biggest thing you need to know is that the config file
+contains key/value variables, contained in sections. In the help
+documents, we'll refer to variables in the manner:
+"section.subsection.variable-name". In a configuration file, this
+would look like:
 
-    email_address = foo\@bar.com
-      Specifies an email address to use as the default for tickets'
-      reporter field. (Overrides the EMAIL environmental variable if
-      that is also set.)
+    [section "subsection]
+        variable-name = value
 
-    summary_format_ticket = %4s },\$luid | %-11.11s,status | %-60.60s,summary
+Currently, the following configuration variables are available (sorted
+by configuration file section):
+
+    ticket.summary-format = %4s },\$luid | %-11.11s,status | %-60.60s,summary
       Specifies how to format ticket summaries (when listing tickets, e.g.).
-      (See also: help summary_format_ticket.)
+      (See also: help ticket-summary-format.)
+
+    ticket.common-props = id,summary,status,owner,created,original_replica
+      A comma-separated list of ticket properties that are most-often
+      used. These properties will be shown by default in the 'ticket
+      show' command and presented for editing when interactively
+      creating or updating tickets. (Overrides the database-wide
+      setting of the same name.)
 
-    default_sort_ticket_list = status
-      Bug property to determine order of display when listing tickets. (Can
-      be any property; will be compared lexically.)
+    ticket.search.default-sort = status
+      Bug property to determine order of display when searching/listing
+      tickets. (Can be any property; will be compared lexically.)
 
-    default_group_ticket_list = milestone
-      Bug property to group tickets by when displaying lists. (Can be any
-      property.)
+    ticket.search.default-group = milestone
+      Bug property to group tickets by when displaying searches/lists. (Can be
+      any property.)
 
-    disable_ticket_show_history_by_default = 1
+    ticket.show.disable-history = 1
       Don't display ticket history when running '${cmd}ticket show'. Can
       be overridden by passing the '--with-history' arg to the
       command.
 
-    common_ticket_props = id,summary,status,owner,created,original_replica
-      A comma-separated list of ticket properties that are most-often
-      used. These properties will be shown by default in the 'ticket
-      show' command and presented for editing when interactively
-      creating or updating tickets. (Overrides the database-wide
-      setting of the same name.)
+    user.email-address = foo\@bar.com
+      Specifies an email address to use as the default for tickets'
+      reporter field. (Overrides the EMAIL environmental variable if
+      that is also set.)
 
 For information on environmental variables that can affect SD, see
 '${cmd}help environment'.
diff --git a/lib/App/SD/CLI/Command/Help/Environment.pm b/lib/App/SD/CLI/Command/Help/Environment.pm
index 6007ee8..5ba214c 100644
--- a/lib/App/SD/CLI/Command/Help/Environment.pm
+++ b/lib/App/SD/CLI/Command/Help/Environment.pm
@@ -21,6 +21,8 @@ configuration. Example syntax is for bash-like shells.
         
     export SD_CONFIG=/path/to/sd/config/file
       Specify where the configuration file SD is using should reside.
+      If this variable is specified, no other config file will be
+      loaded.
 
     export PROPHET_HISTFILE=~/.sd-history
       Specify where the interactive shell should store its history.
diff --git a/lib/App/SD/CLI/Command/Help/summary_format_ticket.pm b/lib/App/SD/CLI/Command/Help/ticket_summary_format.pm
similarity index 83%
rename from lib/App/SD/CLI/Command/Help/summary_format_ticket.pm
rename to lib/App/SD/CLI/Command/Help/ticket_summary_format.pm
index 2deca7e..8150fe3 100644
--- a/lib/App/SD/CLI/Command/Help/summary_format_ticket.pm
+++ b/lib/App/SD/CLI/Command/Help/ticket_summary_format.pm
@@ -1,20 +1,21 @@
-package App::SD::CLI::Command::Help::summary_format_ticket;
+package App::SD::CLI::Command::Help::ticket_summary_format;
 use Any::Moose;
 extends 'App::SD::CLI::Command::Help';
 
 sub run {
     my $self = shift;
-    $self->print_header('The summary_format_ticket configuration option');
+    $self->print_header('The ticket.summary-format configuration option');
 
 print <<EOF
-The summary_format_ticket configuration directive consists of any number
+The ticket.summary-format configuration directive consists of any number
 of comma-separated pairs, with each pair separated from the next by a vertical
 bar (|). Any amount of whitespace may appear before or after the | and will not
 affect the summary format.
 
 Here is an example:
 
-    summary_format_ticket = %5.5s },\$luid | %8.8s,status | %-52.52s,summary
+    [ticket]
+        summary-format = %5.5s },\$luid | %8.8s,status | %-52.52s,summary
 
 Let's deconstruct this example. It consists of three pairs. The first pair is
 '%5.5s },\$luid'. The first item of the pair should look somewhat familiar to
diff --git a/lib/App/SD/CLI/Command/Ticket/Search.pm b/lib/App/SD/CLI/Command/Ticket/Search.pm
index 4444f00..bd56fe2 100644
--- a/lib/App/SD/CLI/Command/Ticket/Search.pm
+++ b/lib/App/SD/CLI/Command/Ticket/Search.pm
@@ -10,20 +10,20 @@ sub run {
     my $self = shift;
 
     if (  (!$self->has_arg('sort') || !$self->arg('sort'))
-        && $self->app_handle->config->get( key => 'ticket.list.default-sort') )
+        && $self->app_handle->config->get( key => 'ticket.search.default-sort') )
     {
         $self->set_arg(
             'sort' => $self->app_handle->config->get(
-                key => 'ticket.list.default-sort'
+                key => 'ticket.search.default-sort'
             )
         );
     }
 
     if (  (!$self->has_arg('group') || !$self->arg('group'))
-        && $self->app_handle->config->get( key => 'ticket.list.default-group') )
+        && $self->app_handle->config->get( key => 'ticket.search.default-group') )
     {
         $self->set_arg( 'group' =>
-              $self->app_handle->config->get( key => 'ticket.list.default-group') );
+              $self->app_handle->config->get( key => 'ticket.search.default-group') );
     }
 
     # sort output by given prop if user specifies --sort
diff --git a/lib/App/SD/CLI/Dispatcher.pm b/lib/App/SD/CLI/Dispatcher.pm
index 08074e9..7f17855 100644
--- a/lib/App/SD/CLI/Dispatcher.pm
+++ b/lib/App/SD/CLI/Dispatcher.pm
@@ -27,7 +27,8 @@ under help => sub {
     on about   => run_command('Help::About');
     on config  => run_command('Help::Config');
     on copying => run_command('Help::Copying');
-    on summary_format_ticket => run_command('Help::summary_format_ticket');
+    on [ ['summary-format', 'ticket.summary-format', 'ticket_summary_format'] ]
+        => run_command('Help::ticket_summary_format');
 
     on [ ['author', 'authors'] ]         => run_command('Help::Authors');
     on [ ['environment', 'env'] ]        => run_command('Help::Environment');
diff --git a/t/07-sort-group.t b/t/07-sort-group.t
index e8f4ef4..e57401f 100644
--- a/t/07-sort-group.t
+++ b/t/07-sort-group.t
@@ -40,12 +40,12 @@ run_output_matches( 'sd', [ 'ticket', 'list', '--sort', 'owner' ],
 
 my $config_filename = $ENV{'SD_REPO'} . '/config';
 App::SD::Test->write_to_file($config_filename, '
-[ticket "list"]
+[ticket "search"]
     default-sort = owner
 ');
 $ENV{'SD_CONFIG'} = $config_filename;
 
-diag('using ticket.list.default-sort = owner');
+diag('using ticket.search.default-sort = owner');
 run_output_matches( 'sd', [ 'ticket', 'list' ],
     [ qr/(\d+) huzzah! new/,
       qr/(\d+) YATTA new/,
@@ -59,7 +59,7 @@ run_output_matches( 'sd', [ 'ticket', 'list', '--sort' ],
     ]
 );
 
-diag('using ticket.list.default-sort = owner and --sort none');
+diag('using ticket.search.default-sort = owner and --sort none');
 run_output_matches( 'sd', [ 'ticket', 'list', '--sort', 'none' ],
     [ qr/(\d+) YATTA new/,
       qr/(\d+) huzzah! new/,
@@ -83,9 +83,9 @@ run_output_matches( 'sd', [ 'ticket', 'list', '--group', 'owner' ],
     ]
 );
 
-diag('using ticket.list.default-group = owner');
+diag('using ticket.search.default-group = owner');
 App::SD::Test->write_to_file($config_filename, '
-[ticket "list"]
+[ticket "search"]
     default-group = owner
 ');
 

commit f55c04f93606dab43fd9dc9b99c695c2abbf651e
Author: Christine Spang <spang at bestpractical.com>
Date:   Tue Jun 23 12:50:31 2009 +0300

    Make the Moose stacktrace-eater less likely to eat lines of non-Moose exceptions.

diff --git a/bin/sd b/bin/sd
index 5dea7ef..679c19d 100755
--- a/bin/sd
+++ b/bin/sd
@@ -15,8 +15,9 @@ $ENV{'PROPHET_REPO'} ||= $ENV{'SD_REPO'} || $ENV{'HOME'}.'/.sd';
 unless ($ENV{SD_VERBOSE_ERROR} || $ENV{'TEST_VERBOSE'}) {
     $SIG{__DIE__} = sub {
         my $line = shift;
-        $line =~ s/\n.*//s if ($line =~ /at line/s);
-        $line .= "\n"; $line =~ s/\n+$/\n/gs;
+        $line =~ s/\n.*//s if ($line =~ /at .* line \d+.$/s);
+        $line .= "\n";
+        $line =~ s/\n+$/\n/gs;
         die $line;
     };
 }

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list