git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jason Yundt <jason@jasonyundt.email>
Cc: git@vger.kernel.org,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Bagas Sanjaya" <bagasdotme@gmail.com>
Subject: Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE
Date: Thu, 02 Jun 2022 11:50:55 -0700	[thread overview]
Message-ID: <xmqqv8tinblc.fsf@gitster.g> (raw)
In-Reply-To: <20220602114305.5915-1-jason@jasonyundt.email> (Jason Yundt's message of "Thu, 2 Jun 2022 07:43:05 -0400")

Jason Yundt <jason@jasonyundt.email> writes:

> Subject: Re: [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE
>
> According to the HTML Standard FAQ:
>
> 	“What is the DOCTYPE for modern HTML documents?
> ...
> Compared to the first version of this patch, this version:
> 1. makes it clear that XML parsers may used the linked DTD like brian
>    mentioned.
> 2. mentions HTML5 like Bagas suggested.

So, is it XHTML5, or HTML5, we want to see on the title?

> +proper_doctype() {
> +	gitweb_run "$@" &&
> +	grep -F "<!DOCTYPE html [" gitweb.body &&
> +	grep "<!ENTITY nbsp" gitweb.body &&
> +	grep "<!ENTITY sdot" gitweb.body
> +}

Hmph, this test does not care what other cruft appears in the file,
does not care in what order the three lines that match the patterns
appear, and the second and third patterns are even allowed to match
the same line.  I think that is OK (we do not even mind if the two
ENTITY definitions get squashed on the same line).

> +test_expect_success 'Proper DOCTYPE with entity declarations' '
> +	proper_doctype &&
> +	proper_doctype "p=.git" &&
> +	proper_doctype "p=.git;a=log" &&
> +	proper_doctype "p=.git;a=tree"
> +'

As far as I can tell, git_header_html() is the only helper that
deals with DOCTYPE, and responses to any request must call
git_header_html() to produce the header (or the handler for a
particular request type is buggy), but I do not think it is part of
this topic's job to ensure that all request handlers call the
git_header_html().  So we _could_ do with just a single test without
trying different request types if we wanted to, as long as there are
existing tests that make sure everybody uses git_header_html().

Was there a particular reason why these four requests were chosen?
Do they have different entry points and show the doctype from
different codepath?

Thanks.

  reply	other threads:[~2022-06-02 18:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01  1:26 [PATCH] gitweb: switch to a modern DOCTYPE Jason Yundt
2022-06-02  0:41 ` brian m. carlson
2022-06-02  6:10   ` Junio C Hamano
2022-06-02  7:26 ` Bagas Sanjaya
2022-06-02 11:43 ` [PATCH v2] gitweb: switch to an XHTML5 DOCTYPE Jason Yundt
2022-06-02 18:50   ` Junio C Hamano [this message]
2022-06-02 19:51     ` Jason Yundt
2022-06-02 21:47     ` brian m. carlson
2022-06-02 22:09       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqv8tinblc.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jason@jasonyundt.email \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).