git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Jakub Narębski" <jnareb@gmail.com>
To: CLOSE Dave <Dave.Close@us.thalesgroup.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Complex gitweb URL
Date: Wed, 20 Jul 2016 23:50:31 +0200	[thread overview]
Message-ID: <CANQwDwe4OvNx+3uOG6Qbzj1CKK+N-pvTyk_j2WxDs-R2LPv3YQ@mail.gmail.com> (raw)
In-Reply-To: <42f9c384-489d-3fce-2b27-8884e683a3d5@us.thalesgroup.com>

On 20 July 2016 at 23:35, CLOSE Dave <Dave.Close@us.thalesgroup.com> wrote:
> Thanks, Jakub, for the quick response.
>
> On 07/20/16 02:20 PM, Jakub Narębski wrote:
>
>>> If I replace the hb=SHA argument with hb=HEAD, the URL still works. But
>>> I have no idea what I can use to replace the h=SHA argument.
>>
>> You can remove it.  'hb' (hash_base) and 'f' (filename) identify target
>> file in a repository unambiguously.
>
> If I do, leaving everything else present, I get "404 cannot find file".

Which gitweb version are you using? For 'a=blob' (i.e. displaying
contents of the file), if 'h' (hash) parameter is not set, then gitweb
finds it by using `git ls-tree <hash_base> -- <filename>` in
git_get_hash_by_path() subroutine. No 'hb' is equivalent to 'hb=HEAD'

What does `git ls-tree <hash_base> -- <filename>` results in your
repository?

>>> A complication is that the target file is not in the master branch.
>>> Somehow I need to be able to specify the branch. I've tried putting it
>>> as the h= argument but that results in "Reading blob failed". If I leave
>>> out the h= argument entirely, gitweb responds, "404 cannot find file".
>>
>> Did you forgot to set 'hb' parameter?  Is said file present in revision
>> given by the 'hb' parameter?
>
> The file is present in both master and develop branches. If I include
> hb=HEAD and leave out h=, gitweb doesn't find either of them.

It works for repo.or.cz (which uses gitweb as web interface). So we
have WORKSFORME situation. Now we need to find out what is
different in your case...

>                                                                                            Using
> hb=HEAD and h=develop or h=master results in "Reading blob failed".

'h' must be hash of the blob as an abject (of its contents at given revision).

-- 
Jakub Narebski

  reply	other threads:[~2016-07-20 21:51 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 [this message]
2016-07-20 21:46   ` CLOSE Dave
2016-07-23 17:47 ` Jakub Narębski
2016-07-25 16:34   ` 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

  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=CANQwDwe4OvNx+3uOG6Qbzj1CKK+N-pvTyk_j2WxDs-R2LPv3YQ@mail.gmail.com \
    --to=jnareb@gmail.com \
    --cc=Dave.Close@us.thalesgroup.com \
    --cc=git@vger.kernel.org \
    /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).