git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitview: revamped to use string.join, stripped a function def
@ 2007-09-27 19:55 Denis Cheng
  2007-11-21  5:19 ` rae l
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Cheng @ 2007-09-27 19:55 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Junio C Hamano; +Cc: git, cr_quan

Signed-off-by: Denis Cheng <crquan@gmail.com>
---
 contrib/gitview/gitview |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview
index 5931766..2eb72b1 100755
--- a/contrib/gitview/gitview
+++ b/contrib/gitview/gitview
@@ -36,17 +36,6 @@ except ImportError:
 
 re_ident = re.compile('(author|committer) (?P<ident>.*) (?P<epoch>\d+) (?P<tz>[+-]\d{4})')
 
-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
-
 def show_date(epoch, tz):
 	secs = float(epoch)
 	tzsecs = float(tz[1:3]) * 3600
@@ -1115,7 +1104,7 @@ class GitView(object):
 
 	def set_branch(self, args):
 		"""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:]))
 		git_rev_list_cmd = fp.read()
 		fp.close()
 		fp = os.popen("git rev-list  --header --topo-order --parents " + git_rev_list_cmd)
-- 
1.5.3.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gitview: revamped to use string.join, stripped a function def
  2007-09-27 19:55 [PATCH] gitview: revamped to use string.join, stripped a function def Denis Cheng
@ 2007-11-21  5:19 ` rae l
  2007-11-21  6:23   ` Vineet Kumar
  2007-11-21  6:50   ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: rae l @ 2007-11-21  5:19 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Junio C Hamano; +Cc: git, cr_quan, Scott James Remnant

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>
> ---
>  contrib/gitview/gitview |   13 +------------
>  1 files changed, 1 insertions(+), 12 deletions(-)
>
> diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview
> index 5931766..2eb72b1 100755
> --- a/contrib/gitview/gitview
> +++ b/contrib/gitview/gitview
> @@ -36,17 +36,6 @@ except ImportError:
>
>  re_ident = re.compile('(author|committer) (?P<ident>.*) (?P<epoch>\d+) (?P<tz>[+-]\d{4})')
>
> -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
> -
>  def show_date(epoch, tz):
>         secs = float(epoch)
>         tzsecs = float(tz[1:3]) * 3600
> @@ -1115,7 +1104,7 @@ class GitView(object):
>
>         def set_branch(self, args):
>                 """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:]))
>                 git_rev_list_cmd = fp.read()
>                 fp.close()
>                 fp = os.popen("git rev-list  --header --topo-order --parents " + git_rev_list_cmd)
> --
> 1.5.3.2

-- 
Cheng

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gitview: revamped to use string.join, stripped a function def
  2007-11-21  5:19 ` rae l
@ 2007-11-21  6:23   ` Vineet Kumar
  2007-11-21  6:50   ` Junio C Hamano
  1 sibling, 0 replies; 4+ messages in thread
From: Vineet Kumar @ 2007-11-21  6:23 UTC (permalink / raw)
  To: git

* rae l (crquan@gmail.com) [071120 21:19]:
> Please give some comments.

Well I'm just an outside observer, but it looks like a good change to
me.

-- 
http://www.doorstop.net/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gitview: revamped to use string.join, stripped a function def
  2007-11-21  5:19 ` rae l
  2007-11-21  6:23   ` Vineet Kumar
@ 2007-11-21  6:50   ` Junio C Hamano
  1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2007-11-21  6:50 UTC (permalink / raw)
  To: rae l; +Cc: Aneesh Kumar K.V, git, cr_quan, Scott James Remnant

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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-11-21  6:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-27 19:55 [PATCH] gitview: revamped to use string.join, stripped a function def Denis Cheng
2007-11-21  5:19 ` rae l
2007-11-21  6:23   ` Vineet Kumar
2007-11-21  6:50   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).