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

Re: [PATCH] gitweb: Try harder in parse_tag; perhaps it was given ambiguous name

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 5, 2007, 10:13 UTC
Message-ID
<200712051113.40654.jnareb@gmail.com>
In-Reply-To
<7v3auh1v75.fsf@gitster.siamese.dyndns.org>
On Wed, 5 Dec 2007, Junio C Hamano wrote:
> I have these two patches still in my mailbox, unapplied:
> 
> [PATCH] gitweb: disambiguate heads and tags withs the same name
> [PATCH] gitweb: Try harder in parse_tag; perhaps it was given ambiguous name

Actually second should be [PATCH/RFC] as it penalizes the "not found" case (extra check 'if really not found').

First patch, which is modified version of Guillaume Seguin patch solves problem that links in gitweb does lead to correct 'tag' view, while the second one solves the problem from the other side: instead of ensuring that links in gitweb are unambiguous it tries to resolve ambiguity.

The problem is caused by the fact that git _always_ prefer heads (head
refs) to tags (tag refs), even when it is clear
  $ git cat-file tags ambiguous-ref
that we want a tag. So alternate solution would be to correct
git-cat-file.
 
Show 7 quoted lines
> I am wondering if they should be part of 1.5.4.  They look Ok but it is
> not very easy to pick up what the real breakage it is trying to fix from
> Perl gibberish.
> 
> Can we have tests (not just "we do not spit out anything to stderr") for
> gitweb so that each patch can demonstrate the existing breakage, to make
> judging easier?

True, current way of testing gitweb does not allow for test which would detect breakage noticed by Guillaume.

It would be quite easy I think to add checking if gitweb returns expected HTTP return code (HTTP status). So what is the portable way to check if first line of some output matches given regexp (given fixed string)?

-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 8 in “gitweb: disambiguate heads and tags withs the same name”
  1. gitweb: disambiguate heads and tags withs the same nameJakub Narebski, Dec 1, 2007
  2. gitweb: Try harder in parse_tag; perhaps it was given ambiguous nameJakub Narebski, Dec 1, 2007
  3. Jakub NarebskiDec 1, 2007
  4. Junio C HamanoDec 5, 2007
  5. Jakub NarebskiDec 5, 2007
  6. Junio C HamanoDec 5, 2007
  7. Jakub NarebskiDec 5, 2007
  8. Junio C HamanoDec 5, 2007

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.