{"thread":{"id":"7792","subject":"adding file by absolute name -- problem","startedAt":"2007-04-23T09:39:03Z","lastAt":"2007-04-23T14:23:18Z","messageCount":9,"participants":["Yakov Lerner","Junio C Hamano","Johannes Schindelin","Julian Phillips","Carlos Rica"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"40185","messageId":"f36b08ee0704230239i4892983q4feb4a1872a320ea@mail.gmail.com","threadId":"7792","inReplyTo":null,"subject":"adding file by absolute name -- problem","fromName":"Yakov Lerner","fromEmail":"iler.ml@gmail.com","sentAt":"2007-04-23T09:39:03Z","receivedAt":"2007-04-23T09:39:03Z","isPatch":false,"sender":{"key":"iler.ml@gmail.com","avatar":null},"body":"When I give absolute pathname /a/b/repo/d to git add, it\nmostly does not work. I get errors from git-add. Is it by design ?\n\n(When I cd to repo and fo 'git-add d', it works. But\n'git-add `pwd`/d' gives error. I use scrits that wrap git-add\nand give it mostly absolute names, and they fail).\n\nBesides, I get infinite loop in git-add (1.5.1.1) when several\nabsolute names are given to git-add. I am trying to investigate it\n\nYakov\n"},{"id":"40187","messageId":"7v8xcjh0e8.fsf@assigned-by-dhcp.cox.net","threadId":"7792","inReplyTo":"f36b08ee0704230239i4892983q4feb4a1872a320ea@mail.gmail.com","subject":"Re: adding file by absolute name -- problem","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-04-23T10:04:47Z","receivedAt":"2007-04-23T10:04:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Yakov Lerner\" <iler.ml@gmail.com> writes:\n\n> When I give absolute pathname /a/b/repo/d to git add, it\n> mostly does not work. I get errors from git-add. Is it by design ?\n\nIt's pretty much by design in the sense that none of us felt any\nneed for accepting absolute pathnames, and I personally still\ndon't.  But I do not have a strong feeling against accepting a\npatch series that adds support for accepting absolute pathnames,\nas long as it is done cleanly and obviously.\n"},{"id":"40188","messageId":"Pine.LNX.4.64.0704231215370.8822@racer.site","threadId":"7792","inReplyTo":"f36b08ee0704230239i4892983q4feb4a1872a320ea@mail.gmail.com","subject":"Re: adding file by absolute name -- problem","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-04-23T10:16:30Z","receivedAt":"2007-04-23T10:16:30Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 23 Apr 2007, Yakov Lerner wrote:\n\n> When I give absolute pathname /a/b/repo/d to git add, it\n> mostly does not work. I get errors from git-add. Is it by design ?\n\nAFAICT it is by design. I fail to see why absolute paths should be \nsupported, too. You are supposed to be _in_ the working directory when \nadding files...\n\nCiao,\nDscho\n"},{"id":"40189","messageId":"f36b08ee0704230330if89d417udefb8e50062d5a05@mail.gmail.com","threadId":"7792","inReplyTo":"Pine.LNX.4.64.0704231215370.8822@racer.site","subject":"Re: adding file by absolute name -- problem","fromName":"Yakov Lerner","fromEmail":"iler.ml@gmail.com","sentAt":"2007-04-23T10:30:28Z","receivedAt":"2007-04-23T10:30:28Z","isPatch":false,"sender":{"key":"iler.ml@gmail.com","avatar":null},"body":"On 4/23/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Mon, 23 Apr 2007, Yakov Lerner wrote:\n>\n> > When I give absolute pathname /a/b/repo/d to git add, it\n> > mostly does not work. I get errors from git-add. Is it by design ?\n>\n> AFAICT it is by design. I fail to see why absolute paths should be\n> supported, too. You are supposed to be _in_ the working directory when\n> adding files...\n\nLet's say I have $SRC that points to the dir of sources. Let's say\nI am testing the software, somewhere under /tmp. I edit sources as\n'vi $SRC/something' and I am not in $SRC. I could do 'make -C $SRC' and\nI can do everything (incl checkins) without switching cwd back and\nforth all the time.\n\nCVS did not accept absolute pathnames, and SVN does. It is really convenient.\nI felt perceptible added comfort when I switched from CVS to cvs in this aspect.\nCVS's way of not accepting abs paths was not convenient.\n\nBut talking about implementation. How would I, generically,  go about\nfinding the base .git when absolute path is given ? Is dropping basenmes\none-by-one and checking for .git a good method ? Or just demand that GITDIR\nbe set when absolute name is given ?\n\nYakov\n"},{"id":"40190","messageId":"f36b08ee0704230332o7a54d74bu2ede0e99c0f34799@mail.gmail.com","threadId":"7792","inReplyTo":"f36b08ee0704230330if89d417udefb8e50062d5a05@mail.gmail.com","subject":"Re: adding file by absolute name -- problem","fromName":"Yakov Lerner","fromEmail":"iler.ml@gmail.com","sentAt":"2007-04-23T10:32:05Z","receivedAt":"2007-04-23T10:32:05Z","isPatch":false,"sender":{"key":"iler.ml@gmail.com","avatar":null},"body":"Typo correction:\n> switched from CVS to cvs in this aspect.\nShould be\nswitched from CVS to SVN in this aspect.\n\nYakov\n"},{"id":"40192","messageId":"Pine.LNX.4.64.0704231247480.8822@racer.site","threadId":"7792","inReplyTo":"f36b08ee0704230330if89d417udefb8e50062d5a05@mail.gmail.com","subject":"Re: adding file by absolute name -- problem","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-04-23T10:51:31Z","receivedAt":"2007-04-23T10:51:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 23 Apr 2007, Yakov Lerner wrote:\n\n> CVS did not accept absolute pathnames, and SVN does. It is really convenient.\n\nI do not feel very comfortable with the thought. If you have symbolic \nlinks somewhere along the path, it is easy to get wrong.\n\nThis line of thought got me confused: would\n\n$ ln -s /tmp x\n$ touch x/y\n$ git add x/y\n\nwork?\n\n*clicketyclick*\n\nYes, it does. It ignores the fact that x is not a directory, but a \nsymbolic link. Lots of opportunities to shoot yourself in the foot.\n\nThink about the consequences of doing something like this in one \nrepository, where \"x\" points into another one...\n\nCiao,\nDscho\n"},{"id":"40193","messageId":"Pine.LNX.4.64.0704231156230.3653@reaper.quantumfyre.co.uk","threadId":"7792","inReplyTo":"f36b08ee0704230330if89d417udefb8e50062d5a05@mail.gmail.com","subject":"Re: adding file by absolute name -- problem","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-04-23T11:02:48Z","receivedAt":"2007-04-23T11:02:48Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Mon, 23 Apr 2007, Yakov Lerner wrote:\n\n> On 4/23/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>>  Hi,\n>>\n>>  On Mon, 23 Apr 2007, Yakov Lerner wrote:\n>> \n>> >  When I give absolute pathname /a/b/repo/d to git add, it\n>> >  mostly does not work. I get errors from git-add. Is it by design ?\n>>\n>>  AFAICT it is by design. I fail to see why absolute paths should be\n>>  supported, too. You are supposed to be _in_ the working directory when\n>>  adding files...\n>\n> Let's say I have $SRC that points to the dir of sources. Let's say\n> I am testing the software, somewhere under /tmp. I edit sources as\n> 'vi $SRC/something' and I am not in $SRC. I could do 'make -C $SRC' and\n> I can do everything (incl checkins) without switching cwd back and\n> forth all the time.\n\ngit () { cd $SRC; ~/bin/git \"$@\"; } ?\n\n-- \nJulian\n\n  ---\nMan and wife make one fool.\n"},{"id":"40198","messageId":"1b46aba20704230639k56fc1839qcad38f1e5ee0e238@mail.gmail.com","threadId":"7792","inReplyTo":"Pine.LNX.4.64.0704231215370.8822@racer.site","subject":"Re: adding file by absolute name -- problem","fromName":"Carlos Rica","fromEmail":"jasampler@gmail.com","sentAt":"2007-04-23T13:39:57Z","receivedAt":"2007-04-23T13:39:57Z","isPatch":false,"sender":{"key":"jasampler@gmail.com","avatar":null},"body":"Hi!\n\n2007/4/23, Johannes Schindelin <Johannes.Schindelin@gmx.de>:\n> Hi,\n>\n> On Mon, 23 Apr 2007, Yakov Lerner wrote:\n>\n> > When I give absolute pathname /a/b/repo/d to git add, it\n> > mostly does not work. I get errors from git-add. Is it by design ?\n>\n> AFAICT it is by design. I fail to see why absolute paths should be\n> supported, too. You are supposed to be _in_ the working directory when\n> adding files...\n\nSince it is by design, a posible solution could be support an optional\nparameter to give the program the path of the directory (something as\n--dir /a/b). Then you could build a command line to be run from\nanother place, without using absolute paths in the rest of parameters.\nMaybe it would be easier to implement by interested people. Anyway, I\ndon't need this feature, too.\n\nI think that if currently the program does not support absolute paths,\nthis should be clearly stated in error messages and check for that in\na centralized place.\n"},{"id":"40201","messageId":"Pine.LNX.4.64.0704231622160.8822@racer.site","threadId":"7792","inReplyTo":"1b46aba20704230639k56fc1839qcad38f1e5ee0e238@mail.gmail.com","subject":"Re: adding file by absolute name -- problem","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-04-23T14:23:18Z","receivedAt":"2007-04-23T14:23:18Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 23 Apr 2007, Carlos Rica wrote:\n\n> Since it is by design, a posible solution could be support an optional\n> parameter to give the program the path of the directory (something as\n> --dir /a/b).\n\n:-)\n\nYou mean something like\n\n\tgit --git-dir /path/to/repo add relative/path/to/file\n\nHmm?\n\nCiao,\nDscho\n"}]}