All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [GUILT] handle branches with slashes in guilt-graph
@ 2011-10-18 10:40 Per Cederqvist
  2011-10-18 13:30 ` Jeff Sipek
  2011-10-18 18:35 ` Andreas Schwab
  0 siblings, 2 replies; 6+ messages in thread
From: Per Cederqvist @ 2011-10-18 10:40 UTC (permalink / raw
  To: Jeff Sipek; +Cc: git, ceder

Avoid sed errors when the branch name contains a slash.

Signed-off-by: Per Cederqvist <cederp@opera.com>

--- /usr/bin/guilt-graph~	2011-01-25 20:15:50.000000000 +0100
+++ /usr/bin/guilt-graph	2011-10-18 12:30:31.000000000 +0200
@@ -37,9 +37,10 @@ disp "digraph G {"

  current="$top"

+safebranch=`echo "$branch"|sed 's%/%\\\\/%g'`
  while [ "$current" != "$base" ]; do
  	pname=`git show-ref | sed -n -e "
-/^$current refs\/patches\/$branch/ {
+/^$current refs\/patches\/$safebranch/ {
  	s,^$current refs/patches/$branch/,,
  	p
  	q

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

* Re: [GUILT] handle branches with slashes in guilt-graph
  2011-10-18 10:40 [GUILT] handle branches with slashes in guilt-graph Per Cederqvist
@ 2011-10-18 13:30 ` Jeff Sipek
  2011-10-18 18:35 ` Andreas Schwab
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff Sipek @ 2011-10-18 13:30 UTC (permalink / raw
  To: Per Cederqvist; +Cc: git, ceder

On Tue, Oct 18, 2011 at 12:40:59PM +0200, Per Cederqvist wrote:
> Avoid sed errors when the branch name contains a slash.

Makes sense.  I'll test it and add it to my patch queue.

Thanks,

Jeff.

> Signed-off-by: Per Cederqvist <cederp@opera.com>
> 
> --- /usr/bin/guilt-graph~	2011-01-25 20:15:50.000000000 +0100
> +++ /usr/bin/guilt-graph	2011-10-18 12:30:31.000000000 +0200
> @@ -37,9 +37,10 @@ disp "digraph G {"
> 
>  current="$top"
> 
> +safebranch=`echo "$branch"|sed 's%/%\\\\/%g'`
>  while [ "$current" != "$base" ]; do
>  	pname=`git show-ref | sed -n -e "
> -/^$current refs\/patches\/$branch/ {
> +/^$current refs\/patches\/$safebranch/ {
>  	s,^$current refs/patches/$branch/,,
>  	p
>  	q

-- 
Once you have their hardware. Never give it back.
(The First Rule of Hardware Acquisition)

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

* Re: [GUILT] handle branches with slashes in guilt-graph
  2011-10-18 10:40 [GUILT] handle branches with slashes in guilt-graph Per Cederqvist
  2011-10-18 13:30 ` Jeff Sipek
@ 2011-10-18 18:35 ` Andreas Schwab
  2011-10-18 19:12   ` Junio C Hamano
  1 sibling, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2011-10-18 18:35 UTC (permalink / raw
  To: Per Cederqvist; +Cc: Jeff Sipek, git, ceder

Per Cederqvist <cederp@opera.com> writes:

> Avoid sed errors when the branch name contains a slash.
>
> Signed-off-by: Per Cederqvist <cederp@opera.com>
>
> --- /usr/bin/guilt-graph~	2011-01-25 20:15:50.000000000 +0100
> +++ /usr/bin/guilt-graph	2011-10-18 12:30:31.000000000 +0200
> @@ -37,9 +37,10 @@ disp "digraph G {"
>
>  current="$top"
>
> +safebranch=`echo "$branch"|sed 's%/%\\\\/%g'`
>  while [ "$current" != "$base" ]; do
>  	pname=`git show-ref | sed -n -e "
> -/^$current refs\/patches\/$branch/ {
> +/^$current refs\/patches\/$safebranch/ {

Alternatively, you could change the delimiter to `,':

  \,^$current refs/patches/$branch, {

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [GUILT] handle branches with slashes in guilt-graph
  2011-10-18 18:35 ` Andreas Schwab
@ 2011-10-18 19:12   ` Junio C Hamano
  2011-10-18 19:15     ` Junio C Hamano
  2011-10-18 19:56     ` Andreas Schwab
  0 siblings, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2011-10-18 19:12 UTC (permalink / raw
  To: Andreas Schwab; +Cc: Per Cederqvist, Jeff Sipek, git, ceder

Andreas Schwab <schwab@linux-m68k.org> writes:

> Per Cederqvist <cederp@opera.com> writes:
>
>> Avoid sed errors when the branch name contains a slash.
>>
>> Signed-off-by: Per Cederqvist <cederp@opera.com>
>>
>> --- /usr/bin/guilt-graph~	2011-01-25 20:15:50.000000000 +0100
>> +++ /usr/bin/guilt-graph	2011-10-18 12:30:31.000000000 +0200
>> @@ -37,9 +37,10 @@ disp "digraph G {"
>>
>>  current="$top"
>>
>> +safebranch=`echo "$branch"|sed 's%/%\\\\/%g'`
>>  while [ "$current" != "$base" ]; do
>>  	pname=`git show-ref | sed -n -e "
>> -/^$current refs\/patches\/$branch/ {
>> +/^$current refs\/patches\/$safebranch/ {
>
> Alternatively, you could change the delimiter to `,':
>
>   \,^$current refs/patches/$branch, {

Isn't a comma still valid character in a branch name?

The vertical var | is available, though ;-)

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

* Re: [GUILT] handle branches with slashes in guilt-graph
  2011-10-18 19:12   ` Junio C Hamano
@ 2011-10-18 19:15     ` Junio C Hamano
  2011-10-18 19:56     ` Andreas Schwab
  1 sibling, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2011-10-18 19:15 UTC (permalink / raw
  To: Andreas Schwab; +Cc: Per Cederqvist, Jeff Sipek, git, ceder

Junio C Hamano <gitster@pobox.com> writes:

>> Alternatively, you could change the delimiter to `,':
>>
>>   \,^$current refs/patches/$branch, {
>
> Isn't a comma still valid character in a branch name?
>
> The vertical var | is available, though ;-)

Nah, sorry, '|' is not.

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

* Re: [GUILT] handle branches with slashes in guilt-graph
  2011-10-18 19:12   ` Junio C Hamano
  2011-10-18 19:15     ` Junio C Hamano
@ 2011-10-18 19:56     ` Andreas Schwab
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2011-10-18 19:56 UTC (permalink / raw
  To: Junio C Hamano; +Cc: Per Cederqvist, Jeff Sipek, git, ceder

Junio C Hamano <gitster@pobox.com> writes:

> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> Per Cederqvist <cederp@opera.com> writes:
>>
>>> Avoid sed errors when the branch name contains a slash.
>>>
>>> Signed-off-by: Per Cederqvist <cederp@opera.com>
>>>
>>> --- /usr/bin/guilt-graph~	2011-01-25 20:15:50.000000000 +0100
>>> +++ /usr/bin/guilt-graph	2011-10-18 12:30:31.000000000 +0200
>>> @@ -37,9 +37,10 @@ disp "digraph G {"
>>>
>>>  current="$top"
>>>
>>> +safebranch=`echo "$branch"|sed 's%/%\\\\/%g'`
>>>  while [ "$current" != "$base" ]; do
>>>  	pname=`git show-ref | sed -n -e "
>>> -/^$current refs\/patches\/$branch/ {
>>> +/^$current refs\/patches\/$safebranch/ {
>>
>> Alternatively, you could change the delimiter to `,':
>>
>>   \,^$current refs/patches/$branch, {
>
> Isn't a comma still valid character in a branch name?

I suggested the comma because it is already used by the next sed
command, so that won't be a regression.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

end of thread, other threads:[~2011-10-18 19:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18 10:40 [GUILT] handle branches with slashes in guilt-graph Per Cederqvist
2011-10-18 13:30 ` Jeff Sipek
2011-10-18 18:35 ` Andreas Schwab
2011-10-18 19:12   ` Junio C Hamano
2011-10-18 19:15     ` Junio C Hamano
2011-10-18 19:56     ` Andreas Schwab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.