https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93185

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Frédéric Buclin from comment #8)
> (In reply to Jakub Jelinek from comment #7)
> > r([0-9]{1,6}) to http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=\1
> > (what we have already, should be https? and perhaps we'll switch to some
> > redirector instead, so maybe https://gcc.gnu.org/r\1 instead?)
> 
> I have updated Bugzilla to point to https instead of http.

Thanks.

> Which URL do you
> prefer: the current link to viewcvs/gcc?view=revision&revision=\1 or the
> link to the redirector https://gcc.gnu.org/r\1 ? The advantage of the link
> to viewcvs is that you have one less redirection.

I agree, so let's change it when we decide what to do with SVN revisions.
The viewcvs will work for now.

> > pr([0-9]{1,6}) etc. to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=\1 (also
> > implemented, similar PR [a-z-]+/([0-9]{1,6}) )
> 
> What's the point of [a-z]+/ in front of the bug ID if this part is useless
> to identify the bug report? I haven't implemented that part till I
> understand what this part is used for.

This was just trying to document what clearly is already implemented, e.g. for
PR tree-optimization/90838 bugzilla already creates URL to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90838
There is no need to change anything.

> > (r[0-9]{1,2}-[0-9]{1,6}) to https://gcc.gnu.org/\1 (redirector to be
> > implemented)
> 
> Waiting for the redirector to be implemented. Could meanwhile someone paste
> a valid example here so that I can use it for testing?

In https://gcc.gnu.org/ml/gcc/2020-01/msg00160.html I have posted a tentative
patch for the redirects, but as I said there, the gcc-gitref.cgi is not
implemented yet, hope it can be done say on Monday.
The aim is that e.g. 42950b74c9b103676f99dc9f1a27859e3f7be436 hash (but in the
testing reposurgeon repository, can't have something final because the current
conversion hasn't been finished yet) can be also written as
r10-5824
r10-5824-g42950b74c9b
r10-5824-g42950b74c9b103676f99dc9f1a27859e3f7be436
and all of those would in the end redirect to the same
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=42950b74c9b103676f99dc9f1a27859e3f7be436
(note, as this hash is from test repo, it won't really work as is).
But, while r10-5824-g42950b74c9b could be mapped directly to
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=42950b74c9b
and the last one to
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=42950b74c9b103676f99dc9f1a27859e3f7be436
by bugzilla, the first one can't, as it needs to run a few shell commands to
determine the hash, so I'd like to r10-5824 to point to e.g.
https://gcc.gnu.org/cgi-bin/gcc-gitref.cgi?r=r10-5824
and let the cgi script perform redirection.
r10-5824 stands for 5824's commit after the first one on trunk after branching
gcc 9, r10-0 stands for the first commit on trunk after branching gcc 9,
its parent commit is r9-7160 (in the test repo) and r9-7161 is the first gcc 9
branch commit after branching gcc 9.

> > g:([0-9a-zA-Z_-]+) to https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=\1
> 
> Done, but I have restricted the regexp to ([0-9a-f]{7,40}) as the hash is in
> hexadecimal form, so we don't need (nor want) g-z A-Z _ and -.

In https://gcc.gnu.org/ml/gcc-patches/2019-08/msg01015.html Jason was
suggesting that g: could take not just the hashes, but other ways git can use
to describe the commit, so e.g. some tag name, or commit_hash~1, commit_hash^^
etc.
For the redirects, I have tentatively used g:[0-9a-zA-Z._{}~^-]+ , but maybe
/ and @ should be accepted there too.
https://git-scm.com/docs/gitrevisions says also HEAD@{5 minutes ago} , but
guess
we do not want to allow spaces in there in bugzilla and after all, stuff like
g:master@{yesterday} is really meaningless in bugzilla comments.
But sure, accepting hashes is the most common need, thinking about it even
g:master isn't very useful because it is a moving target.  CCing Jason on this.
Perhaps those make only sense for the redirects and not the bugzilla comments.

> > r[0-9]{1,2}-[0-9]{1,6}-g([0-9a-f]{7,40}) to
> > https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=\1
> > ?
> 
> Could someone paste a valid example here so that I can test it too?

See above, that is the:
r10-5824-g42950b74c9b
r10-5824-g42950b74c9b103676f99dc9f1a27859e3f7be436

Reply via email to