git pull fails on linux-next (out of memory)
On 2012-03-06, I cloned linux-next:
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git linux-next-20120306
I now want to update this repository before posting patches, to make sure they still apply cleanly. I first tried this on 20120328:
$ git pull remote: Counting objects: 63784, done. remote: Compressing objects: 100% (13595/13595), done. remote: Total 45829 (delta 38421), reused 38448 (delta 31414) Receiving objects: 100% (45829/45829), 9.87 MiB | 209 KiB/s, done. Resolving deltas: 100% (38421/38421), completed with 5695 local objects.
Quoted 1 line
From
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
+ 5a377dc...bc6f15c akpm-end -> origin/akpm-end (forced update)
055bf38..de8856d akpm-start -> origin/akpm-start
+ a568b5f...7734592 master -> origin/master (forced update)
055bf38..de8856d stable -> origin/stable
* [new tag] next-20120328 -> next-20120328
Quoted 1 line
From
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
* [new tag] v3.3 -> v3.3 * [new tag] v3.3-rc7 -> v3.3-rc7
warning: too many files (created: 1625 deleted: 423), skipping inexact rename detection
warning: too many files (created: 5127 deleted: 1509), skipping inexact rename detection
warning: too many files (created: 1134 deleted: 655), skipping inexact rename detection
warning: too many files (created: 4816 deleted: 3510), skipping inexact rename detection
warning: too many files (created: 1004 deleted: 544), skipping inexact rename detection
warning: too many files (created: 1734 deleted: 1778), skipping inexact rename detection
warning: too many files (created: 1069 deleted: 608), skipping inexact rename detection
warning: too many files (created: 1070 deleted: 764), skipping inexact rename detection
warning: too many files (created: 757 deleted: 405), skipping inexact rename detection
warning: too many files (created: 980 deleted: 542), skipping inexact rename detection
fatal: inflateInit: out of memory (no message)
I then "forgot" about it for a little while, doing other stuff. Tried it again today:
$ git pull remote: Counting objects: 16816, done. remote: Compressing objects: 100% (1595/1595), done. remote: Total 9491 (delta 7901), reused 9254 (delta 7678) Receiving objects: 100% (9491/9491), 2.53 MiB | 299 KiB/s, done. Resolving deltas: 100% (7901/7901), completed with 3010 local objects.
Quoted 1 line
From
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
+ bc6f15c...73bd151 akpm-end -> origin/akpm-end (forced update)
de8856d..1c03658 akpm-start -> origin/akpm-start
+ 7734592...1dc85fe master -> origin/master (forced update)
de8856d..1c03658 stable -> origin/stable
* [new tag] next-20120330 -> next-20120330
warning: too many files (created: 1625 deleted: 423), skipping inexact rename detection
warning: too many files (created: 5127 deleted: 1509), skipping inexact rename detection
warning: too many files (created: 1134 deleted: 655), skipping inexact rename detection
warning: too many files (created: 4816 deleted: 3510), skipping inexact rename detection
warning: too many files (created: 1004 deleted: 544), skipping inexact rename detection
warning: too many files (created: 1734 deleted: 1778), skipping inexact rename detection
warning: too many files (created: 1069 deleted: 608), skipping inexact rename detection
warning: too many files (created: 1070 deleted: 764), skipping inexact rename detection
warning: too many files (created: 757 deleted: 405), skipping inexact rename detection
warning: too many files (created: 1084 deleted: 773), skipping inexact rename detection
warning: too many files (created: 980 deleted: 542), skipping inexact rename detection
fatal: Out of memory? mmap failed: Cannot allocate memory
$ git gc Counting objects: 2609985, done. Delta compression using up to 2 threads. Compressing objects: 100% (392553/392553), done. Writing objects: 100% (2609985/2609985), done. Total 2609985 (delta 2197683), reused 2602739 (delta 2190459)
$ git pull warning: too many files (created: 1625 deleted: 423), skipping inexact rename detection warning: too many files (created: 5127 deleted: 1509), skipping inexact rename detection warning: too many files (created: 1134 deleted: 655), skipping inexact rename detection warning: too many files (created: 4816 deleted: 3510), skipping inexact rename detection warning: too many files (created: 1004 deleted: 544), skipping inexact rename detection warning: too many files (created: 1734 deleted: 1778), skipping inexact rename detection warning: too many files (created: 1069 deleted: 608), skipping inexact rename detection warning: too many files (created: 1070 deleted: 764), skipping inexact rename detection warning: too many files (created: 757 deleted: 405), skipping inexact rename detection warning: too many files (created: 1084 deleted: 773), skipping inexact rename detection warning: too many files (created: 980 deleted: 542), skipping inexact rename detection fatal: Out of memory? mmap failed: Cannot allocate memory
$ free
total used free shared buffers cached
Mem: 998920 309376 689544 0 10200 177252
-/+ buffers/cache: 121924 876996
Swap: 2923788 161956 2761832$ git --version git version 1.6.3.3
I cannot find anything useful using Google. It's not like I'm doing anything complicated, nor is my machine very low on memory. Do I really have to "re-clone" the repository and re-apply my patches every time I want to keep the repository up-to-date? (I've had the same problem before and used that "solution".)
Or is there some other way to do this? Perhaps there is a way to perform the pull a little bit at a time, e.g. pull linux-next-20120313, linux-next-20120320 etc?
Signature · 4 lines
Arvid Brodin Enea Services Stockholm AB - since February 16 a part of Xdin in the Alten Group. Soon we will be working under the common brand Xdin. Read more at www.xdin.com.
Quoted 95 lines · Arvid Brodin
On 2012-03-06, I cloned linux-next:
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git linux-next-20120306I now want to update this repository before posting patches, to make sure they still apply cleanly. I first tried this on 20120328:
$ git pull remote: Counting objects: 63784, done. remote: Compressing objects: 100% (13595/13595), done. remote: Total 45829 (delta 38421), reused 38448 (delta 31414) Receiving objects: 100% (45829/45829), 9.87 MiB | 209 KiB/s, done. Resolving deltas: 100% (38421/38421), completed with 5695 local objects.Quoted 1 line
From
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next+ 5a377dc...bc6f15c akpm-end -> origin/akpm-end (forced update)
055bf38..de8856d akpm-start -> origin/akpm-start
+ a568b5f...7734592 master -> origin/master (forced update)
055bf38..de8856d stable -> origin/stable
* [new tag] next-20120328 -> next-20120328Quoted 1 line
From
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next* [new tag] v3.3 -> v3.3 * [new tag] v3.3-rc7 -> v3.3-rc7warning: too many files (created: 1625 deleted: 423), skipping inexact rename detection
warning: too many files (created: 5127 deleted: 1509), skipping inexact rename detection
warning: too many files (created: 1134 deleted: 655), skipping inexact rename detection
warning: too many files (created: 4816 deleted: 3510), skipping inexact rename detection
warning: too many files (created: 1004 deleted: 544), skipping inexact rename detection
warning: too many files (created: 1734 deleted: 1778), skipping inexact rename detection
warning: too many files (created: 1069 deleted: 608), skipping inexact rename detection
warning: too many files (created: 1070 deleted: 764), skipping inexact rename detection
warning: too many files (created: 757 deleted: 405), skipping inexact rename detection
warning: too many files (created: 980 deleted: 542), skipping inexact rename detection
fatal: inflateInit: out of memory (no message)I then "forgot" about it for a little while, doing other stuff. Tried it again today:
$ git pull remote: Counting objects: 16816, done. remote: Compressing objects: 100% (1595/1595), done. remote: Total 9491 (delta 7901), reused 9254 (delta 7678) Receiving objects: 100% (9491/9491), 2.53 MiB | 299 KiB/s, done. Resolving deltas: 100% (7901/7901), completed with 3010 local objects.Quoted 1 line
From
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next+ bc6f15c...73bd151 akpm-end -> origin/akpm-end (forced update)
de8856d..1c03658 akpm-start -> origin/akpm-start
+ 7734592...1dc85fe master -> origin/master (forced update)
de8856d..1c03658 stable -> origin/stable
* [new tag] next-20120330 -> next-20120330
warning: too many files (created: 1625 deleted: 423), skipping inexact rename detection
warning: too many files (created: 5127 deleted: 1509), skipping inexact rename detection
warning: too many files (created: 1134 deleted: 655), skipping inexact rename detection
warning: too many files (created: 4816 deleted: 3510), skipping inexact rename detection
warning: too many files (created: 1004 deleted: 544), skipping inexact rename detection
warning: too many files (created: 1734 deleted: 1778), skipping inexact rename detection
warning: too many files (created: 1069 deleted: 608), skipping inexact rename detection
warning: too many files (created: 1070 deleted: 764), skipping inexact rename detection
warning: too many files (created: 757 deleted: 405), skipping inexact rename detection
warning: too many files (created: 1084 deleted: 773), skipping inexact rename detection
warning: too many files (created: 980 deleted: 542), skipping inexact rename detection
fatal: Out of memory? mmap failed: Cannot allocate memory$ git gc Counting objects: 2609985, done. Delta compression using up to 2 threads. Compressing objects: 100% (392553/392553), done. Writing objects: 100% (2609985/2609985), done. Total 2609985 (delta 2197683), reused 2602739 (delta 2190459)$ git pull warning: too many files (created: 1625 deleted: 423), skipping inexact rename detection warning: too many files (created: 5127 deleted: 1509), skipping inexact rename detection warning: too many files (created: 1134 deleted: 655), skipping inexact rename detection warning: too many files (created: 4816 deleted: 3510), skipping inexact rename detection warning: too many files (created: 1004 deleted: 544), skipping inexact rename detection warning: too many files (created: 1734 deleted: 1778), skipping inexact rename detection warning: too many files (created: 1069 deleted: 608), skipping inexact rename detection warning: too many files (created: 1070 deleted: 764), skipping inexact rename detection warning: too many files (created: 757 deleted: 405), skipping inexact rename detection warning: too many files (created: 1084 deleted: 773), skipping inexact rename detection warning: too many files (created: 980 deleted: 542), skipping inexact rename detection fatal: Out of memory? mmap failed: Cannot allocate memory$ free total used free shared buffers cached Mem: 998920 309376 689544 0 10200 177252 -/+ buffers/cache: 121924 876996 Swap: 2923788 161956 2761832$ git --version git version 1.6.3.3
Quoted 8 lines
I cannot find anything useful using Google. It's not like I'm doing anything complicated, nor is my machine very low on memory. Do I really have to "re-clone" the repository and re-apply my patches every time I want to keep the repository up-to-date? (I've had the same problem before and used that "solution".)
Or is there some other way to do this? Perhaps there is a way to perform the pull a little bit at a time, e.g. pull linux-next-20120313, linux-next-20120320 etc?
If I understand correctly, 'git pull' is "sort of" equivalent to 'git fetch; git merge'. So I tried
$ git fetch
This didn't do anything (perhaps the remote branch was already up to date from my previous pulls?).
$ git merge tags/v3.3
Weirdly enough, this gave a few conflicts on files I've never touched. Perhaps the failed git pulls above left my repository in some inconsistent state?
I solved the conflicts by hand, selecting the v3.3 versions. If I try to build the kernel in my respository now, compilation fails on (at least) one of the conflicting files.
:(
Signature · 4 lines
Arvid Brodin Enea Services Stockholm AB - since February 16 a part of Xdin in the Alten Group. Soon we will be working under the common brand Xdin. Read more at www.xdin.com.
Hi,
Quoted 10 lines · Arvid Brodin
Quoted 3 lines · Arvid Brodin
On 2012-03-06, I cloned linux-next:
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.gitlinux-next-20120306
Quoted 4 lines
I now want to update this repository before posting patches, to make sure they still apply cleanly. I first tried this on 20120328:
Tracking linux-next is a little bit different from usual trees. In particular, since Stephen Rothwell
rebases it quite frequently, you shouldn't do a git pull on linux-next.
See these articles for details on how to work with linux-next:
http://linux.f-seidel.de/linux-next/pmwiki/pmwiki.php?n=Linux-next.FAQ
http://lists.kernelnewbies.org/pipermail/kernelnewbies/2012-February/004498.html
Regards,
Srivatsa S. Bhat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120331/94f195b3/attachment.html
Quoted 16 lines · Srivatsa Bhat
Hi,
On Sat, Mar 31, 2012 at 3:40 AM, Arvid Brodin <[email protected] <mailto:[email protected]>> wrote:
Arvid Brodin wrote: > On 2012-03-06, I cloned linux-next: > > $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git <http://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git> linux-next-20120306 > > > I now want to update this repository before posting patches, to make sure > they still apply cleanly. I first tried this on 20120328:
Quoted 8 lines
Tracking linux-next is a little bit different from usual trees. In particular, since Stephen Rothwell
rebases it quite frequently, you shouldn't do a git pull on linux-next.See these articles for details on how to work with linux-next:
http://linux.f-seidel.de/linux-next/pmwiki/pmwiki.php?n=Linux-next.FAQ
http://lists.kernelnewbies.org/pipermail/kernelnewbies/2012-February/004498.html
Great links, thanks!
The first time I did 'git remote update' as described in the first link things worked
fine: I could "git merge origin/master" to be up to date with origin/master (or perhaps I did a 'git rebase origin/master, I can't quite remember).
I tried the same thing ('git remote update; git merge origin/master') today, and got lots of CONFLICTs. So I tried to get master back and after some time ended up running 'git reset --hard; git clean -f -d', which I believe succeeded.
At this time 'git status' says the same as it did just after the remote update above:
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 569 and 3251 different commit(s) each, respectively.
Ok, so let's try a 'git rebase origin/master' instead:
$ git rebase origin/master First, rewinding head to replay your work on top of it... Applying: fsnotify: inline mark refcnt functions Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging fs/notify/mark.c CONFLICT (content): Merge conflict in fs/notify/mark.c Auto-merging include/linux/fsnotify_backend.h Failed to merge in the changes. Patch failed at 0001 fsnotify: inline mark refcnt functions
When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort".
Huh?! I haven't touched that file! I just want to keep my linux-next tree up to date! How hard should this be?!
/calming down/
Any ideas on what I've done wrong and how to solve it?
Signature · 3 lines
Arvid Brodin Enea Services Stockholm AB - since February 16 a part of Xdin in the Alten Group. Soon we will be working under the common brand name Xdin. Read more at www.xdin.com.
Quoted 61 lines · Arvid Brodin
Quoted 16 lines · Srivatsa Bhat
Hi,
On Sat, Mar 31, 2012 at 3:40 AM, Arvid Brodin <[email protected] <mailto:[email protected]>> wrote:
Arvid Brodin wrote: > On 2012-03-06, I cloned linux-next: > > $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git <http://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git> linux-next-20120306 > > > I now want to update this repository before posting patches, to make sure > they still apply cleanly. I first tried this on 20120328:Quoted 8 lines
Tracking linux-next is a little bit different from usual trees. In particular, since Stephen Rothwell
rebases it quite frequently, you shouldn't do a git pull on linux-next.See these articles for details on how to work with linux-next:
http://linux.f-seidel.de/linux-next/pmwiki/pmwiki.php?n=Linux-next.FAQ
http://lists.kernelnewbies.org/pipermail/kernelnewbies/2012-February/004498.htmlGreat links, thanks!
The first time I did 'git remote update' as described in the first link things worked
fine: I could "git merge origin/master" to be up to date with origin/master (or perhaps I did a 'git rebase origin/master, I can't quite remember).I tried the same thing ('git remote update; git merge origin/master') today, and got lots of CONFLICTs. So I tried to get master back and after some time ended up running 'git reset --hard; git clean -f -d', which I believe succeeded.
At this time 'git status' says the same as it did just after the remote update above:
# On branch master
# Your branch and 'origin/master' have diverged,# and have 569 and 3251 different commit(s) each, respectively.Ok, so let's try a 'git rebase origin/master' instead:
$ git rebase origin/master First, rewinding head to replay your work on top of it... Applying: fsnotify: inline mark refcnt functions Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging fs/notify/mark.c CONFLICT (content): Merge conflict in fs/notify/mark.c Auto-merging include/linux/fsnotify_backend.h Failed to merge in the changes. Patch failed at 0001 fsnotify: inline mark refcnt functionsWhen you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort".
Quoted 7 lines
Huh?! I haven't touched that file! I just want to keep my linux-next tree up to date! How hard should this be?!
/calming down/
Any ideas on what I've done wrong and how to solve it?
I don't see why you should have run git merge origin/master etc..
Simply track linux-next like this:
Initial setup:
1. Add linux-next as a remote tracking branch to your existing kernel
git tree:
git remote add linux-next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
2. Fetch it, along with the tags:
git fetch linux-next
git fetch --tags linux-next
Regular usage/tracking:
1. Update your linux-next:
git checkout master //to be on the safer side
git remote update
2. See what tags are available:
git tag -l next-*
Sample output:
next-20120113
next-20120118
next-20120201
3. Pick the linux-next version you want to work on and create a local branch to do your changes:
git checkout -b my_branch next-20120201
Then you can start working on 'my_branch'.
Regards,
Srivatsa S. Bhat