git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitview: revamped to use string.join, stripped a function def

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 21, 2007, 06:50 UTC
Message-ID
<7vfxz0hz2a.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<91b13c310711202119j4f9e20f0n2515babe5f9217ac@mail.gmail.com>
"rae l" <crquan@gmail.com> writes:
> Please give some comments.
>
> On Sep 28, 2007 3:55 AM, Denis Cheng <crquan@gmail.com> wrote:
>> Signed-off-by: Denis Cheng <crquan@gmail.com>
Blast from the past ;-).
Show 14 quoted lines
>> -def list_to_string(args, skip):
>> -       count = len(args)
>> -       i = skip
>> -       str_arg=" "
>> -       while (i < count ):
>> -               str_arg = str_arg + args[i]
>> -               str_arg = str_arg + " "
>> -               i = i+1
>> -
>> -       return str_arg
>> ... 
>>                 """Fill in different windows with info from the reposiroty"""
>> -               fp = os.popen("git rev-parse --sq --default HEAD " + list_to_string(args, 1))
>> +               fp = os.popen("git rev-parse --sq --default HEAD " + " ".join(args[1:]))

Obviously correct, loses extra SPs on both ends of the args string, and reads more Pythonic.

Previous: Vineet Kumar
Message 4 of 4 in “gitview: revamped to use string.join, stripped a function def”
  1. gitview: revamped to use string.join, stripped a function defDenis Cheng, Sep 27, 2007
  2. rae lNov 21, 2007
  3. Vineet KumarNov 21, 2007
  4. Junio C HamanoNov 21, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.