{"thread":{"id":"46425","subject":"Bug Report - Segmentation Fault on \"git add --all\"","startedAt":"2017-07-20T00:55:09Z","lastAt":"2017-07-20T05:01:46Z","messageCount":2,"participants":["Tillson Galloway","Martin Ågren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"324787","messageId":"CAO1QjAFGnK+riGT_ZffM_-=ymJm08U8adOfHV4wrhR9LJLhSAA@mail.gmail.com","threadId":"46425","inReplyTo":null,"subject":"Bug Report - Segmentation Fault on \"git add --all\"","fromName":"Tillson Galloway","fromEmail":"tillson.galloway@gmail.com","sentAt":"2017-07-20T00:54:44Z","receivedAt":"2017-07-20T00:55:09Z","isPatch":false,"sender":{"key":"tillson.galloway@gmail.com","avatar":null},"body":"Context:\nWe currently have a git project with a root directory (\"~/project\")\nfor pipelines and deployment of a Node app, and then a subdirectory\n(\"~/project/project-app\").\nAfter realizing that we didn't need the node app in a subdirectory, we\nmoved the full app into the root directory (using the mv command).\n\nThe Problem:\nOur node_modules folder is being tracked by git (173MB) and was moved\ninto the root directory along with the other files.  After moving the\nfiles, I ran \"git add --all\" in order to track the new files.  Rather\nthan the expected output of the (albeit very long) list of files, I\nwas presented with a segmentation fault error.\n\n[1]    90837 segmentation fault  git add --all\n\n\nAttempting to run other git commands (commit, add) now responds with:\n\nfatal: Unable to create '/Users/tillson/project/.git/index.lock': File exists.\n\nRunning \"git status\" shows that git successfully tracked that the\noriginal files within ~/project/project-app were deleted, but it did\nnot pick up the \"newly created\" files from moving.\nRemoving .git/index.lock (an empty file) allows for me to run \"git\ncommit\" but no changes are recorded (\"no changes added to commit\").\nRunning \"git add --all\" again causes a seg fault and repeats the\ncycle.\n\nI would assume that the cause of the seg fault was that node_modules\nheld too much data for git to be able to handle in one go.  I'm not\nsure if this is considered a (likely at this point known) bug or if\nit's just a caveat of using git.\nI am admittedly not an expert with git, so if there is anything useful\n(logs, config files, etc.) I can supply to help fix this, I'd be happy\nto.\n\nThanks,\nTillson Galloway\n"},{"id":"324789","messageId":"CAN0heSrzdfpH=ocQrC3SYLNF2K=agdKuRdscSPnnCgBMWhPRxg@mail.gmail.com","threadId":"46425","inReplyTo":"CAO1QjAFGnK+riGT_ZffM_-=ymJm08U8adOfHV4wrhR9LJLhSAA@mail.gmail.com","subject":"Re: Bug Report - Segmentation Fault on \"git add --all\"","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2017-07-20T05:01:39Z","receivedAt":"2017-07-20T05:01:46Z","isPatch":false,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 20 July 2017 at 02:54, Tillson Galloway <tillson.galloway@gmail.com> wrote:\n> Context:\n> We currently have a git project with a root directory (\"~/project\")\n> for pipelines and deployment of a Node app, and then a subdirectory\n> (\"~/project/project-app\").\n> After realizing that we didn't need the node app in a subdirectory, we\n> moved the full app into the root directory (using the mv command).\n>\n[...]\n>\n> Running \"git status\" shows that git successfully tracked that the\n> original files within ~/project/project-app were deleted, but it did\n> not pick up the \"newly created\" files from moving.\n\nSo you did \"mv project-app/* .\" and see something like\n\n  Changes not staged for commit:\n    (use \"git add/rm <file>...\" to update what will be committed)\n    (use \"git checkout -- <file>...\" to discard changes in working directory)\n\n      deleted:    ... lots of files ...\n\n? That means Git has *realized* that the files are gone, but it's not\n*tracking* that fact (yet).\n\nWhat if you restore the files and instead try \"git mv project-app/*\n.\"? It will move the files like \"mv\", but it will also do basically\nwhat you wanted to achieve with \"git add --all\". After that, you'll\njust have to \"git commit\".\n\nYou'll probably want to \"rmdir project-app/\" once it's empty. If you\nhave some structure like project-app/project-app/ the move might fail\n(should be possible to work around).\n\nThis obviously doesn't address the problem you saw and on which I\ncannot comment, but I hope it helps you do what you actually wanted to\ndo. :)\n\nMartin\n"}]}