chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Save the Gazette!


From: Andy Bennett
Subject: Re: [Chicken-users] Save the Gazette!
Date: Thu, 17 Feb 2011 10:00:53 +0000
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)

Alaric Snell-Pym wrote:
> On 02/16/11 15:04, Andy Bennett wrote:
> 
>> This bash command, executed inside a git repo, should do the trick:
>>
>> -----
>> for b in `git branch -a --no-color | sed -e 's/^*//' -e
>> 's/^\s*\(\S*\).*/\1/'` ; do echo " * On `echo $b | sed -e
>> 's#^remotes/##'`:"; git log --pretty=format:'   * (%h): %s (%an, %ar)'
>> --since="1 week ago" $b; echo ""; done;
>> -----
>>
>> It's a one-liner.
>>
> 
> That's a good start! Perfect! It doesn't seem to *do* anything for me
> (the first sed seems to turn the output of git branch into just as many
> blank lines) but, ah, we can work on such details ;-)

Strange! The first part of the first sed is supposed to remove the '*'
that indicates the currently checked out branch.

Here's what my 'git branch' command does:
-----
$ git branch -a --no-color
* master
  old
  pp
  remotes/origin/HEAD -> origin/master
-----

Here's a snippet from my ~/.gitconfig
-----
[color]
        diff = auto
        status = auto
        branch = auto
-----


The second part of the first sed is supposed to remove those '->
origin/master' bits from the remote branches.

I have just tested with NetBSD's sed and the 2nd part seems to cause
everything to turn blank...
It seems to be having trouble with the \S character class and the match
reference. Changing this argument to

-e 's/-> .*//'

produces a correct result.





Regards,
@ndy

-- 
address@hidden
http://www.ashurst.eu.org/
0x7EBA75FF


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]