Re: [GUILT v2 06/29] Fix the do_get_patch function.

2014-05-14 Thread Per Cederqvist
On Tue, May 13, 2014 at 11:13 PM, Jeff Sipek  wrote:

> On Tue, May 13, 2014 at 10:30:42PM +0200, Per Cederqvist wrote:
>> A patch file consists of:
>>
>> (1) the description
>> (2) optional diffstat
>> (3) the patches
>>
>> When extracting the patch, we only want part 3.  The do_get_patch used
>> to give us part 2 and part 3.  That made for instance this series of
>> operations fail if guilt.diffstat is true:
>>
>> guilt push empty-1
>> guilt push empty-2
>> guilt pop
>> guilt fold empty-2
>> guilt pop
>> guilt push
>
> I would probably include the actual error here.  I got the following (using
> patch names a & b):
>
> $ guilt pop
> Now at a.
> $ guilt fold b
> error: No changes
> $ guilt pop
> All patches popped.
> $ guilt pu
> Applying patch..a
> error: No changes
> To force apply this patch, use 'guilt push -f'

A bit strange.  I see that I made an error in the commands. It should be
"guilt new empty-1" and "guilt new empty-2".  The updated example in the
commit message looks like this:

$ guilt new empty-1
$ guilt new empty-2
$ guilt pop
Now at empty-1
$ guilt fold empty-2
$ guilt pop
All patches popped.
$ guilt push
Applying patch..empty-1
fatal: unrecognized input
To force apply this patch, use 'guilt push -f'

> The diff itself is good.
>
> Signed-off-by: Josef 'Jeff' Sipek 

Unless you object I'll add this signed-off line even though I'm
improving the commit message in preparation for version 3
of the patch series.

/ceder

>>
>> Signed-off-by: Per Cederqvist 
>> ---
>>  guilt | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/guilt b/guilt
>> index 8701481..3fc524e 100755
>> --- a/guilt
>> +++ b/guilt
>> @@ -334,7 +334,7 @@ do_get_patch()
>>  {
>>   awk '
>>  BEGIN{}
>> -/^(diff |---$|--- )/ {patch = 1}
>> +/^(diff |--- )/ {patch = 1}
>>  patch == 1 {print $0}
>>  END{}
>>  ' < "$1"
>> --
>> 1.8.3.1
>>
>
> --
> I already backed up the [server] once, I can do it again.
> - a sysadmin threatening to do more frequent backups
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GUILT v2 06/29] Fix the do_get_patch function.

2014-05-13 Thread Jeff Sipek
On Tue, May 13, 2014 at 10:30:42PM +0200, Per Cederqvist wrote:
> A patch file consists of:
> 
> (1) the description
> (2) optional diffstat
> (3) the patches
> 
> When extracting the patch, we only want part 3.  The do_get_patch used
> to give us part 2 and part 3.  That made for instance this series of
> operations fail if guilt.diffstat is true:
> 
> guilt push empty-1
> guilt push empty-2
> guilt pop
> guilt fold empty-2
> guilt pop
> guilt push

I would probably include the actual error here.  I got the following (using
patch names a & b):

$ guilt pop
Now at a.
$ guilt fold b
error: No changes
$ guilt pop
All patches popped.
$ guilt pu
Applying patch..a
error: No changes
To force apply this patch, use 'guilt push -f'


The diff itself is good.

Signed-off-by: Josef 'Jeff' Sipek 

> 
> Signed-off-by: Per Cederqvist 
> ---
>  guilt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/guilt b/guilt
> index 8701481..3fc524e 100755
> --- a/guilt
> +++ b/guilt
> @@ -334,7 +334,7 @@ do_get_patch()
>  {
>   awk '
>  BEGIN{}
> -/^(diff |---$|--- )/ {patch = 1}
> +/^(diff |--- )/ {patch = 1}
>  patch == 1 {print $0}
>  END{}
>  ' < "$1"
> -- 
> 1.8.3.1
> 

-- 
I already backed up the [server] once, I can do it again.
- a sysadmin threatening to do more frequent backups
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GUILT v2 06/29] Fix the do_get_patch function.

2014-05-13 Thread Per Cederqvist
A patch file consists of:

(1) the description
(2) optional diffstat
(3) the patches

When extracting the patch, we only want part 3.  The do_get_patch used
to give us part 2 and part 3.  That made for instance this series of
operations fail if guilt.diffstat is true:

guilt push empty-1
guilt push empty-2
guilt pop
guilt fold empty-2
guilt pop
guilt push

Signed-off-by: Per Cederqvist 
---
 guilt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guilt b/guilt
index 8701481..3fc524e 100755
--- a/guilt
+++ b/guilt
@@ -334,7 +334,7 @@ do_get_patch()
 {
awk '
 BEGIN{}
-/^(diff |---$|--- )/ {patch = 1}
+/^(diff |--- )/ {patch = 1}
 patch == 1 {print $0}
 END{}
 ' < "$1"
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html