git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Jakub Narębski" <jnareb@gmail.com>
Cc: CLOSE Dave <Dave.Close@us.thalesgroup.com>,
	"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Complex gitweb URL
Date: Mon, 25 Jul 2016 09:34:37 -0700	[thread overview]
Message-ID: <xmqqoa5l7k2q.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <5793ADAC.6030009@gmail.com> ("Jakub Narębski"'s message of "Sat, 23 Jul 2016 19:47:24 +0200")

Jakub Narębski <jnareb@gmail.com> writes:

> Subject: [PATCH] gitweb(1): Document query parameters
>
> The gitweb manpage includes description of gitweb URL structure,
> but it was limited to passing parameters in the path part of URL
> ('path info'), and it didn't include explanation of query parameters.
> ---

I think this weather-balloon patch adds the missing info at the most
natural place in the flow of the document.  An earlier part talks
about a GitWeb URL having <repo>, <action>, <revision>, <path> and
followed by what is called <arguments> after a question mark '?',
but what <arguments> part means and how to formulate it are left
unsaid.

By the way, the title of the section 'Actions, and URLs' needs to
lose the comma, I would think.

>  Documentation/gitweb.txt | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
>
> diff --git a/Documentation/gitweb.txt b/Documentation/gitweb.txt
> index 96156e5..301003f 100644
> --- a/Documentation/gitweb.txt
> +++ b/Documentation/gitweb.txt
> @@ -395,6 +395,43 @@ atom::
>  	Generates an RSS (or Atom) feed of changes to repository.
>  
>  
> +Query parameters:
> +~~~~~~~~~~~~~~~~~
> +In some cases gitweb cannot pass a parameter in path part of URL, for
> +example if a filename contains double dots ('..') inside.  All parameters
> +that cannot be passed in that way are put as a query parameter, that is
> +after '?'.

Until this point, the reader hasn't even been told about "filename"
is one of the potential things that can be given to "control the
behaviour of the action", and is left wondering if she has a
filename that does not have double-dots, how it can be passed "in
path part of URL" after reading the first sentence.  Then the second
sentence adds more to the mystery by starting with "All parameters
that cannot be passed" "in that way": what are the possible things
that the users may want to pass?  what exactly is "in that way",
which probably means "encoded as part of the <path>", but it is
unclear how that encoding works (is it just to "concatenate"?).

Or is "filename in the revision" the ONLY thing the above paragraph
talks about, and is the ONLY purpose of the "<path> part" to
represent that "filename in the revision" in the URL?

    .../gitweb.cgi/<repo>/<action>/<revision>:/<path>?<arguments>

The above syntax (taken from the first paragraph of the section)
suggests that <path> cannot be used to hold filename with a colon,
too.  Perhaps "for example if a filename contains double-dots" needs
to become an exhaustive description somewhere, i.e. "(see below for
the exact rules)" added to that sentence?

> +By default gitweb would generate links using query parameters, unless
> +the original URL was using path part, or gitweb was configured to use
> +pathinfo with the 'pathinfo' feature. All gitweb installations recognize
> +URL in either format, so you can use one that is better for you when
> +interacting with gitweb (handcrafting or editing URLs, or creating
> +a program interacting with gitweb installation).
> +
> +Here is the list of some of query parameters, together with their
> +long names (which should help remembering the short name of
> +each parameter):
> +
> +'a' (action)::
> +	The action that will be run.
> +
> +'p' (project)::
> +	The project repository that will be displayed.
> +
> +'h' (hash)::
> +	The object id of displayed object (commit, tag, tree, blob).
> +	In case of files 'hb' (hash_base) and 'f' (filename) might be
> +	used instead.
> +
> +'hp' (hash_parent)::
> +'fp' (file_parent)::
> +'hpb' (hash_parent_base)::
> +      Those parameters define the second object for diff-like actions,
> +      the object gitweb is comparing againts.

There is no mention of "filename" or "path" here, which further
confuses a reader who was told in the first paragraph that these
query-parameters are used when <path> part cannot hold a certain
filename.  Also it is unclear if <revision> corresponds to 'h'ash
in the above.

> +
> +
> +
>  WEBSERVER CONFIGURATION
>  -----------------------
>  This section explains how to configure some common webservers to run gitweb. In

      reply	other threads:[~2016-07-25 16:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 19:24 Complex gitweb URL CLOSE Dave
2016-07-20 21:20 ` Jakub Narębski
2016-07-20 21:35   ` CLOSE Dave
2016-07-20 21:50     ` Jakub Narębski
2016-07-20 21:46   ` CLOSE Dave
2016-07-23 17:47 ` Jakub Narębski
2016-07-25 16:34   ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqoa5l7k2q.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Dave.Close@us.thalesgroup.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).