{"thread":{"id":"9505","subject":"[BUG] git --work-tree=... status","startedAt":"2007-08-12T18:58:56Z","lastAt":"2007-08-17T11:50:51Z","messageCount":3,"participants":["Uwe Kleine-König","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"50573","messageId":"20070812185855.GA16704@informatik.uni-freiburg.de","threadId":"9505","inReplyTo":null,"subject":"[BUG] git --work-tree=... status","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-08-12T18:58:56Z","receivedAt":"2007-08-12T18:58:56Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\nI don't have time now to look into it, so for now as usual just a\nreport.  If nobody takes it, I will do it later.\n\n\tzeisberg@cassiopeia:~/gsrc/git$ git version\n\tgit version 1.5.3.rc4.887.gd56871c\n\n[That's Junio's next + my doc change \"checkout-index doc: use --work-dir in\nthe export example\"]\n\n\tzeisberg@cassiopeia:~/gsrc/git$ mkdir export\n\n\tzeisberg@cassiopeia:~/gsrc/git$ git --work-tree=export checkout-index -a\n\n\tzeisberg@cassiopeia:~/gsrc/git$ git --work-tree=export status\n\tfatal: /home/zeisberg/usr/bin/git-status cannot be used without a working tree.\n\nrunstatus works as expected (at least after some thought):\n\n\tzeisberg@cassiopeia:~/gsrc/git$ git --work-tree=export runstatus | head\n\t# On branch next\n\t# Changed but not updated:\n\t#   (use \"git add <file>...\" to update what will be committed)\n\t#\n\t#       modified:   .gitignore\n\t#       modified:   .mailmap\n\t#       modified:   COPYING\n\t#       modified:   Documentation/.gitignore\n\t#       modified:   Documentation/Makefile\n\t#       modified:   Documentation/RelNotes-1.5.0.1.txt\n\nThe problem seems to be that require_work_tree demands more that I think\nit should.  It calls `git rev-parse --is-inside-work-tree`.\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\nhttp://www.google.com/search?q=1+newton+in+kg*m+%2F+s%5E2\n"},{"id":"50579","messageId":"7vlkcgim5w.fsf@assigned-by-dhcp.cox.net","threadId":"9505","inReplyTo":"20070812185855.GA16704@informatik.uni-freiburg.de","subject":"Re: [BUG] git --work-tree=... status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-12T19:32:27Z","receivedAt":"2007-08-12T19:32:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Uwe Kleine-König  <ukleinek@informatik.uni-freiburg.de> writes:\n\n> The problem seems to be that require_work_tree demands more that I think\n> it should.  It calls `git rev-parse --is-inside-work-tree`.\n\nI think the semantics of require_work_tree is (currently and has\nbeen) indeed \"you are supposed to be inside the work tree\".\n\n\"git-status $args\" is a \"git commit --dry-run $args\" and $args\nare often filenames relative to $cwd that name paths to include\nin the partial commit, so for this particular case I think it is\nunderstandable that it wants you to be _IN_ the work tree.\n\nYou can propose alternative semantics to \"git status\" that is\ndefined as \"cd_to_toplevel && git diff --cached && git diff\"\nthat does not care any of the $args, and I personally am open to\nsuch a departure from \"commit --dry-run\" semantics, which have\nbeen there since 1.4.0 days.  But that is a huge user level\nsemantics change, and will not belong to the 1.5.X series.\n"},{"id":"50932","messageId":"20070817115051.GA11107@informatik.uni-freiburg.de","threadId":"9505","inReplyTo":"7vlkcgim5w.fsf@assigned-by-dhcp.cox.net","subject":"Re: [BUG] git --work-tree=... status","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-08-17T11:50:51Z","receivedAt":"2007-08-17T11:50:51Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Uwe Kleine-König  <ukleinek@informatik.uni-freiburg.de> writes:\n> \n> > The problem seems to be that require_work_tree demands more that I think\n> > it should.  It calls `git rev-parse --is-inside-work-tree`.\n> \n> I think the semantics of require_work_tree is (currently and has\n> been) indeed \"you are supposed to be inside the work tree\".\n> \n> \"git-status $args\" is a \"git commit --dry-run $args\" and $args\n> are often filenames relative to $cwd that name paths to include\n> in the partial commit, so for this particular case I think it is\n> understandable that it wants you to be _IN_ the work tree.\nAn (IMHO better) alternative is to introduce two flags---say\n--absolute-paths and --relative-paths.  --relative-paths is the default\nif you're in a work tree, otherwise it's --absolute-paths.\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\nfib where fib = 0 : 1 : zipWith (+) fib (tail fib)\n"}]}