In the tree view for git.sr.ht, it lists out permissions for each file
in the style of "-rw-r--r--", for example on this page:
https://git.sr.ht/~sircmpwn/git.sr.ht/tree
On a narrow screen, this can consume up to a third of the width of the
page, leading to a comical situation where only five characters of the
filename are visible and the rest is truncated:
https://p.hagelb.org/git-permissions-lol.png
But it's more than just a design gaffe; it's actually misleading
data. In reality, git does not track file permissions at all beyond a
single executable bit, so claiming that a file in git has permissions
of "-rw-r--r--" is misleading and/or incorrect:
https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/ContentLimitations.html
This display should be changed so it focuses on relevant information.
-Phil
I am aware of the limitations of git and we chose to display it in the
familiar Unix style regardless; these modes match the modes you will get
should you clone the repository regardless.
Hi Drew,
On Tue, Mar 14, 2023 at 09:43:23AM +0100, Drew DeVault wrote:
> I am aware of the limitations of git and we chose to display it in the> familiar Unix style regardless; these modes match the modes you will get> should you clone the repository regardless.
Is that actually true though? The permissions you end up with certainly
depend on the umask which is local policy so this really is just
a misleading waste of space.
Setting the umask to `077` for example will result in -rw------ :)
--Daniel
> Is that actually true though? The permissions you end up with certainly> depend on the umask which is local policy so this really is just> a misleading waste of space.
If you set the umask sure, but by default yes the permissions you get
will be the ones viewed on the page. I guarantee you 90% of users won't
even touch umasks or have a need to.
Why not go for drwx? Seems familiar enough, makes clear distinction
between [d]irectory and e[x]ecutable and takes up less space.
Other option, don't show the "file permissions" column when screen is
not wide enough using a css media selector. The information is still
available on the file detail page.
Drew DeVault <sir@cmpwn.com> writes:
> I am aware of the limitations of git and we chose to display it in the> familiar Unix style regardless; these modes match the modes you will get> should you clone the repository regardless.
OK, fair enough, it's your site.
But for clarification, are you saying it's intentional (or acceptable)
that the one single bit of permissions data is displayed using 9 columns
and the whole filename only gets 5?
>> https://p.hagelb.org/git-permissions-lol.png
-Phil
On 23/03/14 01:59PM, Remco van 't Veer wrote:
> Other option, don't show the "file permissions" column when screen is> not wide enough using a css media selector. The information is still> available on the file detail page.
There are at least two more options when it comes to displaying the tree view
on small browser widths (mobile):
- Scroll the table/table wrapper (I am doing that for tables, pre figures... on
my website[1])
- Break the table into block-like display using CSS, so long fields like
permissions take up the whole line, filename takes the next whole line, etc.
[1]: https://git.sr.ht/~strahinja/strahinja-org-slw/tree/master/item/css/style.css#L80