{"thread":{"id":"6402","subject":"[PATCH RFC] new config option remote.<name>.pushexec","startedAt":"2007-01-16T15:02:59Z","lastAt":"2007-01-25T04:53:35Z","messageCount":19,"participants":["Uwe Kleine-König","Johannes Schindelin","Brian Gernhardt","Michael S. Tsirkin","Shawn O. Pearce","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"31824","messageId":"20070116150259.GA2439@cepheus","threadId":"6402","inReplyTo":null,"subject":"[PATCH RFC] new config option remote.<name>.pushexec","fromName":"Uwe Kleine-König","fromEmail":"zeisberg@informatik.uni-freiburg.de","sentAt":"2007-01-16T15:02:59Z","receivedAt":"2007-01-16T15:02:59Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"git push --exec=... is fine, but having it to specify every time is\nannoying.\n\nThis sets the default remote program for pushing to remote <name>.\n\nSigned-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>\n---\n\nThis has (still) a few short comings:\n\n a) compiler warning because execute has the type const char*.\n\n b) cmdline should overwrite remote.<name>.pushexec w/o the warning.\n\n c) the symmetric part for fetch is missing.\n\nThe idea should be clear.  Would a more complete patch be welcome?\n\nBest regards\nUwe\n\n Documentation/config.txt |    4 ++++\n builtin-push.c           |    7 +++++++\n 2 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex faa17ba..667628a 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -351,6 +351,10 @@ remote.<name>.push::\n \tThe default set of \"refspec\" for gitlink:git-push[1]. See\n \tgitlink:git-push[1].\n \n+remote.<name>.pushexec::\n+\tThe default program to execute on the remote side.  See\n+\toption \\--exec of gitlink:git-push[1].\n+\n repack.usedeltabaseoffset::\n \tAllow gitlink:git-repack[1] to create packs that uses\n \tdelta-base offset.  Defaults to false.\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 7a3d2bb..8ea5dea 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -157,6 +157,13 @@ static int get_remote_config(const char* key, const char* value)\n \t\telse if (config_get_refspecs &&\n \t\t\t !strcmp(key + 7 + config_repo_len, \".push\"))\n \t\t\tadd_refspec(xstrdup(value));\n+\t\telse if (!strcmp(key + 7 + config_repo_len, \".pushexec\")) {\n+\t\t\tif (!execute) {\n+\t\t\t\texecute = xmalloc(strlen(value) + 8);\n+\t\t\t\tsprintf(execute, \"--exec=%s\", value);\n+\t\t\t} else\n+\t\t\t\terror(\"more than one pushexec given\");\n+\t\t}\n \t}\n \treturn 0;\n }\n-- \n1.5.0.rc1.g581a\n\n\n-- \nUwe Kleine-König\n\nhttp://www.google.com/search?q=5+choose+3\n"},{"id":"31826","messageId":"Pine.LNX.4.63.0701161614070.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6402","inReplyTo":"20070116150259.GA2439@cepheus","subject":"Re: [PATCH RFC] new config option remote.<name>.pushexec","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-16T15:16:55Z","receivedAt":"2007-01-16T15:16:55Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 16 Jan 2007, Uwe Kleine-König wrote:\n\n> git push --exec=... is fine, but having it to specify every time is\n> annoying.\n\nWhat would you specify? The only sensible thing would be \"--exec=blabla\" \nwhere \"blabla\" is a workalike to git-receive-pack.\n\nIMHO this is just an obscure option for obscure _really_ low-level git \ndebugging, so it should not even be mentioned in the man page, let alone \nencouraged.\n\nCiao,\nDscho\n"},{"id":"31829","messageId":"20070116162645.GA18894@informatik.uni-freiburg.de","threadId":"6402","inReplyTo":"Pine.LNX.4.63.0701161614070.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH RFC] new config option remote.<name>.pushexec","fromName":"Uwe Kleine-König","fromEmail":"zeisberg@informatik.uni-freiburg.de","sentAt":"2007-01-16T16:26:45Z","receivedAt":"2007-01-16T16:26:45Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hi Johannes,\n\nJohannes Schindelin wrote:\n> On Tue, 16 Jan 2007, Uwe Kleine-König wrote:\n> \n> > git push --exec=... is fine, but having it to specify every time is\n> > annoying.\n> \n> What would you specify? The only sensible thing would be \"--exec=blabla\" \n> where \"blabla\" is a workalike to git-receive-pack.\nExactly.  Quoting git-send-pack(1):\n\n\tPath to the git-receive-pack program on the remote end.\n\tSometimes useful when pushing to a remote repository over ssh,\n\tand you do not have the program in a directory on the default\n\t$PATH.\n\nFor me it would be:\n\n\tpushexec = /home/zeisberg/usr/bin/git-receive-pack\n\nWhile having /home/zeisberg/usr/bin only in my PATH for interactive\nshells.  (Yes I know I could expand my PATH which .<someshrc>, but I'd\nprefer it that way.)\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":"31830","messageId":"E8FAB100-0E5B-4C3E-A0AB-34699CBBD148@silverinsanity.com","threadId":"6402","inReplyTo":"Pine.LNX.4.63.0701161614070.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH RFC] new config option remote.<name>.pushexec","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-01-16T16:27:05Z","receivedAt":"2007-01-16T16:27:05Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Jan 16, 2007, at 10:16 AM, Johannes Schindelin wrote:\n\n> Hi,\n>\n> On Tue, 16 Jan 2007, Uwe Kleine-König wrote:\n>\n>> git push --exec=... is fine, but having it to specify every time is\n>> annoying.\n>\n> What would you specify? The only sensible thing would be \"-- \n> exec=blabla\"\n> where \"blabla\" is a workalike to git-receive-pack.\n>\n> IMHO this is just an obscure option for obscure _really_ low-level git\n> debugging, so it should not even be mentioned in the man page, let  \n> alone\n> encouraged.\n\nIt should be documented somewhere so that for the few odd cases where  \nyou need it you can find it.  The most likely case I can think of is  \nan SSH push where git isn't in your path for some reason.\n\nUndocumented options are a bane to users.  Document everything, and  \nput BIG WARNINGS on things that shouldn't be used.  Or put them in  \ntheir own man page.\n\n~~ Brian"},{"id":"31832","messageId":"20070116173706.GB20898@mellanox.co.il","threadId":"6402","inReplyTo":"20070116162645.GA18894@informatik.uni-freiburg.de","subject":"How to merge FETCH_HEAD?","fromName":"Michael S. Tsirkin","fromEmail":"mst@mellanox.co.il","sentAt":"2007-01-16T17:37:18Z","receivedAt":"2007-01-16T17:37:18Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"OK, I did a fetch and now I can see remote history by\n\n$git log FETCH_HEAD\n\nBut, how to merge it?\n\n$ git pull . FETCH_HEAD\nerror: no such remote ref refs/heads/FETCH_HEAD\nFetch failure: .\n\n$git merge FETCH_HEAD\nFETCH_HEAD - not something we can merge\n\nSo, how can I merge this without an extra fetch?\n\n-- \nMST\n"},{"id":"31840","messageId":"20070116195914.GA29100@spearce.org","threadId":"6402","inReplyTo":"20070116173706.GB20898@mellanox.co.il","subject":"Re: How to merge FETCH_HEAD?","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-01-16T19:59:14Z","receivedAt":"2007-01-16T19:59:14Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"\"Michael S. Tsirkin\" <mst@mellanox.co.il> wrote:\n> OK, I did a fetch and now I can see remote history by\n> \n> $git log FETCH_HEAD\n\nWow, I'm suprised that works.  Handy feature.  Too bad rev-parse\n--verify then chokes on it when we'll somehow consider it a ref\notherwise...\n \n> But, how to merge it?\n\nLook at git-pull.sh:\n\n\tmerge_head=$(sed -e '/  not-for-merge   /d' \\\n\t\t-e 's/  .*//' \"$GIT_DIR\"/FETCH_HEAD | \\\n\t\t\ttr '\\012' ' ')\n\tmerge_name=$(git-fmt-merge-msg <\"$GIT_DIR/FETCH_HEAD\")\n\tgit-merge \"$merge_name\" HEAD $merge_head\n\nThe not-for-merge keyword is included on lines that were fetched\ninto tracking branches during the last fetch and which you don't\nwant to merge right now.  So those lines get dropped.  Then the\nremainder of the line is stripped away, leaving you with only\nthe sha1 sum.  merge_name is computed from the FETCH_HEAD file,\nto get the pretty log message for git-merge.\n\n-- \nShawn.\n"},{"id":"31841","messageId":"20070116200847.GB29100@spearce.org","threadId":"6402","inReplyTo":"20070116162645.GA18894@informatik.uni-freiburg.de","subject":"Re: [PATCH RFC] new config option remote.<name>.pushexec","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-01-16T20:08:47Z","receivedAt":"2007-01-16T20:08:47Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Uwe Kleine-K?nig <zeisberg@informatik.uni-freiburg.de> wrote:\n> Exactly.  Quoting git-send-pack(1):\n> \n> \tPath to the git-receive-pack program on the remote end.\n> \tSometimes useful when pushing to a remote repository over ssh,\n> \tand you do not have the program in a directory on the default\n> \t$PATH.\n> \n> For me it would be:\n> \n> \tpushexec = /home/zeisberg/usr/bin/git-receive-pack\n> \n> While having /home/zeisberg/usr/bin only in my PATH for interactive\n> shells.  (Yes I know I could expand my PATH which .<someshrc>, but I'd\n> prefer it that way.)\n\nSome of us have UNIX accounts where our shell is the (retarded)\n/usr/bin/ksh on Solaris.  And where the SSH daemon won't seem to\nlet us set PATH, and where Git isn't in the PATH.  This leaves\nus with some difficulty in pointing Git at itself on the remote\nsystem.\n\nI've worked around it with a GIT_SSH wrapper, e.g.\n\n\t$ cat >~/bin/mygitssh.sh\n\t#!/bin/sh\n\thost=\"$1\"; shift\n\texec ssh \"$host\" \"PATH=\\\"/path/to/git:\\$PATH\\\"; exec $@\"\n\t^D\n\t$ chmod 755 ~/bin/mygitssh.sh\n\t$ export GIT_SSH=~/bin/mygitssh.sh\n\nBeing able to just set pushexec and fetchexec in the .git/config\nfile would be nice, but GIT_SSH works well for my sad needs.\n\n-- \nShawn.\n"},{"id":"31842","messageId":"7vfyaaybhm.fsf@assigned-by-dhcp.cox.net","threadId":"6402","inReplyTo":"20070116173706.GB20898@mellanox.co.il","subject":"Re: How to merge FETCH_HEAD?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-16T20:15:17Z","receivedAt":"2007-01-16T20:15:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Michael S. Tsirkin\" <mst@mellanox.co.il> writes:\n\n> OK, I did a fetch and now I can see remote history by\n>\n> $git log FETCH_HEAD\n>\n> But, how to merge it?\n\nYou would do \"git merge FETCH_HEAD\" (note that this would not\nwork for octopus).\n\n> $ git pull . FETCH_HEAD\n> error: no such remote ref refs/heads/FETCH_HEAD\n> Fetch failure: .\n\nThis is wrong twice.\n\n (1) \"git pull\" and \"git fetch\" by design are to fetch what are\n     exposed, and the remote refnames you give are perfixed with\n     refs/heads (or refs/tags if you say \"git fetch tag v1.0.0\")\n     unless the refnames begin with refs/ already.  In other\n     words, FETCH_HEAD is not something you can \"pull\".\n\n (2) Remember, \"pull is fetch followed by merge.\" And the way\n     fetch communicates with the calling \"pull\" so that it can\n     drive \"merge\" is via FETCH_HEAD.  So whatever pull you\n     would do, FETCH_HEAD is cleared first to store the result.\n\nSo by doing this (and not redoing the fetch) you broke your own\nexperiment sequence.  And that is why you got this:\n\n> $git merge FETCH_HEAD\n> FETCH_HEAD - not something we can merge\n\nbecause at this point FETCH_HEAD is empty.\n"},{"id":"31843","messageId":"Pine.LNX.4.63.0701162129430.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6402","inReplyTo":"20070116200847.GB29100@spearce.org","subject":"Re: [PATCH RFC] new config option remote.<name>.pushexec","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-16T20:30:12Z","receivedAt":"2007-01-16T20:30:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 16 Jan 2007, Shawn O. Pearce wrote:\n\n> Uwe Kleine-K?nig <zeisberg@informatik.uni-freiburg.de> wrote:\n> > Exactly.  Quoting git-send-pack(1):\n> > \n> > \tPath to the git-receive-pack program on the remote end.\n> > \tSometimes useful when pushing to a remote repository over ssh,\n> > \tand you do not have the program in a directory on the default\n> > \t$PATH.\n> > \n> > For me it would be:\n> > \n> > \tpushexec = /home/zeisberg/usr/bin/git-receive-pack\n> > \n> > While having /home/zeisberg/usr/bin only in my PATH for interactive\n> > shells.  (Yes I know I could expand my PATH which .<someshrc>, but I'd\n> > prefer it that way.)\n> \n> Some of us have UNIX accounts where our shell is the (retarded)\n> /usr/bin/ksh on Solaris.  And where the SSH daemon won't seem to\n> let us set PATH, and where Git isn't in the PATH.  This leaves\n> us with some difficulty in pointing Git at itself on the remote\n> system.\n\nOkay, I see your point now.\n\nCiao,\nDscho\n"},{"id":"31851","messageId":"20070116213340.GB4329@mellanox.co.il","threadId":"6402","inReplyTo":"20070116195914.GA29100@spearce.org","subject":"Re: How to merge FETCH_HEAD?","fromName":"Michael S. Tsirkin","fromEmail":"mst@mellanox.co.il","sentAt":"2007-01-16T21:33:40Z","receivedAt":"2007-01-16T21:33:40Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"> Quoting Shawn O. Pearce <spearce@spearce.org>:\n> Subject: Re: How to merge FETCH_HEAD?\n> \n> \"Michael S. Tsirkin\" <mst@mellanox.co.il> wrote:\n> > OK, I did a fetch and now I can see remote history by\n> > \n> > $git log FETCH_HEAD\n> \n> Wow, I'm suprised that works.  Handy feature.  Too bad rev-parse\n> --verify then chokes on it when we'll somehow consider it a ref\n> otherwise...\n>  \n> > But, how to merge it?\n> \n> Look at git-pull.sh:\n> \n> \tmerge_head=$(sed -e '/  not-for-merge   /d' \\\n> \t\t-e 's/  .*//' \"$GIT_DIR\"/FETCH_HEAD | \\\n> \t\t\ttr '\\012' ' ')\n> \tmerge_name=$(git-fmt-merge-msg <\"$GIT_DIR/FETCH_HEAD\")\n> \tgit-merge \"$merge_name\" HEAD $merge_head\n> \n> The not-for-merge keyword is included on lines that were fetched\n> into tracking branches during the last fetch and which you don't\n> want to merge right now.  So those lines get dropped.  Then the\n> remainder of the line is stripped away, leaving you with only\n> the sha1 sum.  merge_name is computed from the FETCH_HEAD file,\n> to get the pretty log message for git-merge.\n\nWould it be useful to have git-pull . FETCH_HEAD work?\n\n-- \nMST\n"},{"id":"31852","messageId":"Pine.LNX.4.63.0701162235200.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6402","inReplyTo":"20070116213340.GB4329@mellanox.co.il","subject":"Re: How to merge FETCH_HEAD?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-16T21:36:12Z","receivedAt":"2007-01-16T21:36:12Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 16 Jan 2007, Michael S. Tsirkin wrote:\n\n> Would it be useful to have git-pull . FETCH_HEAD work?\n\nNo. FETCH_HEAD is local. And for local merges, you should use git-merge, \nnot git-pull.\n\nCiao,\nDscho\n"},{"id":"31868","messageId":"20070117050955.GC4329@mellanox.co.il","threadId":"6402","inReplyTo":"Pine.LNX.4.63.0701162235200.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: How to merge FETCH_HEAD?","fromName":"Michael S. Tsirkin","fromEmail":"mst@mellanox.co.il","sentAt":"2007-01-17T05:09:55Z","receivedAt":"2007-01-17T05:09:55Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"> Quoting Johannes Schindelin <Johannes.Schindelin@gmx.de>:\n> Subject: Re: How to merge FETCH_HEAD?\n> \n> Hi,\n> \n> On Tue, 16 Jan 2007, Michael S. Tsirkin wrote:\n> \n> > Would it be useful to have git-pull . FETCH_HEAD work?\n> \n> No. FETCH_HEAD is local. And for local merges, you should use git-merge, \n> not git-pull.\n\nBut, that can not take FETCH_HEAD either.\nWould it be useful for git-merge FETCH_HEAD to work?\n\n-- \nMST\n"},{"id":"31869","messageId":"7vk5zmtc1n.fsf@assigned-by-dhcp.cox.net","threadId":"6402","inReplyTo":"20070117050955.GC4329@mellanox.co.il","subject":"Re: How to merge FETCH_HEAD?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-17T06:14:28Z","receivedAt":"2007-01-17T06:14:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Michael S. Tsirkin\" <mst@mellanox.co.il> writes:\n\n>> No. FETCH_HEAD is local. And for local merges, you should use git-merge, \n>> not git-pull.\n>\n> But, that can not take FETCH_HEAD either.\n> Would it be useful for git-merge FETCH_HEAD to work?\n\nPlease try again, starting from the \"git fetch\".\n\nI suspect the reason you think \"merge FETCH_HEAD\" does not work\nis because you lost FETCH_HEAD when you did \"git pull . FETCH_HEAD\",\nas I explained to you in an earlier message.\n"},{"id":"31870","messageId":"20070117063353.GF30926@mellanox.co.il","threadId":"6402","inReplyTo":"7vk5zmtc1n.fsf@assigned-by-dhcp.cox.net","subject":"Re: How to merge FETCH_HEAD?","fromName":"Michael S. Tsirkin","fromEmail":"mst@mellanox.co.il","sentAt":"2007-01-17T06:33:53Z","receivedAt":"2007-01-17T06:33:53Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"> Quoting Junio C Hamano <junkio@cox.net>:\n> Subject: Re: How to merge FETCH_HEAD?\n> \n> \"Michael S. Tsirkin\" <mst@mellanox.co.il> writes:\n> \n> >> No. FETCH_HEAD is local. And for local merges, you should use git-merge, \n> >> not git-pull.\n> >\n> > But, that can not take FETCH_HEAD either.\n> > Would it be useful for git-merge FETCH_HEAD to work?\n> \n> Please try again, starting from the \"git fetch\".\n> \n> I suspect the reason you think \"merge FETCH_HEAD\" does not work\n> is because you lost FETCH_HEAD when you did \"git pull . FETCH_HEAD\",\n> as I explained to you in an earlier message.\n\nYes, that was it, thanks!\n\n-- \nMST\n"},{"id":"31896","messageId":"20070117164410.GA5950@cepheus","threadId":"6402","inReplyTo":"Pine.LNX.4.63.0701162129430.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH RFC] new config option remote.<name>.pushexec","fromName":"Uwe Kleine-König","fromEmail":"zeisberg@informatik.uni-freiburg.de","sentAt":"2007-01-17T16:44:10Z","receivedAt":"2007-01-17T16:44:10Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"git push --exec=... is fine, but having it to specify every time is\nannoying.\n\nThis sets the default remote program for pushing to remote <name>.\n\nSigned-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de>\n---\n Documentation/config.txt |    4 ++++\n builtin-push.c           |   11 +++++++++++\n 2 files changed, 15 insertions(+), 0 deletions(-)\n\nThis patch fixes two of three shortcomings pointed out at initial\nsending.  The compiler warning is gone (but I'm not 100% sure if it is\nfixed correctly or if only my compiler doesn't warn) and the commandline\ncan overwrite the value now without a warning.\n\nI tried to do the symmetric part for fetch, but that shell script is too\ncomplicated for me and so I let this part to s.o. being more familiar\nwith git-fetch.sh.\n\nBest regards\nUwe\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex da7fde5..bd4f72a 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -356,6 +356,10 @@ remote.<name>.push::\n \tThe default set of \"refspec\" for gitlink:git-push[1]. See\n \tgitlink:git-push[1].\n \n+remote.<name>.pushexec::\n+\tThe default program to execute on the remote side when pulling.  See\n+\toption \\--exec of gitlink:git-push[1].\n+\n repack.usedeltabaseoffset::\n \tAllow gitlink:git-repack[1] to create packs that uses\n \tdelta-base offset.  Defaults to false.\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 7a3d2bb..8ca5aee 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -143,6 +143,7 @@ static const char *config_repo;\n static int config_repo_len;\n static int config_current_uri;\n static int config_get_refspecs;\n+static int config_get_pushexec;\n \n static int get_remote_config(const char* key, const char* value)\n {\n@@ -157,6 +158,15 @@ static int get_remote_config(const char* key, const char* value)\n \t\telse if (config_get_refspecs &&\n \t\t\t !strcmp(key + 7 + config_repo_len, \".push\"))\n \t\t\tadd_refspec(xstrdup(value));\n+\t\telse if (config_get_pushexec &&\n+\t\t\t !strcmp(key + 7 + config_repo_len, \".pushexec\")) {\n+\t\t\tif (!execute) {\n+\t\t\t\tchar *ex = xmalloc(strlen(value) + 8);\n+\t\t\t\tsprintf(ex, \"--exec=%s\", value);\n+\t\t\t\texecute = ex;\n+\t\t\t} else\n+\t\t\t\terror(\"more than one pushexec given, using the first\");\n+\t\t}\n \t}\n \treturn 0;\n }\n@@ -168,6 +178,7 @@ static int get_config_remotes_uri(const char *repo, const char *uri[MAX_URI])\n \tconfig_current_uri = 0;\n \tconfig_uri = uri;\n \tconfig_get_refspecs = !(refspec_nr || all || tags);\n+\tconfig_get_pushexec = (execute == NULL);\n \n \tgit_config(get_remote_config);\n \treturn config_current_uri;\n-- \n1.5.0.rc1.g581a\n\n-- \nUwe Kleine-König\n\nmain(){char*a=\"main(){char*a=%c%s%c;printf(a,34,a,34%c\";printf(a,34,a,34\n,10);a=\",10);a=%c%s%c;printf(a,34,a,34,10);}%c\";printf(a,34,a,34,10);}\n"},{"id":"31899","messageId":"7vps9dsgn0.fsf@assigned-by-dhcp.cox.net","threadId":"6402","inReplyTo":"20070117164410.GA5950@cepheus","subject":"Re: [PATCH RFC] new config option remote.<name>.pushexec","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-17T17:32:51Z","receivedAt":"2007-01-17T17:32:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Uwe Kleine-König  <zeisberg@informatik.uni-freiburg.de> writes:\n\n> I tried to do the symmetric part for fetch, but that shell script is too\n> complicated for me and so I let this part to s.o. being more familiar\n> with git-fetch.sh.\n\nI do not know what s.o. is but something like this untested\npatch would do.\n\nI do not have strong objection to the configuration on the push\nside, but I am not sure if we want to call it pushexec -- it is\nnaming receive-pack so remote.*.receivepack might be more\nappropriate, just in case we update the fetch/push protocol\nsomeday to run more than one program on the other end.\n\n\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex 87b940b..7372c5f 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -82,6 +82,13 @@ case \"$#\" in\n \tset x $origin ; shift ;;\n esac\n \n+if test -z \"$exec\" && exec=$(git-repo-config \"remote.$1.uploadpack\")\n+then\n+\t# No command line override and we have configuration for the remote.\n+\tupload_pack=\"-u $exec\"\n+\texec=\"--exec=$exec\"\n+fi\n+\n remote_nick=\"$1\"\n remote=$(get_remote_url \"$@\")\n refs=\n"},{"id":"31943","messageId":"20070118071723.GB3245@informatik.uni-freiburg.de","threadId":"6402","inReplyTo":"7vps9dsgn0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH RFC] new config option remote.<name>.pushexec","fromName":"Uwe Kleine-König","fromEmail":"zeisberg@informatik.uni-freiburg.de","sentAt":"2007-01-18T07:17:23Z","receivedAt":"2007-01-18T07:17:23Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello Junio,\n\nJunio C Hamano wrote:\n> Uwe Kleine-König  <zeisberg@informatik.uni-freiburg.de> writes:\n> \n> > I tried to do the symmetric part for fetch, but that shell script is too\n> > complicated for me and so I let this part to s.o. being more familiar\n> > with git-fetch.sh.\n> \n> I do not know what s.o. is but something like this untested\n> patch would do.\ns.o. = someone, I thought it's a usual abbreviation.\n \n> I do not have strong objection to the configuration on the push\n> side, but I am not sure if we want to call it pushexec -- it is\n> naming receive-pack so remote.*.receivepack might be more\n> appropriate, just in case we update the fetch/push protocol\n> someday to run more than one program on the other end.\nI wondered about that, too.  In the docs we currently have:\n\n\tgit-send-pack ... [--exec=<git-receive-pack>]\n\tgit-fetch-pack ... [--exec=<git-upload-pack>]\n\tgit-push ... [--exec=<receive-pack>]\n\tgit-pull ... [--upload-pack <upload-pack>]\n\tgit-fetch ... [--upload-pack <upload-pack>]\n\nI have choosen 'pushexec' because that's the name of the option to push.\nremote.*.receivepack is cleaner, as is\n\n\tgit-push ...  [--receive-pack=...]\n\n.  If we choose remote.*.receivepack, we should consider deprecating\n--exec and introduce --receive-pack (--upload-pack resp.)\n \n> diff --git a/git-fetch.sh b/git-fetch.sh\n> index 87b940b..7372c5f 100755\n> --- a/git-fetch.sh\n> +++ b/git-fetch.sh\n> @@ -82,6 +82,13 @@ case \"$#\" in\n>  \tset x $origin ; shift ;;\n>  esac\n>  \n> +if test -z \"$exec\" && exec=$(git-repo-config \"remote.$1.uploadpack\")\n> +then\n> +\t# No command line override and we have configuration for the remote.\n> +\tupload_pack=\"-u $exec\"\n> +\texec=\"--exec=$exec\"\n> +fi\n> +\n>  remote_nick=\"$1\"\n>  remote=$(get_remote_url \"$@\")\n>  refs=\n\nI thought that it would be cleaner to add this code to\ngit-parse-remote.sh and only do it if $(get_data_source) == 'config'.\nBut it's OK for me this way, too.\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\nIf a lawyer and an IRS agent were both drowning, and you could only save\none of them, would you go to lunch or read the paper?\n"},{"id":"32586","messageId":"20070125044539.GA11397@cepheus","threadId":"6402","inReplyTo":"20070118071723.GB3245@informatik.uni-freiburg.de","subject":"[PATCH] make --upload-pack option to git-fetch configurable","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-01-25T04:45:39Z","receivedAt":"2007-01-25T04:45:39Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"This introduces the config item remote.<name>.uploadpack to override the\ndefault value (which is \"git-upload-pack\").\n\nSigned-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>\n---\n\n> > diff --git a/git-fetch.sh b/git-fetch.sh\n> > index 87b940b..7372c5f 100755\n> > --- a/git-fetch.sh\n> > +++ b/git-fetch.sh\n> > @@ -82,6 +82,13 @@ case \"$#\" in\n> >  \tset x $origin ; shift ;;\n> >  esac\n> >  \n> > +if test -z \"$exec\" && exec=$(git-repo-config \"remote.$1.uploadpack\")\n> > +then\n> > +\t# No command line override and we have configuration for the remote.\n> > +\tupload_pack=\"-u $exec\"\n> > +\texec=\"--exec=$exec\"\n> > +fi\n> > +\n> >  remote_nick=\"$1\"\n> >  remote=$(get_remote_url \"$@\")\n> >  refs=\n> \n> I thought that it would be cleaner to add this code to\n> git-parse-remote.sh and only do it if $(get_data_source) == 'config'.\nThis is, what this patch does.  Actually it was easier than I feared.\n\n git-fetch.sh        |    6 ++++++\n git-parse-remote.sh |   13 +++++++++++++\n 2 files changed, 19 insertions(+), 0 deletions(-)\n\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex 07a1d05..61c8cf4 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -85,6 +85,12 @@ case \"$#\" in\n \tset x $origin ; shift ;;\n esac\n \n+if test -z \"$exec\"\n+then\n+\t# No command line override and we have configuration for the remote.\n+\texec=\"--upload-pack=$(get_uploadpack $1)\"\n+fi\n+\n remote_nick=\"$1\"\n remote=$(get_remote_url \"$@\")\n refs=\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 4fc6020..1122c83 100755\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -279,3 +279,16 @@ resolve_alternates () {\n \t\tesac\n \tdone\n }\n+\n+get_uploadpack () {\n+\tdata_source=$(get_data_source \"$1\")\n+\tcase \"$data_source\" in\n+\tconfig)\n+\t\tuplp=$(git-repo-config --get \"remote.$1.uploadpack\")\n+\t\techo ${uplp:-git-upload-pack}\n+\t\t;;\n+\t*)\n+\t\techo \"git-upload-pack\"\n+\t\t;;\n+\tesac\n+}\n-- \n1.5.0.rc2.g3ea949\n\n\n\nUwe Kleine-König wrote:\n> \n> Best regards\n> Uwe\n> \n> -- \n> Uwe Kleine-König\n> \n> If a lawyer and an IRS agent were both drowning, and you could only save\n> one of them, would you go to lunch or read the paper?\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\n-- \nUwe Kleine-König\n\nhttp://www.google.com/search?q=12+divided+by+3\n"},{"id":"32587","messageId":"20070125045335.GB11397@cepheus","threadId":"6402","inReplyTo":"20070125044539.GA11397@cepheus","subject":"Re: [PATCH] make --upload-pack option to git-fetch configurable","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-01-25T04:53:35Z","receivedAt":"2007-01-25T04:53:35Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\n> +if test -z \"$exec\"\n> +then\n> +\t# No command line override and we have configuration for the remote.\n> +\texec=\"--upload-pack=$(get_uploadpack $1)\"\n> +fi\nI forgot to mention that this needs the patches\n\n\trename --exec to --upload-pack for fetch-pack and peek-remote\n\t\t(Message-ID: <20070123082017.GA10007@cepheus>)\n\nand\n\n\tls-remote and clone: accept --upload-pack=<path> as well.\n\t\tby Junio  (Message-ID: <7vlkjunlgk.fsf@assigned-by-dhcp.cox.net>)\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\ndd if=/proc/self/exe bs=1 skip=1 count=3 2>/dev/null\n"}]}