Some more options based on
Instant Color Filters[/i] and [url=http://www.xyplorer.com/release_13.90.h ... bleColumns]Scriptable Custom Columns.
1) You can use the tag and box approaches I previously mentioned but use a custom column to automatically tag your repositories. Use the snippet command Sammay mentioned but paste this instead:
Code: Select all
Snip: CustomColumn 1
XYplorer 14.40.0318, 9/16/2014 3:54:01 PM
Action
ConfigureColumn
Caption
Auto-Tagger
Type
3
Definition
$path = Trim(<cc_path>, '\/');
Box 'BBDDBB', $path;
Tag 'git-repo', $path, 1, 0;
Format
0
Trigger
0
Item Type
1
Item Filter
".git"
You'll also need a color filter for the 'git-repo' tag:
Because scripting columns can be a bit slow and have a negative impact on listing this script only runs when the list is showing a listing containing a ".git" folder, meaning it isn't fully automatic.
Thus, if you have,
C:\Projects\TopSecret\.git until you browse
C:\Projects\TopSecret it won't be highlighted, but once you do browse it the script will tag and box the path so that in the future it is colored.
The script also doesn't return anything so the column that is displayed is left blank and is otherwise useless, but it can be modified to do more or show something useful if desired.
2) The fully automatic approach using Instant Color Filters... Again do the snippet thing but use this:
Code: Select all
Snip: CustomColumn 1
XYplorer 14.40.0318, 9/16/2014 4:02:05 PM
Action
ConfigureColumn
Caption
AICF
Type
3
Definition
// Permanent Variable - On/Off Switch
if ($P_CC_DISABLE_ALL && $P_CC_DISABLE_ALL != '$P_CC_DISABLE_ALL') {
return 'CC Disabled';
}
/*******************************************************************************
This is a list of patterns to match against. Each line is a single pattern and
should be of the form:
pattern|textColorRRGGBB,backColorRRGGBB|Display Value
The pattern is used in two ways:
1) Passed to ListFolder to check for children matching this pattern.
In this case NoAutoWildcards is enabled to allow for exact matches, so
if you want a wildcard match make sure you include them.
dog = Checks for item named 'dog'.
*dog* = Checks for items whose name contains 'dog'
2) Compared against the name of the row's item using 'LikeI'.
This allows for highlighting the folder itself when $colorSelf is true.
*******************************************************************************/
$patterns = <<<PATTERNS
.git|,F4274D|Git
.hg|,999999|Mercurial
.svn|,97D5AF|Subversion
CVS|,FF0000|Oh Hell...
PATTERNS;
// Color Self: Compares the pattern against the row item when set to true.
$colorSelf = true;
// Clean up the patterns list.
$patterns = FormatList($patterns, 'ted', "<crlf>");
// Loop through patterns - not terribly efficient.
foreach ($line, $patterns, "<crlf>") {
$line = Trim($line, " <tab>");
if ($line == '') { continue; }
// Check this pattern.
$pattern = GetToken($line, 1, '|', 't');
$selfMatches = $colorSelf ? (<cc_name> LikeI "$pattern") : false;
// Skip getting contents where possible.
if (! $selfMatches) {
$count = listfolder(<cc_item>, $pattern, 8+32);
} else {
$count = 0;
}
// If a match...
if ($selfMatches || ($count != '' && $count > 0)) {
// Add Instant Color Filter
$clr = GetToken($line, 2, '|', 't');
$cf = ColorFilter();
ColorFilter($cf . "||" . "+*<cc_item>>$clr");
// Return comment.
$com = GetToken($line, 3, '|', 't', 2);
return $com;
}
}
Format
0
Trigger
0
Item Type
1
Item Filter
This one color the folders automatically as you browse, however as mentioned in the previous point this can impact performance. That said, one advantage to this is it is easier to modify it to handle multiple patterns (hopefully the comments are clear enough), but take care since the more patterns there are the longer it may take. (There is probably room for optimization with this script.)
You also might be tempted to switch this custom column to trigger on List instead of Browse but currently that seems to cause XY to crash.
Personally I'm partial to, and plan on using, the first one since it is a little lighter overall. The lack of full automation isn't ideal but doing a search for all your ".git" folders and displaying the column will tag them all in one go so you only have to worry about new repositories, which you'll likely enter at some point anyhow.

It also has the added bonus that you can then search by the 'git-repo' tag which can be quicker than having XY search the file system.
Hope that helps you out and thank you for asking the original question without which I might not have looked into automating this.
