You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Julian Foad <ju...@btopenworld.com> on 2003/09/19 18:48:32 UTC
PATCH: column alignment in 'svn list -v' and 'svn status -v'
[From thread "minor bug in 'svn list -v'" on the "users" list.]
Martin Maurer requested a wider "file size" field in "svn list" output.
I suggested left-aligning the author field there and in "svn status" output, and other related column-alignment changes. Here is a patch for review.
Branko said that that there should be some indication that the username is truncated. This patch does not address that. Is there a good reason for it to be truncated while the other fields are not? I suppose long user names are quite common and long file sizes or revision numbers are not. But shouldn't it be consistent with "svn status"? Should both "list" and "status" truncate long user names ... and indicate that they are truncated? That's for a separate patch.
[[[
Improve the alignment of columns in "svn list" and "svn status" output.
* subversion/clients/cmdline/ls-cmd.c
(print_dirents)
Widen the file size field to allow 10 digits before breaking alignment,
because sizes over 8 digits are becoming common. [From Martin Maurer.]
Left-align the author field: it makes more sense.
Remove redundant padding from constants: they will be padded by "printf".
* subversion/clients/cmdline/status.c
(print_status)
Allow the author field to extent an extra two characters into existing
white space before breaking alignment of subsequent fields.
Align the "?" for no-working-revision in the same way as others "?"s.
Left-align the author field: it makes more sense.
Remove redundant padding from constants: they will be padded by "printf".
]]]
- Julian
Re: PATCH: column alignment in 'svn list -v' and 'svn status -v'
Posted by Julian Foad <ju...@btopenworld.com>.
Julian Foad wrote:
> Sander Roobol wrote:
>
>> On Mon, Sep 29, 2003 at 02:07:02PM -0500, Sander Roobol wrote:
>>
>>> On Fri, Sep 19, 2003 at 07:48:32PM +0100, Julian Foad wrote:
>>>
>>>> [From thread "minor bug in 'svn list -v'" on the "users" list.]
>>>>
>>>> Martin Maurer requested a wider "file size" field in "svn list" output.
>>>>
>>>> I suggested left-aligning the author field there and in "svn status"
>>>> output, and other related column-alignment changes. Here is a patch
>>>> for review.
>>>
>>> Just a reminder: you didn't commit this patch yet.
>>
>> Ping again. Will file an issue if there's no response in a few days.
>
> Thanks for keeping an eye on this.
>
> I have already committed the wider "file size" field. The other changes
> I am still not sure about. I think the left-aligning the "author"
> fields is good (somebody said yes, and nobody said no), and eliminating
> redundant white space, and some of the other stuff...
>
> My current version of the patch is attached, but it is NOT fit for
> applying. The log message does not even match the content and the
> content may be inconsistent. But for the record, this is what I have at
> the moment.
>
> The next move is really for me to make: I should split this into
> separate, coherent ideas and ask for review on each one. I'm not sure
> whether it is appropriate to file a "patch" issue, which might imply
> that the next move is for someone to review and apply the patch.
In r7530 I have committed all the good parts of this patch. No need for any more tracking of it now. Thanks.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: PATCH: column alignment in 'svn list -v' and 'svn status -v'
Posted by Julian Foad <ju...@btopenworld.com>.
Sander Roobol wrote:
> On Mon, Sep 29, 2003 at 02:07:02PM -0500, Sander Roobol wrote:
>
>>On Fri, Sep 19, 2003 at 07:48:32PM +0100, Julian Foad wrote:
>>
>>>[From thread "minor bug in 'svn list -v'" on the "users" list.]
>>>
>>>Martin Maurer requested a wider "file size" field in "svn list" output.
>>>
>>>I suggested left-aligning the author field there and in "svn status"
>>>output, and other related column-alignment changes. Here is a patch for
>>>review.
>>
>>Just a reminder: you didn't commit this patch yet.
>
> Ping again. Will file an issue if there's no response in a few days.
Thanks for keeping an eye on this.
I have already committed the wider "file size" field. The other changes I am still not sure about. I think the left-aligning the "author" fields is good (somebody said yes, and nobody said no), and eliminating redundant white space, and some of the other stuff...
My current version of the patch is attached, but it is NOT fit for applying. The log message does not even match the content and the content may be inconsistent. But for the record, this is what I have at the moment.
The next move is really for me to make: I should split this into separate, coherent ideas and ask for review on each one. I'm not sure whether it is appropriate to file a "patch" issue, which might imply that the next move is for someone to review and apply the patch.
- Julian
Re: PATCH: column alignment in 'svn list -v' and 'svn status -v'
Posted by Sander Roobol <ph...@wanadoo.nl>.
On Fri, Sep 19, 2003 at 07:48:32PM +0100, Julian Foad wrote:
> [From thread "minor bug in 'svn list -v'" on the "users" list.]
>
> Martin Maurer requested a wider "file size" field in "svn list" output.
>
> I suggested left-aligning the author field there and in "svn status"
> output, and other related column-alignment changes. Here is a patch for
> review.
Just a reminder: you didn't commit this patch yet.
Sander
>
> Branko said that that there should be some indication that the username is
> truncated. This patch does not address that. Is there a good reason for
> it to be truncated while the other fields are not? I suppose long user
> names are quite common and long file sizes or revision numbers are not.
> But shouldn't it be consistent with "svn status"? Should both "list" and
> "status" truncate long user names ... and indicate that they are truncated?
> That's for a separate patch.
>
>
> [[[
> Improve the alignment of columns in "svn list" and "svn status" output.
>
> * subversion/clients/cmdline/ls-cmd.c
> (print_dirents)
> Widen the file size field to allow 10 digits before breaking alignment,
> because sizes over 8 digits are becoming common. [From Martin Maurer.]
> Left-align the author field: it makes more sense.
> Remove redundant padding from constants: they will be padded by "printf".
>
> * subversion/clients/cmdline/status.c
> (print_status)
> Allow the author field to extent an extra two characters into existing
> white space before breaking alignment of subsequent fields.
> Align the "?" for no-working-revision in the same way as others "?"s.
> Left-align the author field: it makes more sense.
> Remove redundant padding from constants: they will be padded by "printf".
> ]]]
>
> - Julian
>
> Improve the alignment of columns in "svn list" and "svn status" output.
>
> * subversion/clients/cmdline/ls-cmd.c
> (print_dirents)
> Widen the file size field to allow 10 digits before breaking alignment,
> because sizes over 8 digits are becoming common. [From Martin Maurer.]
> Left-align the author field: it makes more sense.
> Remove redundant padding from constants: they will be padded by "printf".
>
> * subversion/clients/cmdline/status.c
> (print_status)
> Allow the author field to extent an extra two characters into existing
> white space before breaking alignment of subsequent fields.
> Align the "?" for no-working-revision in the same way as others "?"s.
> Left-align the author field: it makes more sense.
> Remove redundant padding from constants: they will be padded by "printf".
>
> Index: subversion/clients/cmdline/ls-cmd.c
> ===================================================================
> --- subversion/clients/cmdline/ls-cmd.c (revision 7090)
> +++ subversion/clients/cmdline/ls-cmd.c (working copy)
> @@ -98,11 +98,11 @@
> if (apr_err)
> timestr[0] = '\0';
>
> - printf ("%c %7"SVN_REVNUM_T_FMT" %8.8s "
> - "%8"SVN_FILESIZE_T_FMT" %12s %s%s\n",
> + printf ("%c %7"SVN_REVNUM_T_FMT" %-8.8s "
> + "%10"SVN_FILESIZE_T_FMT" %12s %s%s\n",
> dirent->has_props ? 'P' : '_',
> dirent->created_rev,
> - native_author ? native_author : " ? ",
> + native_author ? native_author : " ?",
> dirent->size,
> timestr,
> native_entryname,
> Index: subversion/clients/cmdline/status.c
> ===================================================================
> --- subversion/clients/cmdline/status.c (revision 7090)
> +++ subversion/clients/cmdline/status.c (working copy)
> @@ -72,11 +72,11 @@
> if (detailed)
> {
> if (! status->entry)
> - working_rev = " ";
> + working_rev = "";
> else if (! SVN_IS_VALID_REVNUM (status->entry->revision))
> - working_rev = " ? "; /* ### Why the odd alignment? */
> + working_rev = "? ";
> else if (status->copied)
> - working_rev = " -";
> + working_rev = "-";
> else
> sprintf (working_rev_buf, "%6" SVN_REVNUM_T_FMT,
> status->entry->revision);
> @@ -93,21 +93,21 @@
> sprintf(commit_rev_buf, "%6" SVN_REVNUM_T_FMT,
> status->entry->cmt_rev);
> else if (status->entry)
> - commit_rev = " ? ";
> + commit_rev = "? ";
> else
> - commit_rev = " ";
> + commit_rev = "";
>
> 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' : ' ',
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: PATCH: column alignment in 'svn list -v' and 'svn status -v'
Posted by Greg Stein <gs...@lyra.org>.
On Fri, Sep 19, 2003 at 07:48:32PM +0100, Julian Foad wrote:
>...
> Branko said that that there should be some indication that the username
> is truncated. This patch does not address that. Is there a good reason
> for it to be truncated while the other fields are not? I suppose long
> user names are quite common and long file sizes or revision numbers are
> not. But shouldn't it be consistent with "svn status"? Should both
> "list" and "status" truncate long user names ... and indicate that they
> are truncated? That's for a separate patch.
I think the only reason for truncation is to keep the columns aligned.
Since you have 12 characters in there, I'd say use this algorithm:
if len(name) <= 12:
printed_name = name
else:
printed_name = name[:9] + '...'
And that said, I agree that both list and status should use the same
behavior.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org