[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

truncated author names in 'svn ls -v' output

From: Stefan Sperling <stsp_at_elego.de>
Date: Fri, 23 Nov 2018 09:10:50 +0100

I would like make a change, but it is a highly bikesheddy one so
I'd rather ask the list first to give everyone a chance to suggest
their favourite colours.

The length of author names in 'svn ls -v' output is currently truncated
at 8 columns. Things have been this way since the dawn of time:
https://svn.apache.org/r842817

Note that this limit is actually rather short and causes truncation
of names even in our own project (hey, Julian!):

$ svn ls -v
1846851 stsp Nov 18 17:42 ./
1716820 rhuijben 175 Nov 27 2015 .editorconfig
1659509 rhuijben 3091 Feb 13 2015 .ycm_extra_conf.py
 915036 mf 94 Feb 22 2010 BUGS
1846422 julianfo 354869 Nov 12 15:26 CHANGES
1833511 julianfo 14264 Jun 14 16:40 COMMITTERS
1829224 astieger 55966 Apr 15 2018 INSTALL
1801940 kotkov 22834 Jul 14 2017 LICENSE
1845942 brane 42789 Nov 06 18:37 Makefile.in
1819747 danielsh 1254 Jan 01 2018 NOTICE
1746277 luke1410 2256 May 31 2016 README
1803210 philip 2142 Jul 27 2017 aclocal.m4
1692448 danielsh 7726 Jul 23 2015 autogen.sh
1845942 brane Nov 06 18:37 build/
1845716 brane 52115 Nov 04 06:49 build.conf
1845555 jorton 56811 Nov 02 10:23 configure.ac
1838541 danielsh Aug 21 13:57 contrib/
1837041 julianfo Jul 30 12:25 doc/
1822798 rhuijben 10922 Jan 31 2018 gen-make.py
1817043 kotkov 5322 Dec 03 2017 get-deps.sh
1845066 esr Oct 28 22:14 notes/
1846851 stsp Nov 18 17:42 subversion/
1846328 brane Nov 11 06:54 tools/
1813897 stsp 48359 Oct 31 2017 win-tests.py

Now, I've had in inquiry from an organization where conventional usernames
follow a FirstName.LastName style. Under this scheme, my own name would
be indistinguishable from that of Eastern European soccer players Stefan
Spremo and Stefan Spirovski. While I find this flattering, I don't think
these soccer players would enjoy getting mixed up with each other, let
alone getting mixed up with me!

One way to address this problem is to increase the minimum field width.
Using a fixed width is a good approach because dirents are being printed
as they stream down from the server. The client has no way of knowing the
length of the longest author name within a given directory ahead of time.
Unless, of course, we also changed the client to buffer dirents before
printing them. But I'm hesitent to do that when a simpler solution exists.

At 16 columns, name collisions become far less likely. In our own project,
the output would now look like this:

$ svn ls -v
1846851 stsp Nov 18 17:42 ./
1716820 rhuijben 175 Nov 27 2015 .editorconfig
1659509 rhuijben 3091 Feb 13 2015 .ycm_extra_conf.py
 915036 mf 94 Feb 22 2010 BUGS
1846422 julianfoad 354869 Nov 12 15:26 CHANGES
1833511 julianfoad 14264 Jun 14 16:40 COMMITTERS
1829224 astieger 55966 Apr 15 2018 INSTALL
1801940 kotkov 22834 Jul 14 2017 LICENSE
1845942 brane 42789 Nov 06 18:37 Makefile.in
1819747 danielsh 1254 Jan 01 2018 NOTICE
1746277 luke1410 2256 May 31 2016 README
1803210 philip 2142 Jul 27 2017 aclocal.m4
1692448 danielsh 7726 Jul 23 2015 autogen.sh
1845942 brane Nov 06 18:37 build/
1845716 brane 52115 Nov 04 06:49 build.conf
1845555 jorton 56811 Nov 02 10:23 configure.ac
1838541 danielsh Aug 21 13:57 contrib/
1837041 julianfoad Jul 30 12:25 doc/
1822798 rhuijben 10922 Jan 31 2018 gen-make.py
1817043 kotkov 5322 Dec 03 2017 get-deps.sh
1845066 esr Oct 28 22:14 notes/
1846851 stsp Nov 18 17:42 subversion/
1846328 brane Nov 11 06:54 tools/
1813897 stsp 48359 Oct 31 2017 win-tests.py

Note that we have fairly short paths. But anyone who actually uses long
paths (Java developers, for example) will already see overflowing lines
under the existing author truncation rules anyway.

I know of two workarounds:

 Use 'svn log --xml', but this is not as readable.

 Use 'svn info' to see the full name for a specific entry, but this
 is not as convenient.

Any objections to this idea?

I haven't run tests on this patch yet.

[[[
* subversion/svn/list-cmd.c
  (print_dirent): Give more space to names of authors.
]]]

Index: subversion/svn/list-cmd.c
===================================================================
--- subversion/svn/list-cmd.c (revision 1846851)
+++ subversion/svn/list-cmd.c (working copy)
@@ -150,7 +150,7 @@ print_dirent(void *baton,
                              dirent->size);
 
       return svn_cmdline_printf
- (scratch_pool, "%7ld %-8.8s %c %10s %12s %s%s\n",
+ (scratch_pool, "%7ld %-16.16s %c %10s %12s %s%s\n",
                dirent->created_rev,
                dirent->last_author ? dirent->last_author : " ? ",
                lock ? 'O' : ' ',
Received on 2018-11-23 09:14:42 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.