{"thread":{"id":"15975","subject":"Re: [PATCH] -C/--chdir command line option","startedAt":"2008-10-20T07:28:03Z","lastAt":"2008-10-20T07:28:03Z","messageCount":1,"participants":["Maciej Pasternacki"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"93488","messageId":"2C311251-D0C3-4962-9EDE-02383C6B9A1C@pasternacki.net","threadId":"15975","inReplyTo":"DDFCD680-C477-4BE5-AB71-3F26048E26D1@pasternacki.net","subject":"Re: [PATCH] -C/--chdir command line option","fromName":"Maciej Pasternacki","fromEmail":"maciej@pasternacki.net","sentAt":"2008-10-20T07:28:03Z","receivedAt":"2008-10-20T07:28:03Z","isPatch":true,"sender":{"key":"maciej@pasternacki.net","avatar":"https://gravatar.com/avatar/6485c5851d08fb9492fd6b9528e10b730c82320a0665560401c417a5f9209773?d=mp&s=160"},"body":"On 2008-10-20, at 06:55, Junio C Hamano wrote:\n\n>>> As for -C being superfluous: --git-dir and --work-tree seem to  \n>>> support\n>>> weird usage patterns (like work tree separate from git-dir), but  \n>>> it seems\n>>\n>> Hmm. Yeah, thinking about it more, -C is not really superfluous with\n>> respect to those options. You don't want to say \"here is the work- \n>> tree,\n>> and here is the git-dir\". You want to say \"find the work-tree and\n>> git-dir for me using the usual rules, as if I were in this  \n>> directory.\"\n>\n> I think that interpretation of -C, if the option existed, makes  \n> sense, but\n> I do not understand why the tool that drives git refuses to chdir to  \n> the\n> repository for itself in the first place.\n\nThe tool (a) manages many repositories, and I don't want to chdir()  \nback and forth, (b) should be able to manage those repositories not  \ndisturbing anything other.  It comes as a Common Lisp library, which  \nwill usually be called by end user, but can also be called  \nprogrammatically, and I wouldn't want any library to change my cwd; it  \ncould chdir() back, of course, but this would still be a race  \ncondition if other threads were running at the same time.\n\nAnd there is the Lisp-specific thing, that the language comes from  \nbefore Unix domination, and things as simple as changing the process'  \ncwd are actually nontrivial to do portably (there is equivalent of cwd  \ninside Lisp world, which is used by Lisp-level file access routines,  \nbut chdir() is not in ANSI standard, is done differently by every  \nimplementation, and would require some kind of compatibility layer).\n\nFor me, -C would make life much easier, and I gave other arguments for  \nit before.  It would suffice if --work-tree worked with \"git pull\", if  \n-C doesn't pass, but it seems to me that -C has some merits.\n\nRegards,\nMaciej.\n\n-- \n-><- Maciej Pasternacki -><- http://www.pasternacki.net/ -><-\n"}]}