GNU bug report logs - #6195
Feature Request for "fold"

Previous Next

Package: coreutils;

Reported by: BJ Dierkes <wdierkes <at> 5dollarwhitebox.org>

Date: Sat, 15 May 2010 02:07:01 UTC

Severity: wishlist

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6195 in the body.
You can then email your comments to 6195 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#6195; Package coreutils. (Sat, 15 May 2010 02:07:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to BJ Dierkes <wdierkes <at> 5dollarwhitebox.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 15 May 2010 02:07:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: BJ Dierkes <wdierkes <at> 5dollarwhitebox.org>
To: bug-coreutils <at> gnu.org
Subject: Feature Request for "fold"
Date: Fri, 14 May 2010 20:55:28 -0500
Hello all,

Per the coreutils site I was referred to submit feature requests here on list.  I am trying to use the 'fold' utility to make prettier output from 'git-log'.  The use is irrelevant, but that is my example:

$ git --no-pager log --oneline | fold -s


The output looks something like:

aa271ba Some commit summary
ba231ac Another commit summary but this time the line is too long and goes 
beyond 80 characters
aa271ba Some other commit summary


As you can see, fold chops the second commit entry into two lines, as it went over 80 characters.  What I think would be really useful is the ability to pass a '--indent' option to fold that would allow this:

$ git --no-pager log --oneline | fold -s --indent 8

aa271ba Some commit summary
ba231ac Another commit summary but this time the line is too long and goes 
        beyond 80 characters
aa271ba Some other commit summary


As you can see, this would allow me to generate output that fits better, and looks better when a line gets folded (because i'm using the git commit id in this example as more or less a column).

Thanks.d

---
derks







Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#6195; Package coreutils. (Sat, 15 May 2010 13:31:02 GMT) Full text and rfc822 format available.

Message #8 received at 6195 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: BJ Dierkes <wdierkes <at> 5dollarwhitebox.org>
Cc: 6195 <at> debbugs.gnu.org
Subject: Re: bug#6195: Feature Request for "fold"
Date: Sat, 15 May 2010 14:28:14 +0100
On 15/05/10 02:55, BJ Dierkes wrote:
> Hello all,
> 
> I am trying to use the 'fold' utility to make prettier output from 'git-log'.
> 
> $ git --no-pager log --oneline | fold -s

`fmt` seems to nearly do what you want,
and with a little sed you can line up correctly:

  fmt -t | sed 's/^   /        /'

I'm not against a --indent option to fold
but with the overlap between fmt,pr,fold,sed
the barrier to new options to these utils is high.

cheers,
Pádraig.




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#6195; Package coreutils. (Sun, 16 May 2010 19:01:02 GMT) Full text and rfc822 format available.

Message #11 received at 6195 <at> debbugs.gnu.org (full text, mbox):

From: BJ Dierkes <wdierkes <at> 5dollarwhitebox.org>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 6195 <at> debbugs.gnu.org
Subject: Re: bug#6195: Feature Request for "fold"
Date: Sun, 16 May 2010 14:00:37 -0500
On May 15, 2010, at 8:28 AM, Pádraig Brady wrote:

> On 15/05/10 02:55, BJ Dierkes wrote:
>> Hello all,
>> 
>> I am trying to use the 'fold' utility to make prettier output from 'git-log'.
>> 
>> $ git --no-pager log --oneline | fold -s
> 
> `fmt` seems to nearly do what you want,
> and with a little sed you can line up correctly:
> 
>  fmt -t | sed 's/^   /        /'
> 
> I'm not against a --indent option to fold
> but with the overlap between fmt,pr,fold,sed
> the barrier to new options to these utils is high.
> 
> cheers,
> Pádraig.


Thank you for the quick reply.  Your response makes complete sense.

---
derks








Reply sent to Bob Proulx <bob <at> proulx.com>:
You have taken responsibility. (Mon, 07 Jun 2010 23:33:02 GMT) Full text and rfc822 format available.

Notification sent to BJ Dierkes <wdierkes <at> 5dollarwhitebox.org>:
bug acknowledged by developer. (Mon, 07 Jun 2010 23:33:02 GMT) Full text and rfc822 format available.

Message #16 received at 6195-done <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: BJ Dierkes <wdierkes <at> 5dollarwhitebox.org>
Cc: 6195-done <at> debbugs.gnu.org
Subject: Re: bug#6195: Feature Request for "fold"
Date: Mon, 7 Jun 2010 17:32:41 -0600
BJ Dierkes wrote:
> Pádraig Brady wrote:
> >> $ git --no-pager log --oneline | fold -s
> > 
> > `fmt` seems to nearly do what you want,
> > and with a little sed you can line up correctly:
> > 
> >  fmt -t | sed 's/^   /        /'
> > 
> > I'm not against a --indent option to fold
> > but with the overlap between fmt,pr,fold,sed
> > the barrier to new options to these utils is high.
> 
> Thank you for the quick reply.  Your response makes complete sense.

Since everyone seems satisfied with the situation I am going to close
the bug report in the bug tracking system with this message.

Bob




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 06 Jul 2010 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Sat, 20 Apr 2013 17:08:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 19 May 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.