git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] gitweb: Fix file links in "grep" search

From
Thomas Perl <th.perl@gmail.com>
Date
Jan 13, 2012, 14:09 UTC
Message-ID
<CA+uOhx7QwRQJzyYBCkmVDBRCMt0i_ZqS=sfTG0VmNiVv2dVoww@mail.gmail.com>
In-Reply-To
<201201052126.49087.jnareb@gmail.com>
Hi,
2012/1/5 Jakub Narebski <jnareb@gmail.com>:
Show 10 quoted lines
> There were two bugs in generating file links (links to "blob" view),
> one hidden by the other.  The correct way of generating file link is
>
>        href(action=>"blob", hash_base=>$co{'id'},
>             file_name=>$file);
>
> It was $co{'hash'} (this key does not exist, and therefore this is
> undef), and 'hash' instead of 'hash_base'.
> [...]
> Thomas, could you check if this fixes your issue?

Sorry for taking a bit longer to respond on this one, but I just got around to test all problematic cases that I described with the patch applied - it fixes the problem for me (i.e. I can successfully grep in non-master branches and then clicking the link brings me to the right location).

As far as I'm concerned, the patch can be applied and fixes the bug.

Thanks for the quick fix! :) Thomas

Previous: Jakub NarebskiNext: Junio C Hamano
Message 6 of 7 in “[BUG] gitweb generates wrong links in grep search results (git_search_files)”
  1. Thomas PerlJan 2, 2012
  2. Junio C HamanoJan 4, 2012
  3. Jakub NarębskiJan 4, 2012
  4. 1/2 gitweb: Fix file links in "grep" searchJakub Narebski, Jan 5, 2012
  5. 2/2 gitweb: Harden "grep" search against filenames with ':'Jakub Narebski, Jan 5, 2012
  6. Thomas PerlJan 13, 2012
  7. Junio C HamanoJan 13, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.