All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
mr first reads ~/.mrconfig, and then looks for an additional .mrconfig file in
the current directory or one of its parent directories. Closes: #557963
-* After the mtrust flag day, consider making something similar to -p
- be enabled by default.
-
- It should not be identical to -p, for the following reason: -p causes
- mr to only look at the mrconfig it finds in the path (like -c only looks
- at the specified file). But by default, mr should certianly load the
- ~/.mrconfig (and files it chains). This allows a user to globally
- configure mr with aliases, etc. (Closes: #557963)
-
* a way to detect repos in a tree that are not registered, and warn
about or even auto-register them. (svn externals make this quite
difficult!)
* a way to detect repos in a tree that are not registered, and warn
about or even auto-register them. (svn externals make this quite
difficult!)
* Trust flag day. All mrconfig files except the main ~/.mrconfig are
now untrusted by default, until listed in ~/.mrtrust.
* Trust flag day. All mrconfig files except the main ~/.mrconfig are
now untrusted by default, until listed in ~/.mrtrust.
+ * The -p flag is now enabled by default. mr first reads ~/.mrconfig,
+ and then looks for an additional .mrconfig file in the current
+ directory or one of its parent directories. Closes: #557963
-- Joey Hess <joeyh@debian.org> Wed, 19 Jan 2011 13:39:43 -0400
-- Joey Hess <joeyh@debian.org> Wed, 19 Jan 2011 13:39:43 -0400
B<mr> is configured by .mrconfig files, which list the repositories. It
starts by reading the .mrconfig file in your home directory, and this can
B<mr> is configured by .mrconfig files, which list the repositories. It
starts by reading the .mrconfig file in your home directory, and this can
-in turn chain load .mrconfig files from repositories.
+in turn chain load .mrconfig files from repositories. It also automatically
+looks for a .mrconfig file in the current directory, or in one of its
+parent directories.
These predefined commands should be fairly familiar to users of any revision
control system:
These predefined commands should be fairly familiar to users of any revision
control system:
directory to register.
The mrconfig file that is modified is chosen by either the -c option, or by
directory to register.
The mrconfig file that is modified is chosen by either the -c option, or by
-looking for the closest known one at or below the current directory.
+looking for the closest known one at or in a parent of the current directory.
-The ~/.mrconfig file is used by default. To use a different config file,
-use the -c option.
+The mrconfig file that is used is chosen by either the -c option, or by
+looking for the closest known one at or in a parent of the current directory.
-Use the specified mrconfig file. The default is B<~/.mrconfig>
-
-=item -p
-
-=item --path
-
-Search in the current directory, and its parent directories and use
-the first B<.mrconfig> found, instead of the default B<~/.mrconfig>.
+Use the specified mrconfig file. The default is to use both B<~/.mrconfig>
+as well as look for a .mrconfig file in the current directory, or in one
+of its parent directories.
Trust all mrconfig files even if they are not listed in ~/.mrtrust.
Use with caution.
Trust all mrconfig files even if they are not listed in ~/.mrtrust.
Use with caution.
+=item -p
+
+=item --path
+
+This obsolete flag is ignored.
+
=back
=head1 MRCONFIG FILES
=back
=head1 MRCONFIG FILES
my $jobs=1;
my $trust_all=0;
my $directory=getcwd();
my $jobs=1;
my $trust_all=0;
my $directory=getcwd();
-$ENV{MR_CONFIG}="$ENV{HOME}/.mrconfig";
+
+$ENV{MR_CONFIG}=find_mrconfig();
# globals :-(
my %config;
# globals :-(
my %config;
-sub find_nearest_mrconfig {
my $dir=getcwd();
while (length $dir) {
if (-e "$dir/.mrconfig") {
my $dir=getcwd();
while (length $dir) {
if (-e "$dir/.mrconfig") {
- die "no .mrconfig found in path\n";
+ return "$ENV{HOME}/.mrconfig";
my $result=GetOptions(
"d|directory=s" => sub { $directory=abs_path($_[1]) },
"c|config=s" => sub { $ENV{MR_CONFIG}=$_[1]; $config_overridden=1 },
my $result=GetOptions(
"d|directory=s" => sub { $directory=abs_path($_[1]) },
"c|config=s" => sub { $ENV{MR_CONFIG}=$_[1]; $config_overridden=1 },
- "p|path" => sub { $ENV{MR_CONFIG}=find_nearest_mrconfig(); $config_overridden=1 },
+ "p|path" => sub { }, # now default, ignore
"v|verbose" => \$verbose,
"q|quiet" => \$quiet,
"s|stats" => \$stats,
"v|verbose" => \$verbose,
"q|quiet" => \$quiet,
"s|stats" => \$stats,
init();
startingconfig();
init();
startingconfig();
+ loadconfig("$ENV{HOME}/.mrconfig");
loadconfig($ENV{MR_CONFIG});
#use Data::Dumper; print Dumper(\%config);
loadconfig($ENV{MR_CONFIG});
#use Data::Dumper; print Dumper(\%config);