{"thread":{"id":"9805","subject":"inconsistent use of worktree?","startedAt":"2007-09-06T13:29:06Z","lastAt":"2007-09-15T15:23:03Z","messageCount":3,"participants":["martin f krafft"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"52748","messageId":"20070906132906.GA7791@piper.oerlikon.madduck.net","threadId":"9805","inReplyTo":null,"subject":"inconsistent use of worktree?","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-09-06T13:29:06Z","receivedAt":"2007-09-06T13:29:06Z","isPatch":false,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"Hi there,\n\nI have a $GIT_DIR in ~/.bin/colgit.git, which is bare=false and has\nworktree=.. (the parent). This relates back to a suggestion by\nJohannes Schindelin [0] for maintaining files like ~/.vimrc and\n~/.zshrc in separate repos sharing the same worktree. In short:\nwhile ~/.bin/colgit.git holds all of colgit's objects, refs, and the\nindex, the repository's files are in ~/.bin (and thus in $PATH).\n\n0. http://marc.info/?l=git&m=118418927823760&w=2\n\nI am trying to figure out a sensible way to work with this, ideally\none which does not require me to set $GIT_DIR (which works):\n\n  GIT_DIR=~/.bin/colgit.git git status\n  GIT_DIR=~/.bin/colgit.git git add ...\n  GIT_DIR=~/.bin/colgit.git git commit ...\n  (or one export GIT_DIR)\n\nbut that's a lot of typing and thus error-prone.\n\nSo in a flash of utter genius, I found this to work:\n\n  piper:~/.bin/colgit.git> git status\n  # On branch master\n  # Changed but not updated:\n  #   (use \"git add <file>...\" to update what will be committed)\n  #\n  #       modified:   colgit\n  #\n  no changes added to commit (use \"git add\" and/or \"git commit -a\")\n\n  piper:~/.bin/colgit.git> git add ../colgit\n\n  piper:~/.bin/colgit.git> git status\n  # On branch master\n  # Changes to be committed:\n  #   (use \"git reset HEAD <file>...\" to unstage)\n  #\n  #       modified:   colgit\n\nand I rejoiced, because that's really pretty cool. But then, trying\nto commit, reality hit back:\n\n  piper:~/.bin/colgit.git> git commit -m'initial commit'\n  nothing to commit (use \"git add file1 file2\" to include for commit)\n\nSo I had to revert to using GIT_DIR for this:\n\n  piper:~/.bin> GIT_DIR=colgit.git git commit -m'initial commit'\n  Created initial commit 008594d: initial commit\n   1 files changed, 104 insertions(+), 0 deletions(-)\n   create mode 100755 colgit\n\nAnd then things got really weird, after I accidentally tried the\ndirect commit (without GIT_DIR) again, following some touchups\nI made to the colgit file:\n\n  piper:~/.bin/colgit.git> git commit -m'repairing registration and other touchups'\n  Created commit acd86b9: Merge branch 'vimplate'\n\nHuh, vimplate? What happened to the commit? Why vimplate?\n\n  piper:~/.bin/colgit.git> git log\n  commit 0ad26b00c31617bf3e31a052e3c3af9ef661407b\n  Author: martin f. krafft <madduck@madduck.net>\n  Date:   Thu Sep 6 11:45:38 2007 +0200\n\n      repairing registration and other touchups\n\n  [...]\n\nBut the commit appears alright, acd86b9 is the tip of ~/.git,\nfurther up, and the output of git-rev-parse HEAD in ~/.bin, the\nparent directory and worktree of ~/.bin/colgit.git.\n\nWhat is git doing? Could it be that it's getting utterly confused\nand inconsistently uses the worktree? I'd be happy to investigate\nthis, but want to make sure I am not doing anything wrong!\n\nCheers,\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \n\"there are more things in heaven and earth, horatio,\n than are dreamt of in your philosophy.\"\n                                                             -- hamlet\n \nspamtraps: madduck.bogus@madduck.net\n"},{"id":"52749","messageId":"20070906134138.GA8548@piper.oerlikon.madduck.net","threadId":"9805","inReplyTo":"20070906132906.GA7791@piper.oerlikon.madduck.net","subject":"Re: inconsistent use of worktree?","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-09-06T13:41:38Z","receivedAt":"2007-09-06T13:41:38Z","isPatch":false,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach martin f krafft <madduck@madduck.net> [2007.09.06.1529 +0200]:\n> What is git doing? Could it be that it's getting utterly confused\n> and inconsistently uses the worktree? I'd be happy to investigate\n> this, but want to make sure I am not doing anything wrong!\n\ngit-commit -a also does not work:\n\n  piper:~/.bin/colgit.git> git commit -m'add list action to enumerate all known repos' -a\n  error: .bin/colgit: cannot add to the index - missing --add option?\n  fatal: Unable to process path .bin/colgit\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \nredistribution of this email via the\nmicrosoft network is prohibited.\n \nspamtraps: madduck.bogus@madduck.net\n"},{"id":"53124","messageId":"20070915152303.GA12859@piper.oerlikon.madduck.net","threadId":"9805","inReplyTo":"20070906134138.GA8548@piper.oerlikon.madduck.net","subject":"inconsistent use of worktree? (resend)","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-09-15T15:23:03Z","receivedAt":"2007-09-15T15:23:03Z","isPatch":false,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"[this message received no replies, I thus resend once with Matthias\nand Johannes on Cc, and slightly modified]\n\nHi there,\n\nI have a $GIT_DIR in ~/.bin/colgit.git, which is bare=false and has\nworktree=.. (the parent). This relates back to a suggestion by\nJohannes Schindelin [0] for maintaining files like ~/.vimrc and\n~/.zshrc in separate repos sharing the same worktree. In short:\nwhile ~/.bin/colgit.git holds all of colgit's objects, refs, and the\nindex, the repository's files are in ~/.bin (and thus in $PATH).\n\n0. http://marc.info/?l=git&m=118418927823760&w=2\n\nI am trying to figure out a sensible way to work with this, ideally\none which does not require me to set $GIT_DIR (which works):\n\n  GIT_DIR=~/.bin/colgit.git git status\n  GIT_DIR=~/.bin/colgit.git git add ...\n  GIT_DIR=~/.bin/colgit.git git commit ...\n  (or one export GIT_DIR)\n\nbut that's a lot of typing and thus error-prone.\n\nI found this to work:\n\n  piper:~/.bin/colgit.git> git status\n  # On branch master\n  # Changed but not updated:\n  #   (use \"git add <file>...\" to update what will be committed)\n  #\n  #       modified:   colgit\n  #\n  no changes added to commit (use \"git add\" and/or \"git commit -a\")\n\n  piper:~/.bin/colgit.git> git add ../colgit\n\n  piper:~/.bin/colgit.git> git status\n  # On branch master\n  # Changes to be committed:\n  #   (use \"git reset HEAD <file>...\" to unstage)\n  #\n  #       modified:   colgit\n\nand I rejoiced, because that's really pretty cool. But then, trying\nto commit, reality hit back:\n\n  piper:~/.bin/colgit.git> git commit -m'initial commit'\n  nothing to commit (use \"git add file1 file2\" to include for commit)\n\nSo I had to revert to using GIT_DIR for this:\n\n  piper:~/.bin> GIT_DIR=colgit.git git commit -m'initial commit'\n  Created initial commit 008594d: initial commit\n   1 files changed, 104 insertions(+), 0 deletions(-)\n   create mode 100755 colgit\n\nAnd then things got really weird, after I accidentally tried the\ndirect commit (without GIT_DIR) again, following some touchups\nI made to the colgit file:\n\n  piper:~/.bin/colgit.git> git commit -m'repairing registration and other touchups'\n  Created commit acd86b9: Merge branch 'vimplate'\n\nFirst, it seems that commits work just fine for changes made only to\nfiles already tracked by git, but not if a commit introduces a new\nfile.\n\nBut second, git-commit does appear to get really confused, since\nthe commit it claims to have just created is actually not part of\nthe current repository, but rather the HEAD of the repository in\n~/.git (which tracks ~).\n\ngit-commit -a also does not work:\n\n  piper:~/.bin/colgit.git> git commit -m'add list action to enumerate all known repos' -a\n  error: .bin/colgit: cannot add to the index - missing --add option?\n  fatal: Unable to process path .bin/colgit\n\nAnd finally, git-diff seems to think that I removed the file, rather\nthan to show differences:\n\npiper:~/.bin/colgit.git> git diff | diffstat                                                    #[334]\n colgit |  138 -----------------------------------------------------------------\n 1 file changed, 138 deletions(-)\n\nWhen in fact:\n\npiper:~/.bin> GIT_DIR=colgit.git git diff | diffstat                                            #[342]\n colgit |    1 +\n 1 file changed, 1 insertion(+)\n\nIt seems to me that worktree support is still somewhat buggy. Has\nanyone experienced similar things? Does anyone have an idea what\nthis could be about?\n\nI hope to be able to go through the code in the near future but\nI first have to learn a lot about git innards, so this could take\na while. Maybe Matthias has a clue? I'd be happy yo test.\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \n\"i wish there was a knob on the tv to turn up the intelligence.\n there's a knob called 'brightness', but it doesn't seem to work.\"\n                                                          -- gallagher\n \nspamtraps: madduck.bogus@madduck.net\n"}]}