{"thread":{"id":"29368","subject":"The shared Git repo used by git-new-workdir","startedAt":"2012-01-14T20:59:14Z","lastAt":"2012-01-16T19:15:22Z","messageCount":4,"participants":["Hilco Wijbenga","Holger Hellmuth"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"182563","messageId":"CAE1pOi3fBUBeNuhJqtJhxuMfz2G3iYOJy7U2HX6Nv4kqjcbnhw@mail.gmail.com","threadId":"29368","inReplyTo":null,"subject":"The shared Git repo used by git-new-workdir","fromName":"Hilco Wijbenga","fromEmail":"hilco.wijbenga@gmail.com","sentAt":"2012-01-14T20:59:14Z","receivedAt":"2012-01-14T20:59:14Z","isPatch":false,"sender":{"key":"hilco.wijbenga@gmail.com","avatar":null},"body":"Hi all,\n\nFirst off, I use git-new-workdir a lot and it's working great. Kudos\nto its developers!\n\nI have been looking at the Git clone that is at the root of\ngit-new-workdir (i.e. the repository that is reused by all my\ngit-new-workdir created directories). This repo shows a lot of\nactivity when I run \"git status\" there.\n\nSo now I'm wondering. Should I simply ignore this completely? Or is\nthere some \"clean up\" I can do so that \"git status\" shows nothing? Or\nwould I destroy my git-new-workdir directories doing that? So far I've\nonly used this repo to create branches (i.e. to run git-new-workdir).\n\nI would like to understand a bit better how I should treat this repo.\nWhether it's basically a \"do-not-touch\" environment or whether I can\nsafely treat it as a normal Git repo.\n\nCheers,\nHilco\n"},{"id":"182616","messageId":"4F1467C1.504@ira.uka.de","threadId":"29368","inReplyTo":"CAE1pOi3fBUBeNuhJqtJhxuMfz2G3iYOJy7U2HX6Nv4kqjcbnhw@mail.gmail.com","subject":"Re: The shared Git repo used by git-new-workdir","fromName":"Holger Hellmuth","fromEmail":"hellmuth@ira.uka.de","sentAt":"2012-01-16T18:09:05Z","receivedAt":"2012-01-16T18:09:05Z","isPatch":false,"sender":{"key":"hellmuth@ira.uka.de","avatar":null},"body":"On 14.01.2012 21:59, Hilco Wijbenga wrote:\n> Hi all,\n>\n> First off, I use git-new-workdir a lot and it's working great. Kudos\n> to its developers!\n>\n> I have been looking at the Git clone that is at the root of\n> git-new-workdir (i.e. the repository that is reused by all my\n> git-new-workdir created directories). This repo shows a lot of\n> activity when I run \"git status\" there.\n>\n> So now I'm wondering. Should I simply ignore this completely? Or is\n> there some \"clean up\" I can do so that \"git status\" shows nothing? Or\n> would I destroy my git-new-workdir directories doing that? So far I've\n> only used this repo to create branches (i.e. to run git-new-workdir).\n>\n> I would like to understand a bit better how I should treat this repo.\n> Whether it's basically a \"do-not-touch\" environment or whether I can\n> safely treat it as a normal Git repo.\n\nTake a look at the rather simple script git-new-workdir (everything \nimportant happens in the last 20 lines). It just makes logical links to \nall files (mostly directories) under .git except three files that relate \nto the index (mainly the index file itself and HEAD)\n\nThat would suggest that normal git operations operating on files in \nthose directories happen identical whether you are in the root repo or \nin any of the satellites. Only where the whole repo is acted upon (git \nclone, cp/rsync or deletion of the whole repo) the root repo would be \n\"special\".\n"},{"id":"182619","messageId":"CAE1pOi3JocCoDGAmpCYdGdJN4E1nz8O4_i0MtLhwhP_axmH-uw@mail.gmail.com","threadId":"29368","inReplyTo":"4F1467C1.504@ira.uka.de","subject":"Re: The shared Git repo used by git-new-workdir","fromName":"Hilco Wijbenga","fromEmail":"hilco.wijbenga@gmail.com","sentAt":"2012-01-16T18:57:12Z","receivedAt":"2012-01-16T18:57:12Z","isPatch":false,"sender":{"key":"hilco.wijbenga@gmail.com","avatar":null},"body":"On 16 January 2012 10:09, Holger Hellmuth <hellmuth@ira.uka.de> wrote:\n> On 14.01.2012 21:59, Hilco Wijbenga wrote:\n> Take a look at the rather simple script git-new-workdir (everything\n> important happens in the last 20 lines). It just makes logical links to all\n> files (mostly directories) under .git except three files that relate to the\n> index (mainly the index file itself and HEAD)\n\nYes, I did that but I cannot figure out from that why I see lots of\nfiles and such staged for commit on master when I almost never work on\nmaster. I only use master to pull in upstream and to merge in one of\nmy branches and push. So unless I'm doing that, I would expect \"git\nstatus\" to not output anything.\n\n> That would suggest that normal git operations operating on files in those\n> directories happen identical whether you are in the root repo or in any of\n> the satellites. Only where the whole repo is acted upon (git clone, cp/rsync\n> or deletion of the whole repo) the root repo would be \"special\".\n\nThat all makes sense to me and is what I was expecting. So why is \"git\nstatus\" on master displaying anything?\n\nHere is what I see:\n\nIn my working directory:\nhilco@centaur /mnt/lacie/workspaces/my-project-master\nmy-project-master (master $ u=)$ git status\n# On branch master\nnothing to commit (working directory clean)\n\nIn the shared repo:\nhilco@centaur ~/git-clones/my-project my-project (master +$ u=)$ git status\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       deleted:    .gitattributes\n#       modified:   .gitignore\n#       new file:   ...\n... hundreds more ...\n\nIs this related to my use of a symlink? I have a symlink\n\"~/workspaces\" pointing to /mnt/lacie/workspaces/. Is that somehow\naffecting things?\n"},{"id":"182625","messageId":"4F14774A.40100@ira.uka.de","threadId":"29368","inReplyTo":"CAE1pOi3JocCoDGAmpCYdGdJN4E1nz8O4_i0MtLhwhP_axmH-uw@mail.gmail.com","subject":"Re: The shared Git repo used by git-new-workdir","fromName":"Holger Hellmuth","fromEmail":"hellmuth@ira.uka.de","sentAt":"2012-01-16T19:15:22Z","receivedAt":"2012-01-16T19:15:22Z","isPatch":false,"sender":{"key":"hellmuth@ira.uka.de","avatar":null},"body":"On 16.01.2012 19:57, Hilco Wijbenga wrote:\n> In my working directory:\n> hilco@centaur /mnt/lacie/workspaces/my-project-master\n> my-project-master (master $ u=)$ git status\n> # On branch master\n> nothing to commit (working directory clean)\n>\n> In the shared repo:\n> hilco@centaur ~/git-clones/my-project my-project (master +$ u=)$ git status\n> # On branch master\n> # Changes to be committed:\n> #   (use \"git reset HEAD<file>...\" to unstage)\n> #\n> #       deleted:    .gitattributes\n> #       modified:   .gitignore\n> #       new file:   ...\n> ... hundreds more ...\n\nThis is related to your using two repos with the same branch \n(irrespective of root repo or not).\n\nThere is nothing wrong with that per se, but if you add/commit/merge etc \nin one of those two, the working directory and index of the other repo \ndoesn't get updated automatically. You would have to do \"git reset \n--hard\" in that repo to get it up-to-date\n\nIf you want to avoid this just don't check out the same branch in any \ntwo repos, root or not.\n"}]}