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

Re: minor bug in 'svn list -v'

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-09-16 01:29:14 CEST

Ben Collins-Sussman wrote:
> Martin MAURER <martin.maurer@email.de> writes:

(re. "svn list")
>>currently if a file is >=100MB the layout breaks because of the
>>displayed size. as 100 MB files are quite frequently around, it might be
>>good to increase the size field size by 1 or 2.
>
> Wanna send a patch? It's all in client/cmdline/ls-cmd.c.

While we're talking column widths, "svn list" shows only the first 8 characters of my username, while "svn status -v" shows the whole name (10 characters in my case: "julianfoad"), breaking its formatting which otherwise is geared to a maximum of 8:

~/src/subversion/doc/book> svn ls -v
_ 4371 rassilon 3234 Jan 13 2003 HACKING
_ 7047 julianfo 5938 Sep 11 22:55 Makefile
_ 6717 kfogel 6666 Aug 12 21:58 README
_ 7014 fitz 4058 Sep 09 05:47 TODO
_ 7062 cmpilato 0 Sep 15 16:12 book/
_ 7009 dimentiy 0 Sep 08 22:39 misc-docs/
_ 6632 julianfo 4441 Aug 01 19:34 outline.txt
_ 6593 fitz 0 Jul 28 06:02 tools/
~/src/subversion/doc/book> svn status -v -N
             7064 7062 cmpilato .
             7064 6593 fitz tools
             7064 7009 dimentiy misc-docs
             7064 4371 rassilon HACKING
             7064 7014 fitz TODO
             7064 7062 cmpilato book
             7064 7047 julianfoad Makefile
             7064 6632 julianfoad outline.txt
             7064 6717 evenlongername README

I'm not sure which of those is best. I wouldn't want the "status" output truncated, but perhaps "list" output is OK truncated because it is not so important for it to be machine-readabile? Anyway, there is room in the existing white space for two more characters.

And it doesn't make much sense for user names to be right-aligned. Left-aligned would facilitate sorting and searching. (Not that you can't sort or search with them as they are, but ...)

Want to accept a patch to change that to left-aligned (in both "list" and "status", with the alignment of "status" output preserved for up to 10 characters rather then 8? Like this:

~/src/subversion/doc/book> svn ls -v
_ 4371 rassilon 3234 Jan 13 2003 HACKING
_ 7047 julianfo 5938 Sep 11 22:55 Makefile
_ 6717 kfogel 6666 Aug 12 21:58 README
_ 7014 fitz 4058 Sep 09 05:47 TODO
_ 7062 cmpilato 0 Sep 15 16:12 book/
_ 7009 dimentiy 0 Sep 08 22:39 misc-docs/
_ 6632 julianfo 4441 Aug 01 19:34 outline.txt
_ 6593 fitz 0 Jul 28 06:02 tools/
~/src/subversion/doc/book> svn st -v -N
             7064 7062 cmpilato .
             7064 6593 fitz tools
             7064 7009 dimentiy misc-docs
             7064 4371 rassilon HACKING
             7064 7014 fitz TODO
             7064 7062 cmpilato book
             7064 7047 julianfoad Makefile
             7064 6632 julianfoad outline.txt
             7064 6717 evenlongername README

[[[
Improve the display of user names in "svn status" and "svn list" output.

* subversion/clients/cmdline/ls-cmd.c
  Fix a typo in a comment.
  Left-align the user names, as that makes more sense.

* subversion/clients/cmdline/status.c
  Left-align the user names, and allow them to reach 10 characters
  rather than 8 before disrupting the alignment of the following column.
]]]

Index: subversion/clients/cmdline/ls-cmd.c
===================================================================
--- subversion/clients/cmdline/ls-cmd.c (revision 7064)
+++ subversion/clients/cmdline/ls-cmd.c (working copy)
@@ -78,7 +78,7 @@
             SVN_ERR (svn_utf_cstring_from_utf8 (&native_author,
                                                 dirent->last_author, pool));

- /* svn_time_to_human_cstring gives us something *way* to long
+ /* svn_time_to_human_cstring gives us something *way* too long
              to use for this, so we have to roll our own. We include
              the year if the entry's time is not within half a year. */
           apr_time_exp_lt (&exp_time, dirent->time);
@@ -98,7 +98,7 @@
           if (apr_err)
             timestr[0] = '\0';

- printf ("%c %7"SVN_REVNUM_T_FMT" %8.8s "
+ printf ("%c %7"SVN_REVNUM_T_FMT" %-8.8s "
                   "%8"SVN_FILESIZE_T_FMT" %12s %s%s\n",
                   dirent->has_props ? 'P' : '_',
                   dirent->created_rev,
Index: subversion/clients/cmdline/status.c
===================================================================
--- subversion/clients/cmdline/status.c (revision 7064)
+++ subversion/clients/cmdline/status.c (working copy)
@@ -100,14 +100,14 @@
           if (status->entry && status->entry->cmt_author)
             commit_author = status->entry->cmt_author;
           else if (status->entry)
- commit_author = " ? ";
+ commit_author = "?";
           else
- commit_author = " ";
+ commit_author = "";
         }
     }

   if (detailed && show_last_committed)
- printf ("%c%c%c%c%c %c %6s %6s %8s %s\n",
+ printf ("%c%c%c%c%c %c %6s %6s %-10s %s\n",
             generate_status_code (status->text_status),
             generate_status_code (status->prop_status),
             status->locked ? 'L' : ' ',

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Sep 16 01:29:08 2003

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

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