Display of directories that contain only one subdirectory

John Keeping john at keeping.me.uk
Sun Aug 7 17:09:43 CEST 2016


On Wed, Jul 13, 2016 at 06:43:06PM -0400, Jamie Couture wrote:
> So what I was initially wasting my time worrying about was an insane situation 
> where there are many empty directories with only one file at the end of the 
> tunnel.
> 
> mkdir -p why/would/anyone/do/this/what/possible/reason/would/justify/such/a/deep/structure/with/nothing/of/value/come/on
> touch why/would/anyone/do/this/what/possible/reason/would/justify/such/a/deep/structure/with/nothing/of/value/come/on/hi.txt
> 
> Where we might end up with something that does not word wrap, but our css does 
> take care of it: so moot point.  The other consideration I was worrying about 
> was skipping all the in-between folders since there's nothing of value, 
> display some ellipsis:
> 
> some / path / ... / end 
> 
> I'm not sure if there's much value in truncating that scenario.

(I finally have some time to look at this again.)

I don't think it's worth the extra complexity to handle putting in
ellipses for this case.  I tried a long path with a very narrow browser
window and it wraps sensibly, which I think is acceptable.

Note that the patch here won't display the file at the end of your
second example above - it explicitly checks for directories, which is a
conscious choice so that we don't have to go back and correct the mode
bits in the first column.


More information about the CGit mailing list