News for hackers. Stuff that matters.
Re:I’ve banned query strings by mikeocool on Saturday May 09, 2026 @05:25PM (#48078409)
I dunno, it seems like the fact that we arrived at a fairly standard structure for URL paths that works pretty well is not a bad outcome.

Seems a lot better than the other potential world we could lived in, where paths were a black box and every web server/framework invented their own structure for them.

Re:I’ve banned query strings by gritzko on Saturday May 09, 2026 @06:30PM (#48078903)
In my current project I use URIs to refer to absolutely any entity in a git(-ish) repo. Files, branches, revisions, diffs, anything. URI turns out to be a really good addressing scheme for everything. Surprise. But the most used and abused element is always the path. Query takes a lot of that mess away. Might have been unmanageable otherwise.

https://github.com/gritzko/beagle

Re:I’ve banned query strings by gritzko on Saturday May 09, 2026 @06:40PM (#48078963)
In fact, GitHub URIs are a good example of overusing paths: https://github.com/gritzko/beagle/blob/a7e17290a39250092055f...

  - user gritzko,
  - project beagle, 
  - view blob, 
  - commit a7e17290a39250092055fcda5ae7015868dabdb4, 
  - file path VERBS.md
... all concatenated indiscriminately.
Re:I’ve banned query strings by altairprime on Saturday May 09, 2026 @08:14PM (#48079651)
[delayed]
Re:I’ve banned query strings by em-bee on Saturday May 09, 2026 @09:35PM (#48080136)
actually, instead of the object hash, you could also use the commit-hash. then the filename would be mandatory, but the url would be more readable and usable: give me the file VERBS.md as it is at commit <hash>
Re:I’ve banned query strings by masklinn on Sunday May 10, 2026 @02:31AM (#48081511)
That's actually what it is here, a7e17290a39250092055fcda5ae7015868dabdb4 is a commit's oid: https://github.com/gritzko/beagle/commit/a7e17290a3925009205...
Re:I’ve banned query strings by em-bee on Sunday May 10, 2026 @12:03PM (#48085060)
yes, you are right. and it makes a lot more sense that way. see my other comment on the difference between commit blob and raw.
Re:I’ve banned query strings by deepsun on Saturday May 09, 2026 @11:01PM (#48080582)
But the path misses param names (or types?). E.g who said the hex-encoded part is a commit hash? Maybe it's a tree hash, or just weird ref.

Query strings are more verbose as force to give each param a name.

Re:I’ve banned query strings by altairprime on Saturday May 09, 2026 @11:39PM (#48080789)
Which target audience of github needs extra verbosity in the commit hash, though? Once you know it you know it; if you don’t know git you aren’t the target audience; etc. Saying /user=foo is no better than ?user=foo if your audience can work it out without confusion from your unadorned paths. We have a great deal of history with filesystems showing that people are capable of keeping up with paths that lack key names if exposed to and familiar with them, and if the filesystem isn’t being constantly randomized.
Re:I’ve banned query strings by deepsun on Monday May 11, 2026 @01:31PM (#48097974)
> Saying /user=foo is no better than ?user=foo

I mean /foo vs ?user=foo

I know git enough, there's more than one type of hashes -- object hashes, tree hashes.

Re:I’ve banned query strings by em-bee on Saturday May 09, 2026 @06:56PM (#48079082)
what would be a better way of doing that? i am not disagreeing, but i just can't think of any way to improve on this. put everything into the query part? i prefer to use the query only for optional arguments. in this example the blob argument is the only thing that doesn't fit in my opinion.
Re:I’ve banned query strings by arjvik on Saturday May 09, 2026 @07:38PM (#48079409)
Every object in git (commit, tree, revision of a single file) has a hash that is guaranteed unique within a repository (otherwise many more things than a web UI would break) and likely also globally. I can understand wanting to isolate repositories to prevent hash collisions from causing problems, but within a repo everything has a universally unique ID.

edit: for instance, that specific VERBS.md is represented by the blob 3b9a46854589abb305ea33360f6f6d8634649108.

Re:I’ve banned query strings by em-bee on Saturday May 09, 2026 @09:26PM (#48080069)
that's not what i meant. i was trying to suggest that the string "blob" does not fit. why is it there? why is it needed?

    https://github.com/gritzko/beagle/a7e17290a39250092055fcda5ae7015868dabdb4/VERBS.md
this should be sufficient to represent the file.

"blob" is like a descriptor of the value that follows. it would be like doing this:

    https://github.com/user/gritzko/project/beagle/blob/a7e17290a39250092055fcda5ae7015868dabdb4/file/VERBS.md
this actually irks me every time i see it in a github url
Re:I’ve banned query strings by sowbug on Saturday May 09, 2026 @10:04PM (#48080311)
They are following the /key/value/key/value pattern, but the first two pairs in a GitHub URL are fixed to user and project, which lets them omit the key names. I could see them not being willing to hardcode the third pair to blob.

Back when GitHub URLs were kind of cool, github.com/user/gritzko/project/beagle would have been much less cool than just github.com/gritzko/beagle.

Re:I’ve banned query strings by masklinn on Sunday May 10, 2026 @02:37AM (#48081541)
> They are following the /key/value/key/value pattern

They are not. There's just a routing layer below the repository.

Re:I’ve banned query strings by masklinn on Sunday May 10, 2026 @02:36AM (#48081539)
> this should be sufficient to represent the file.

Except it's not, because the oid can be a short hash (https://github.com/gritzko/beagle/blob/a7e172/VERBS.md) and that means you're at risk of colliding with every other top-level entry in the repository, so you're restricting the naming of those toplevel entries, for no reason.

So namespacing git object lookups is perfectly sensible, and doing so with the type you're looking for (rather than e.g. `git` to indicate traversal of the git db) probably simplifies routing, and to the extent that it is any use makes the destination clearer for people reading the link.

Re:I’ve banned query strings by em-bee on Sunday May 10, 2026 @12:01PM (#48085039)
how does adding the word blob in the url help with that?

i don't think it makes a difference here.

in fact compare these urls:

https://github.com/gritzko/beagle/blob/a7e172/VERBS.md

https://github.com/gritzko/beagle/raw/a7e172/VERBS.md

https://github.com/gritzko/beagle/commit/a7e172/VERBS.md

turns out that "blob", "raw" and "commit" have nothing to do with the hash itself, but are functions to describe how the object in question is to be presented. so what i said above about blob being redundant is false, the problem is rather that it is in a weird place. it should be at the end, like a kind of extension because it signifies the format of the output. except i think putting it at the end makes handling relative paths more difficult as it would have to be appended to every link to other files.

the roxen webserver has an interesting solution for that. they call it prestates and it's placed at the beginning of a url: https://github.com/(commit)/gritzko/beagle/a7e172/VERBS.md . it sets the format value visually apart, and you could have multiple prestate values separated by a comma. i have used that feature extensively on my own sites. i even expanded on the concept in custom modules.

Re:I’ve banned query strings by masklinn on Sunday May 10, 2026 @12:56PM (#48085592)
> how does adding the word blob in the url help with that? i don't think it makes a difference here.

How does adding a disambiguating segment help disambiguate?

"in fact, consider these urls":

https://github.com/gritzko/beagle/issues

https://github.com/gritzko/beagle/pulse

> are functions to describe how the object in question is to be presented

So they are functions, which take parameters, which makes prefix notation reasonably natural?

> the problem is rather that it is in a weird place. it should be at the end

That's, like, your opinion man.

> except i think putting it at the end makes handling relative paths more difficult as it would have to be appended to every link to other files.

It also doesn't make sense when file paths may not be relevant at all e.g. compare

https://github.com/gritzko/beagle/commit/a7e172

and

https://github.com/gritzko/beagle/commit/a7e172/VERBS.md

As well as where https://github.com/gritzko/beagle/blob/a7e172/ ends up

> the roxen webserver has an interesting solution for that. they call it prestates and it's placed at the beginning of a url: https://github.com/(commit)/gritzko/beagle/a7e172/VERBS.md .

> When developing and debugging is a great help to be able to turn on and off specific parts of the code that generates the current page.

That doesn't have anything to do with what github does.

Re:I’ve banned query strings by iainmerrick on Saturday May 09, 2026 @07:00PM (#48079112)
Back in the day there was an attempt to introduce "matrix URIs" as a more structured alternative to query strings: https://www.w3.org/DesignIssues/MatrixURIs.html

Of course there's nothing to stop you using URIs like this (I think Angular does, or did at one point?) but I don't think the rules for relative matrix URIs were ever figured out and standardised, so browsers don't do anything useful with them.

Re:I’ve banned query strings by hamburglar on Saturday May 09, 2026 @05:55PM (#48078643)
My next website is going to have the path portion of the URL be a base64 encoded ASN.1 blob.
Re:I’ve banned query strings by chrismorgan on Saturday May 09, 2026 @10:49PM (#48080518)
So long as it starts with a slash, go ahead! See how long it takes for someone to figure it out.

It’s your website. Have fun with it! Do dumb things! :-)

Re:I’ve banned query strings by rkeene2 on Saturday May 09, 2026 @11:41PM (#48080797)
Make sure you use URL-safe base64 or the portions that looks like a path can get mangled

MII//epi

Is converted to MII/epi

Re:I’ve banned query strings by yencabulator on Sunday May 10, 2026 @08:00PM (#48089438)
That would be broken software.

https://en.wikipedia.org/wiki///