{"thread":{"id":"16230","subject":"Init on push","startedAt":"2008-11-08T16:08:45Z","lastAt":"2008-11-09T01:41:20Z","messageCount":11,"participants":["Robin Rosenberg","Junio C Hamano","Alexander Gavrilov","Jakub Narebski","Francis Galiegue"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"95225","messageId":"200811081708.45672.robin.rosenberg.lists@dewire.com","threadId":"16230","inReplyTo":null,"subject":"Init on push","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-11-08T16:08:45Z","receivedAt":"2008-11-08T16:08:45Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Hi,\n\nI am missing the ability to do this (command line or GUI)\n\ngit remote add someremote someurl\ngit push --init someremote/someurl\n\nThe implementation would invoke receive pack on the receiving side with\nan --init option. On the server side the repository would be created and\ninitialized just as one had executed and mkdir and git init --bare.\n\nThe target audience is people who are either lazy (like me) or \"shellofobic\" users.\nGUI's would get an extra check box.\n\nThis could be extended by passing options to the init switch with init options\nfor the server side, say --init=\"--shared=false\".\n\nCould a patch for this be acceptable?\n\n-- robin\n"},{"id":"95229","messageId":"7viqqyc93w.fsf@gitster.siamese.dyndns.org","threadId":"16230","inReplyTo":"200811081708.45672.robin.rosenberg.lists@dewire.com","subject":"Re: Init on push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-08T19:26:27Z","receivedAt":"2008-11-08T19:26:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:\n\n> git remote add someremote someurl\n> git push --init someremote/someurl\n>\n> The implementation would invoke receive pack on the receiving side with\n> an --init option. On the server side the repository would be created and\n> initialized just as one had executed and mkdir and git init --bare.\n\nWe saw this quite a number of times.  I think it's about time we did\nsomething about it.\n\nBut I do not think it is a reasonable design to give receive-pack such an\noption.\n\nAn easy alternative would be to issue the usual \"mkdir && git init\" shell\nscript before spawning receive-pack.  This will limit the feature to\npushing over the ssh transport, and pushing over the git protocol against\na loose git-daemon will not be able to support it.  Also I suspect this\nwill break sites managed by gitosis, where all repositories are held under\nthe same UNIX user identity, differenciated only via an environment it\nsets based on the ssh key used to make the connection.\n\nI wonder if you can take a middle ground alternative:\n\n - Make \"git push --init [--shared] $site:$there\" and \"git push --init\n   [--shared] git://$site/$there\" run \"git init -D [--shared] $there\"\n   followed by \"git receive-pack $there\";\n\n - Teach \"-D $there\" option to \"git init\", which does an \"mkdir -p $it &&\n   chdird $it\" before it does its work.\n \n - Teach \"git daemon\" about the \"init\" service, which is disabled by\n   default, and can be enabled just like you can enable receive-pack\n   there.\n\nIf sites like repo.or.cz, github, or managed with gitosis want to use\nthis, I think you might further need to give \"git init -D $there\" a hook\nto control who can create new repositories at which location (gitosis is\nthe most interesting case, as described above).\n"},{"id":"95230","messageId":"bb6f213e0811081201w22a36800j1713b91d0cf66fb2@mail.gmail.com","threadId":"16230","inReplyTo":"7viqqyc93w.fsf@gitster.siamese.dyndns.org","subject":"Re: Init on push","fromName":"Alexander Gavrilov","fromEmail":"angavrilov@gmail.com","sentAt":"2008-11-08T20:01:02Z","receivedAt":"2008-11-08T20:01:02Z","isPatch":false,"sender":{"key":"angavrilov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42666?v=4"},"body":"On Sat, Nov 8, 2008 at 10:26 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> An easy alternative would be to issue the usual \"mkdir && git init\" shell\n> script before spawning receive-pack.  This will limit the feature to\n> pushing over the ssh transport, and pushing over the git protocol against\n> a loose git-daemon will not be able to support it.  Also I suspect this\n> will break sites managed by gitosis, where all repositories are held under\n> the same UNIX user identity, differenciated only via an environment it\n> sets based on the ssh key used to make the connection.\n\nGitosis works by replacing the shell with a program called\ngitosis-serve, which parses and validates the incoming commands\nagainst the user access configuration. If it sees an unknown command,\nit will simply refuse to execute it.\n\nOn the other hand it will automatically perform initialization before\ncalling receive-pack if the user is authorized to write to a certain\npath, but the repository does not exist yet.\n\nAlexander\n"},{"id":"95232","messageId":"gf4rf6$v52$1@ger.gmane.org","threadId":"16230","inReplyTo":"7viqqyc93w.fsf@gitster.siamese.dyndns.org","subject":"Re: Init on push","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-11-08T20:06:01Z","receivedAt":"2008-11-08T20:06:01Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n>  - Teach \"-D $there\" option to \"git init\", which does an \"mkdir -p $it &&\n>    chdird $it\" before it does its work.\n\nShouldn't it be \"-C $there\" (like make and tar)?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"95233","messageId":"200811082108.34535.fg@one2team.com","threadId":"16230","inReplyTo":"gf4rf6$v52$1@ger.gmane.org","subject":"Re: Init on push","fromName":"Francis Galiegue","fromEmail":"fg@one2team.com","sentAt":"2008-11-08T20:08:34Z","receivedAt":"2008-11-08T20:08:34Z","isPatch":false,"sender":{"key":"fg@one2team.com","avatar":null},"body":"Le Saturday 08 November 2008 21:06:01 Jakub Narebski, vous avez écrit :\n> Junio C Hamano wrote:\n> >  - Teach \"-D $there\" option to \"git init\", which does an \"mkdir -p $it &&\n> >    chdird $it\" before it does its work.\n>\n> Shouldn't it be \"-C $there\" (like make and tar)?\n\nI agree with that. It's pretty much a standard for quite a few \"command line \npeople\", insofar as I always look for such an option in case I want to know \nwhether a command has the ability to chdir() to a different directory than \nthe current one :p\n\n-- \nFrancis Galiegue\nONE2TEAM\nIngénieur système\nMob : +33 (0) 6 83 87 78 75\nTel : +33 (0) 1 78 94 55 52\nfge@one2team.com\n40 avenue Raymond Poincaré\n75116 Paris\n"},{"id":"95234","messageId":"7v8wruc6z1.fsf@gitster.siamese.dyndns.org","threadId":"16230","inReplyTo":"bb6f213e0811081201w22a36800j1713b91d0cf66fb2@mail.gmail.com","subject":"Re: Init on push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-08T20:12:34Z","receivedAt":"2008-11-08T20:12:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Alexander Gavrilov\" <angavrilov@gmail.com> writes:\n\n> Gitosis works by replacing the shell with a program called\n> gitosis-serve, which parses and validates the incoming commands\n> against the user access configuration. If it sees an unknown command,\n> it will simply refuse to execute it.\n\nIf you implement a new feature by enhancing receive-pack (or anything\nelse), you obviously cannot use the new feature against an installation\nwith an older implementation, so what you said is a known.  My point was\nhow to enhance the receiving end and what constraints we would have in\nenhancing it.\n\n> On the other hand it will automatically perform initialization before\n> calling receive-pack if the user is authorized to write to a certain\n> path, but the repository does not exist yet.\n\nThat's good to know.  I also realize that gitosis does not need any hook\nfor \"git init -D $there\" to decide whether a new repository can be created\nat requested location, as it reads the command line and makes decision\nbefore driving the underlying command in response to the request.\n\nOn the other hand, people who enable 'push' access to their git-daemon\nwould need it, as the daemon would not even know who is asking for --init.\n"},{"id":"95236","messageId":"7v3ai2c5sd.fsf@gitster.siamese.dyndns.org","threadId":"16230","inReplyTo":"200811082108.34535.fg@one2team.com","subject":"Re: Init on push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-08T20:38:10Z","receivedAt":"2008-11-08T20:38:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Francis Galiegue <fg@one2team.com> writes:\n\n> Le Saturday 08 November 2008 21:06:01 Jakub Narebski, vous avez écrit :\n>> Junio C Hamano wrote:\n>> >  - Teach \"-D $there\" option to \"git init\", which does an \"mkdir -p $it &&\n>> >    chdird $it\" before it does its work.\n>>\n>> Shouldn't it be \"-C $there\" (like make and tar)?\n>\n> I agree with that. It's pretty much a standard for quite a few \"command line \n> people\", insofar as I always look for such an option in case I want to know \n> whether a command has the ability to chdir() to a different directory than \n> the current one :p\n\nIn this particular case, it is not \"chdir() before starting\" but \"mkdir\nand then chdir() into it\".  Using -C would be counterproductive.\n"},{"id":"95237","messageId":"200811082144.25261.fg@one2team.com","threadId":"16230","inReplyTo":"7v3ai2c5sd.fsf@gitster.siamese.dyndns.org","subject":"Re: Init on push","fromName":"Francis Galiegue","fromEmail":"fg@one2team.com","sentAt":"2008-11-08T20:44:25Z","receivedAt":"2008-11-08T20:44:25Z","isPatch":false,"sender":{"key":"fg@one2team.com","avatar":null},"body":"Le Saturday 08 November 2008 21:38:10 Junio C Hamano, vous avez écrit :\n> Francis Galiegue <fg@one2team.com> writes:\n> > Le Saturday 08 November 2008 21:06:01 Jakub Narebski, vous avez écrit :\n> >> Junio C Hamano wrote:\n> >> >  - Teach \"-D $there\" option to \"git init\", which does an \"mkdir -p $it\n> >> > && chdird $it\" before it does its work.\n> >>\n> >> Shouldn't it be \"-C $there\" (like make and tar)?\n> >\n> > I agree with that. It's pretty much a standard for quite a few \"command\n> > line people\", insofar as I always look for such an option in case I want\n> > to know whether a command has the ability to chdir() to a different\n> > directory than the current one :p\n>\n> In this particular case, it is not \"chdir() before starting\" but \"mkdir\n> and then chdir() into it\".  Using -C would be counterproductive.\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\nI have missed the mkdir part, but then here this is mkdir _-p_...\n\nI mean, what is the cost of mkdir -p the/dir and then git init -C the/dir? I \ndon't think it's that good an idea to have git create the directory in this \ncase...\n\nThink of what would happen if you git -D a/b, and a is a symlink to, where, \nsomewhere (doesn't exist, exists but if you touch it you're {in trouble,good \nfor jail time, whatever}).\n\nI personnaly think that the directory creation SHOULD be created to the \ncommands that are meant for it, just as git handles dir creation in its own \nspace (a git repository).\n\n-- \nFrancis Galiegue\nONE2TEAM\nIngénieur système\nMob : +33 (0) 6 83 87 78 75\nTel : +33 (0) 1 78 94 55 52\nfge@one2team.com\n40 avenue Raymond Poincaré\n75116 Paris\n"},{"id":"95239","messageId":"200811082150.24583.fg@one2team.net","threadId":"16230","inReplyTo":"200811082144.25261.fg@one2team.com","subject":"Re: Init on push","fromName":"Francis Galiegue","fromEmail":"fg@one2team.net","sentAt":"2008-11-08T20:50:24Z","receivedAt":"2008-11-08T20:50:24Z","isPatch":false,"sender":{"key":"fg@one2team.net","avatar":null},"body":"Le Saturday 08 November 2008 21:44:25 Francis Galiegue, vous avez écrit :\n[...]\n>\n> I personnaly think that the directory creation SHOULD be created\n\nI meant \"handled\", sorry.\n\n-- \nfge\n"},{"id":"95243","messageId":"7vmyg9bvu0.fsf@gitster.siamese.dyndns.org","threadId":"16230","inReplyTo":"200811082150.24583.fg@one2team.net","subject":"Re: Init on push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-09T00:13:11Z","receivedAt":"2008-11-09T00:13:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Francis Galiegue <fg@one2team.net> writes:\n\n> Le Saturday 08 November 2008 21:44:25 Francis Galiegue, vous avez écrit :\n> [...]\n>>\n>> I personnaly think that the directory creation SHOULD be created\n>\n> I meant \"handled\", sorry.\n\nWhy have we ended up losing the most important Cc: to the original patch\nsubmitter who asked if the idea of his patch is sound?\n"},{"id":"95245","messageId":"200811090241.20548.fg@one2team.net","threadId":"16230","inReplyTo":"7vmyg9bvu0.fsf@gitster.siamese.dyndns.org","subject":"Re: Init on push","fromName":"Francis Galiegue","fromEmail":"fg@one2team.net","sentAt":"2008-11-09T01:41:20Z","receivedAt":"2008-11-09T01:41:20Z","isPatch":false,"sender":{"key":"fg@one2team.net","avatar":null},"body":"Le Sunday 09 November 2008 01:13:11 Junio C Hamano, vous avez écrit :\n> Francis Galiegue <fg@one2team.net> writes:\n> > Le Saturday 08 November 2008 21:44:25 Francis Galiegue, vous avez écrit :\n> > [...]\n> >\n> >> I personnaly think that the directory creation SHOULD be created\n> >\n> > I meant \"handled\", sorry.\n>\n> Why have we ended up losing the most important Cc: to the original patch\n> submitter who asked if the idea of his patch is sound?\n\nSorry for that. I blindly \"replied to all\", not seeing that the reply chain \nhas been \"broken\" along the way.\n\n-- \nfge\n"}]}