all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* no patch applies
@ 2016-08-05  3:28 Catonano
  2016-08-05  3:45 ` Leo Famulari
  0 siblings, 1 reply; 6+ messages in thread
From: Catonano @ 2016-08-05  3:28 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

this is not specific to Guix, but because applying patches is central in
the Guix workflow, I argue I can ask here

Erik Edrosa sent a patch to the dev list containing a very cute Guile
Scheme package he made

I attempted to apply the patch onto a fresh Guix master and the patch does
not apply, I don't know why

I also attempted to apply ng0's patches related to gnunet, they don't apply
either.

Doesn't any patch apply ? Why ?

[-- Attachment #2: Type: text/html, Size: 541 bytes --]

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

* Re: no patch applies
  2016-08-05  3:28 no patch applies Catonano
@ 2016-08-05  3:45 ` Leo Famulari
  2016-08-05  7:59   ` Vincent Legoll
  0 siblings, 1 reply; 6+ messages in thread
From: Leo Famulari @ 2016-08-05  3:45 UTC (permalink / raw)
  To: Catonano; +Cc: help-guix

On Fri, Aug 05, 2016 at 05:28:58AM +0200, Catonano wrote:
> this is not specific to Guix, but because applying patches is central in
> the Guix workflow, I argue I can ask here
> 
> Erik Edrosa sent a patch to the dev list containing a very cute Guile
> Scheme package he made
> 
> I attempted to apply the patch onto a fresh Guix master and the patch does
> not apply, I don't know why

How are you trying to apply the patch?

I saved the patch onto my computer, and then I applied it like this on
top of commit f467c35261:

$ git am ~/tmp/0001-gnu-Add-guile-commonmark.patch
Applying: gnu: Add guile-commonmark

It also worked when I used the patch command:

$ patch -p1 < ~/tmp/0001-gnu-Add-guile-commonmark.patch  
patching file gnu/packages/guile.scm

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

* Re: no patch applies
  2016-08-05  3:45 ` Leo Famulari
@ 2016-08-05  7:59   ` Vincent Legoll
  2016-08-05 10:09     ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: Vincent Legoll @ 2016-08-05  7:59 UTC (permalink / raw)
  To: Leo Famulari; +Cc: help-guix

Hello

>> I attempted to apply the patch onto a fresh Guix master and the patch does
>> not apply, I don't know why

When I fail to apply a patch that's often because of a wrong -p parameter.
Try with "--dry-run -p0" or "--dry-run -p1" to find the good one. You can also
look at file paths in the patch and deduce the right path strip level.

-- 
Vincent Legoll

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

* Re: no patch applies
  2016-08-05  7:59   ` Vincent Legoll
@ 2016-08-05 10:09     ` Ricardo Wurmus
  2016-08-05 13:07       ` Catonano
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2016-08-05 10:09 UTC (permalink / raw)
  To: Vincent Legoll; +Cc: help-guix


Vincent Legoll <vincent.legoll@gmail.com> writes:

> Hello
>
>>> I attempted to apply the patch onto a fresh Guix master and the patch does
>>> not apply, I don't know why
>
> When I fail to apply a patch that's often because of a wrong -p parameter.
> Try with "--dry-run -p0" or "--dry-run -p1" to find the good one. You can also
> look at file paths in the patch and deduce the right path strip level.

I haven’t used “patch” in quite a while because usually “git am
the-patch-file” just works.  If the patch was created with “git
format-patch” against master you shouldn’t have any problems using “git
am” on it.

~~ Ricardo

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

* Re: no patch applies
  2016-08-05 10:09     ` Ricardo Wurmus
@ 2016-08-05 13:07       ` Catonano
  0 siblings, 0 replies; 6+ messages in thread
From: Catonano @ 2016-08-05 13:07 UTC (permalink / raw)
  To: Ricardo Wurmus, Leo Famulari; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]

2016-08-05 12:09 GMT+02:00 Ricardo Wurmus <rekado@elephly.net>:

>
> Vincent Legoll <vincent.legoll@gmail.com> writes:
>
> > Hello
> >
> >>> I attempted to apply the patch onto a fresh Guix master and the patch
> does
> >>> not apply, I don't know why
> >
> > When I fail to apply a patch that's often because of a wrong -p
> parameter.
> > Try with "--dry-run -p0" or "--dry-run -p1" to find the good one. You
> can also
> > look at file paths in the patch and deduce the right path strip level.
>
> I haven’t used “patch” in quite a while because usually “git am
> the-patch-file” just works.  If the patch was created with “git
> format-patch” against master you shouldn’t have any problems using “git
> am” on it.
>
> ~~ Ricardo
>
>
>
Thank you all people for your help. I appreciate that.

Yes, Ricardo, you nailed it

I had attempted with

  git apply --check path/to/the.patch

because I read that it is a good idea to verify the applicability of a
patch before actually applying it

Then I tried with a simple

  git am path/to/the.patch

and it worked like a breeze

I looked at the log and there's the commit of the patch on top of f467c35261

I had wrongly assumed that "git apply --check.." and "git am..." would have
envisioned the same process

So what's the use case for "git apply --check.." ? Bah...

Thanks again

[-- Attachment #2: Type: text/html, Size: 2192 bytes --]

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

* Re: no patch applies
@ 2016-08-06 17:12 David Craven
  0 siblings, 0 replies; 6+ messages in thread
From: David Craven @ 2016-08-06 17:12 UTC (permalink / raw)
  To: help-guix

From the git docs:

> This command applies the patch but does not create a commit.
> Use git-am[1] to create commits from patches generated by
> git-format-patch[1] and/or received by email.

When you do:
git diff > a-patch.patch
git reset --hard
git apply a-patch.patch

the a-patch.patch file doesn't contain a header like this one:
```
From 7ae32701d13295eb380455af885eaf466303368c Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Sun, 12 Jun 2016 21:15:00 +0200
Subject: [PATCH] kde porting aids
```

and git am fails when it's applied. The same is true for git format-patch
and git apply.

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

end of thread, other threads:[~2016-08-06 17:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-05  3:28 no patch applies Catonano
2016-08-05  3:45 ` Leo Famulari
2016-08-05  7:59   ` Vincent Legoll
2016-08-05 10:09     ` Ricardo Wurmus
2016-08-05 13:07       ` Catonano
  -- strict thread matches above, loose matches on Subject: below --
2016-08-06 17:12 David Craven

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

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.