I fairly regularly go crazy finding the monotone root directory in a
workspace with many nested directories.

Here is a perl one liner that solves my problems:

perl -e 'print map { "$_\n" } map { glob "../" x $_ . "_MT[N]" } 0..15'

The last 15 is the maximal nesting depth.

As an example, to go to the monotone inventory directory _MTN:

cd `perl -e 'print map { "$_\n" } map { glob "../" x $_ . "_MT[N]" } 0..15'`

and to go to the root directory of the monotone workspace:

cd `perl -e 'print map { "$_\n" } map { glob "../" x $_ . "_MT[N]" } 0..15'`/..

The perl statement also takes nested workspaces into account, printing
the _MTN directory for each one found.

Obviously you can install this as a shell alias.


-- 

Hugo


--

                    Hugo Cornelis Ph.D.

              Neurospaces Project Architect
                http://www.neurospaces.org/

                  Research Imaging Center
   University of Texas Health Science Center at San Antonio
                    7703 Floyd Curl Drive
                 San Antonio, TX  78284-6240

                    Phone: 210 567 8112
                      Fax: 210 567 8152


_______________________________________________
Monotone-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to