# Should cg-mkpatch output be usable with cg-patch?

6 messages from 2005-07-20 to 2005-07-24. Participants: Wolfgang Denk, Junio C Hamano, Petr Baudis.
Thread: https://gitlist.dev/t/1281

## Wolfgang Denk, 2005-07-20 23:49

Subject: Should cg-mkpatch output be usable with cg-patch?
Message-ID: <20050720234904.B3ED735267C@atlas.denx.de>
URL: https://gitlist.dev/e/20050720234904.B3ED735267C%40atlas.denx.de

```
I wander what I should do with "cg-mkpatch" generated output;  I  had
the  impression that this should be usable with "cg-patch", but these
are incompatible with each other. Forexample. if  a  commit  contains
permission changes, my generated patch may look like this:

	...
	diff --git a/MAKEALL b/MAKEALL
	old mode 100644
	new mode 100755
	diff --git a/mkconfig b/mkconfig
	old mode 100644
	new mode 100755
	diff --git a/tools/img2brec.sh b/tools/img2brec.sh
	old mode 100644
	new mode 100755
	...

If I feed this into "cg-patch", I get:

	patch: **** Only garbage was found in the patch input.

-> rpm -q cogito
cogito-0.12.1-1


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
I really hate this damned machine     It never does quite what I want
I wish that they would sell it.              But only what I tell it.

```

## Junio C Hamano, 2005-07-21 03:57

Subject: Re: Should cg-mkpatch output be usable with cg-patch?
Message-ID: <7vackgerpe.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vackgerpe.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050720234904.B3ED735267C@atlas.denx.de>

```
Wolfgang Denk <wd@denx.de> writes:

> I wander what I should do with "cg-mkpatch" generated output;  I  had
> the  impression that this should be usable with "cg-patch", but these
> are incompatible with each other. Forexample. if  a  commit  contains
> permission changes, my generated patch may look like this:

Yes, cg-patch does grok git extended diff headers, but does it
by hand and missing corner cases like this is understandable.

I only briefly looked at cg-patch, but I suspect that it can
lose 90% lines of its code by just using "git-apply --index".

I see cg-patch wants to be able to do reverse patch, which is
not supported by git-apply currently.

Do people find "cg-patch -R" useful?

```

## Petr Baudis, 2005-07-22 21:02

Subject: Re: Should cg-mkpatch output be usable with cg-patch?
Message-ID: <20050722210225.GF11916@pasky.ji.cz>
URL: https://gitlist.dev/e/20050722210225.GF11916%40pasky.ji.cz
In-Reply-To: <7vackgerpe.fsf@assigned-by-dhcp.cox.net>

```
Dear diary, on Thu, Jul 21, 2005 at 05:57:49AM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> told me that...
> I only briefly looked at cg-patch, but I suspect that it can
> lose 90% lines of its code by just using "git-apply --index".

Can git-apply already deal with fuzzy patches?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

```

## Petr Baudis, 2005-07-22 21:03

Subject: Re: Should cg-mkpatch output be usable with cg-patch?
Message-ID: <20050722210352.GG11916@pasky.ji.cz>
URL: https://gitlist.dev/e/20050722210352.GG11916%40pasky.ji.cz
In-Reply-To: <20050720234904.B3ED735267C@atlas.denx.de>

```
Dear diary, on Thu, Jul 21, 2005 at 01:49:04AM CEST, I got a letter
where Wolfgang Denk <wd@denx.de> told me that...
> I wander what I should do with "cg-mkpatch" generated output;  I  had
> the  impression that this should be usable with "cg-patch", but these
> are incompatible with each other.

They certainly aren't.

> Forexample. if  a  commit  contains permission changes, my generated
> patch may look like this:
> 
> 	...
> 	diff --git a/MAKEALL b/MAKEALL
> 	old mode 100644
> 	new mode 100755
> 	diff --git a/mkconfig b/mkconfig
> 	old mode 100644
> 	new mode 100755
> 	diff --git a/tools/img2brec.sh b/tools/img2brec.sh
> 	old mode 100644
> 	new mode 100755
> 	...
> 
> If I feed this into "cg-patch", I get:
> 
> 	patch: **** Only garbage was found in the patch input.

And did the changes apply? :-)

The message is surely confusing, but appeared to be rather corner-casy
and after I imagined the required complexity of filtering this, I
decided to spend my time on something more useful for the time being. :)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

```

## Wolfgang Denk, 2005-07-24 17:50

Subject: Re: Should cg-mkpatch output be usable with cg-patch?
Message-ID: <20050724175018.3D721352B73@atlas.denx.de>
URL: https://gitlist.dev/e/20050724175018.3D721352B73%40atlas.denx.de
In-Reply-To: <20050722210352.GG11916@pasky.ji.cz>

```
In message <20050722210352.GG11916@pasky.ji.cz> you wrote:
>
> > I wander what I should do with "cg-mkpatch" generated output;  I  had
> > the  impression that this should be usable with "cg-patch", but these
> > are incompatible with each other.
> 
> They certainly aren't.

Is this a problem with the current implementation, or intentional?

> > 	diff --git a/tools/img2brec.sh b/tools/img2brec.sh
> > 	old mode 100644
> > 	new mode 100755
> > 	...
> > If I feed this into "cg-patch", I get:
> > 	patch: **** Only garbage was found in the patch input.
> 
> And did the changes apply? :-)

No, they did not. No file modes were changed.

> The message is surely confusing, but appeared to be rather corner-casy
> and after I imagined the required complexity of filtering this, I
> decided to spend my time on something more useful for the time being. :)

I don't think this is a corner case. I think it is  pretty  important
to be able to promote permissiong changes.


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Too many people are ready to carry the stool when the piano needs  to
be moved.

```

## Petr Baudis, 2005-07-24 22:48

Subject: Re: Should cg-mkpatch output be usable with cg-patch?
Message-ID: <20050724224830.GG7601@pasky.ji.cz>
URL: https://gitlist.dev/e/20050724224830.GG7601%40pasky.ji.cz
In-Reply-To: <20050724175018.3D721352B73@atlas.denx.de>

```
Dear diary, on Sun, Jul 24, 2005 at 07:50:18PM CEST, I got a letter
where Wolfgang Denk <wd@denx.de> told me that...
> In message <20050722210352.GG11916@pasky.ji.cz> you wrote:
> >
> > > I wander what I should do with "cg-mkpatch" generated output;  I  had
> > > the  impression that this should be usable with "cg-patch", but these
> > > are incompatible with each other.
> > 
> > They certainly aren't.
> 
> Is this a problem with the current implementation, or intentional?

Implementation. Should be fixed now, after rewriting part of it. ;-)

> > The message is surely confusing, but appeared to be rather corner-casy
> > and after I imagined the required complexity of filtering this, I
> > decided to spend my time on something more useful for the time being. :)
> 
> I don't think this is a corner case. I think it is  pretty  important
> to be able to promote permissiong changes.

Of course. By the corner case I meant "the external patch tool invoked
by cg-patch emits bogus error in case of patch containing only mode
changes and nothing else". I wasn't aware that the changes wouldn't
apply at all - actually, I was when I was writing the code, but
completely forgot about it later.

Thanks,

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

```
