Added the search_help action.
Zachary Stevens [Tue, 17 Nov 2009 21:27:18 +0000 (21:27 +0000)]
lib/Gitalist/Controller/Root.pm
root/search_help.tt2 [new file with mode: 0644]
t/03legacy_uri.t

index ec839d5..69237a1 100644 (file)
@@ -360,8 +360,8 @@ sub search : Local {
 }
 
 sub search_help : Local {
-    # FIXME - implement search_help
-    Carp::croak "Not implemented.";
+    my ($self, $c) = @_;
+    $c->stash(template => 'search_help.tt2');
 }
 
 sub atom : Local {
diff --git a/root/search_help.tt2 b/root/search_help.tt2
new file mode 100644 (file)
index 0000000..c23a414
--- /dev/null
@@ -0,0 +1,28 @@
+[% PROCESS 'nav/actions.tt2' object = head %]
+
+<p><strong>Pattern</strong> is by default a normal string that is matched precisely (but without
+regard to case, except in the case of pickaxe). However, when you check the <em>re</em> checkbox,
+the pattern entered is recognized as the POSIX extended
+<a href="http://en.wikipedia.org/wiki/Regular_expression">regular expression</a> (also case
+insensitive).</p>
+<dl>
+<dt><b>commit</b></dt>
+<dd>The commit messages and authorship information will be scanned for the given pattern.</dd>
+
+<dt><b>grep</b></dt>
+<dd>All files in the currently selected tree (HEAD unless you are explicitly browsing
+    a different one) are searched for the given pattern. On large trees, this search can take
+a while and put some strain on the server, so please use it with some consideration. Note that
+due to git-grep peculiarity, currently if regexp mode is turned off, the matches are
+case-sensitive.</dd>
+<dt><b>author</b></dt>
+<dd>Name and e-mail of the change author and date of birth of the patch will be scanned for the given pattern.</dd>
+<dt><b>committer</b></dt>
+<dd>Name and e-mail of the committer and date of commit will be scanned for the given pattern.</dd>
+<dt><b>pickaxe</b></dt>
+<dd>All commits that caused the string to appear or disappear from any file (changes that
+added, removed or "modified" the string) will be listed. This search can take a while and
+takes a lot of strain on the server, so please use it wisely. Note that since you may be
+interested even in changes just changing the case as well, this search is case sensitive.</dd>
+</dl>
+
index 11c2b84..c0a25cc 100644 (file)
@@ -164,10 +164,7 @@ TODO: {
     test('/', 'a=patches;h=refs/heads/master');
 }
 
-TODO: {
-    local $TODO = "Action: search_help is not yet implemented.";
-    test('/', 'a=search_help');
-}
+test('/', 'a=search_help');
 
 test('/', 'a=shortlog');
 test('/', 'a=shortlog;h=36c6c6708b8360d7023e8a1649c45bcf9b3bd818');