[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: Branko Čibej <brane_at_xbc.nu>
Date: 2003-09-16 01:58:54 CEST

Julian Foad wrote:

> 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?

The way "svn st" behaves is still problematic if you take into account
that usernames can contain spaces. Yes, perhaps not on Unix, but they can.

> Anyway, there is room in the existing white space for two more
> characters.

At the very least, there should be some indication that the username is
truncated.

> 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 ...)

I agree.

> 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,

This is fine.

> 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 = "?";

Could you explain this change? I can't see any reason for it.

> 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
>

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
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:59:43 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.