git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Lost in Space
@ 2010-08-07 21:47 Erick Mattos
  2010-08-07 21:56 ` [PATCH v3] gitweb: clarify search results page when no matching commit found Jonathan Nieder
  2010-08-17 22:42 ` Lost in Space Erick Mattos
  0 siblings, 2 replies; 3+ messages in thread
From: Erick Mattos @ 2010-08-07 21:47 UTC (permalink / raw)
  To: git

What's up to:

http://thread.gmane.org/gmane.comp.version-control.git/151402/focus=151414
http://thread.gmane.org/gmane.comp.version-control.git/151440/

R9 knows?  :-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v3] gitweb: clarify search results page when no matching commit found
  2010-08-07 21:47 Lost in Space Erick Mattos
@ 2010-08-07 21:56 ` Jonathan Nieder
  2010-08-17 22:42 ` Lost in Space Erick Mattos
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Nieder @ 2010-08-07 21:56 UTC (permalink / raw)
  To: Erick Mattos
  Cc: git, Jakub Narebski, Pavan Kumar Sunkara, Petr Baudis,
	John 'Warthog9' Hawley, Junio C Hamano

When searching commits for a string that never occurs, the results
page looks something like this:

	projects / foo.git / search                                 \o/
	summary | ... | tree          [commit] search: [ kfjdkas ] [ ]re
	first ⋅ prev ⋅ next

	Merge branch 'maint'

	Foo: a demonstration project

Without a list of hits to compare it to, the header describing the
commit named by the hash parameter (usually HEAD) may itself look
like a hit.  Add some text (“No match.”) to replace the empty
list of hits and avoid this confusion.

While at it, remove some nearby dead code, left behind from a
simplification a few years ago (v1.5.4-rc0~276^2~4, 2007-11-01).

Noticed-by: Erick Mattos <erick.mattos@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
---
changes relative to v2[1]:
 - better newline placement in the produced HTML.

Erick Mattos wrote:

> What's up to:
> 
> http://thread.gmane.org/gmane.comp.version-control.git/151402/focus=151414

Hopefully third time’s the charm.  Test reports welcome as always.

 gitweb/gitweb.perl |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 8b02767..4efeebc 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -6521,12 +6521,13 @@ sub git_search {
 			$paging_nav .= " &sdot; next";
 		}
 
-		if ($#commitlist >= 100) {
-		}
-
 		git_print_page_nav('','', $hash,$co{'tree'},$hash, $paging_nav);
 		git_print_header_div('commit', esc_html($co{'title'}), $hash);
-		git_search_grep_body(\@commitlist, 0, 99, $next_link);
+		if ($page == 0 && !@commitlist) {
+			print "<p>No match.</p>\n";
+		} else {
+			git_search_grep_body(\@commitlist, 0, 99, $next_link);
+		}
 	}
 
 	if ($searchtype eq 'pickaxe') {
-- 
1.7.2.1.544.ga752d.dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Lost in Space
  2010-08-07 21:47 Lost in Space Erick Mattos
  2010-08-07 21:56 ` [PATCH v3] gitweb: clarify search results page when no matching commit found Jonathan Nieder
@ 2010-08-17 22:42 ` Erick Mattos
  1 sibling, 0 replies; 3+ messages in thread
From: Erick Mattos @ 2010-08-17 22:42 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: git, Jakub Narebski, Pavan Kumar Sunkara, Petr Baudis,
	John 'Warthog9' Hawley, Junio C Hamano

Hi,

2010/8/7 Jonathan Nieder <jrnieder@gmail.com>
>
> When searching commits for a string that never occurs, the results
> page looks something like this:
>
>        projects / foo.git / search                                 \o/
>        summary | ... | tree          [commit] search: [ kfjdkas ] [ ]re
>        first ⋅ prev ⋅ next
>
>        Merge branch 'maint'
>
>        Foo: a demonstration project
>
> Without a list of hits to compare it to, the header describing the
> commit named by the hash parameter (usually HEAD) may itself look
> like a hit.  Add some text (“No match.”) to replace the empty
> list of hits and avoid this confusion.
>
> While at it, remove some nearby dead code, left behind from a
> simplification a few years ago (v1.5.4-rc0~276^2~4, 2007-11-01).
>
> Noticed-by: Erick Mattos <erick.mattos@gmail.com>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> Acked-by: Jakub Narebski <jnareb@gmail.com>
> ---
> changes relative to v2[1]:
>  - better newline placement in the produced HTML.
>
> Erick Mattos wrote:
>
> > What's up to:
> >
> > http://thread.gmane.org/gmane.comp.version-control.git/151402/focus=151414
>
> Hopefully third time’s the charm.  Test reports welcome as always.

Nice to see this one in not ignored anymore!

But what about http://thread.gmane.org/gmane.comp.version-control.git/151440/
 ?!?

I am personally not bothered by being ignored but ignoring the fact
that without this little patch there is a test which is testing
nothing and a necessary check which is not being tested is certainly
not good at all.

Two lines can not be so hard to be accepted without a huge hammer and
so much unpleasant yelling!

Please let's close this issue.

Regards to all

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-17 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-07 21:47 Lost in Space Erick Mattos
2010-08-07 21:56 ` [PATCH v3] gitweb: clarify search results page when no matching commit found Jonathan Nieder
2010-08-17 22:42 ` Lost in Space Erick Mattos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).