{"thread":{"id":"30101","subject":"[PATCH] Make http-backend REMOTE_USER configurable","startedAt":"2012-03-29T19:58:59Z","lastAt":"2012-03-30T16:13:13Z","messageCount":8,"participants":["William Strecker-Kellogg","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"188093","messageId":"1333051139-14262-1-git-send-email-willsk@bnl.gov","threadId":"30101","inReplyTo":null,"subject":"[PATCH] Make http-backend REMOTE_USER configurable","fromName":"William Strecker-Kellogg","fromEmail":"willsk@bnl.gov","sentAt":"2012-03-29T19:58:59Z","receivedAt":"2012-03-29T19:58:59Z","isPatch":true,"sender":{"key":"willsk@bnl.gov","avatar":null},"body":"The http-backend looks at $REMOTE_USER and sets $GIT_COMMITTER_NAME to\nthat for use in the hooks. At our site we have a third party\nauthentication module for our proxy (Shibboleth) which sets an alternative\nenvironment variable that our backend sees instead of REMOTE USER.\n\nThis patch adds the config option http.remoteuser which changes what\nenvironment variable is inspected by the http-backend code (it defaults\nto REMOTE_USER).\n\nReported-by: Jason Smith <smithj4@bnl.gov>\nTested-by: William Strecker-Kellogg <willsk@bnl.gov>\nSigned-off-by: William Strecker-Kellogg <willsk@bnl.gov>\n---\n\nI do not know if anyone else may find this useful, but FWIW, this works\nfor us. It may even be a good idea to add the ability to overwrite other\ndefault CGI environment variables, although I can't think of any other\nones at the moment.\n\n\n Documentation/git-http-backend.txt |   14 ++++++++++----\n http-backend.c                     |   13 +++++++++++--\n 2 files changed, 21 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt\nindex f4e0741..b320a45 100644\n--- a/Documentation/git-http-backend.txt\n+++ b/Documentation/git-http-backend.txt\n@@ -42,6 +42,10 @@ http.getanyfile::\n \tIt is enabled by default, but a repository can disable it\n \tby setting this configuration item to `false`.\n \n+http.remoteuser::\n+\tThis setting, if present, changes what environment variable is inspected\n+\tto determine the remote user (the default is \"REMOTE_USER\").\n+\n http.uploadpack::\n \tThis serves 'git fetch-pack' and 'git ls-remote' clients.\n \tIt is enabled by default, but a repository can disable it\n@@ -175,10 +179,12 @@ The GIT_HTTP_EXPORT_ALL environmental variable may be passed to\n 'git-http-backend' to bypass the check for the \"git-daemon-export-ok\"\n file in each repository before allowing export of that repository.\n \n-The backend process sets GIT_COMMITTER_NAME to '$REMOTE_USER' and\n-GIT_COMMITTER_EMAIL to '$\\{REMOTE_USER}@http.$\\{REMOTE_ADDR\\}',\n-ensuring that any reflogs created by 'git-receive-pack' contain some\n-identifying information of the remote user who performed the push.\n+The backend process sets GIT_COMMITTER_NAME to '$REMOTE_USER' (or\n+if http.remoteuser is present it sets it to $\\{http.remoteuser\\})\n+and GIT_COMMITTER_EMAIL to '$\\{REMOTE_USER}@http.$\\{REMOTE_ADDR\\}',\n+ensuring that any reflogs created by 'git-receive-pack' contain\n+some identifying information of the remote user who performed the\n+push.\n \n All CGI environment variables are available to each of the hooks\n invoked by the 'git-receive-pack'.\ndiff --git a/http-backend.c b/http-backend.c\nindex 869d515..69756f0 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -11,6 +11,7 @@\n static const char content_type[] = \"Content-Type\";\n static const char content_length[] = \"Content-Length\";\n static const char last_modified[] = \"Last-Modified\";\n+static char *remoteuser = \"REMOTE_USER\";\n static int getanyfile = 1;\n \n static struct string_list *query_params;\n@@ -225,6 +226,14 @@ static int http_config(const char *var, const char *value, void *cb)\n \t\treturn 0;\n \t}\n \n+\tif(!strcmp(var, \"http.remoteuser\")) {\n+\t\tchar *tmp;\n+\t\tif(git_config_string(&tmp, var, value) == 0) {\n+\t\t\tremoteuser = tmp;\n+\t\t}\n+\t\treturn 0;\n+\t}\n+\n \tif (!prefixcmp(var, \"http.\")) {\n \t\tint i;\n \n@@ -261,7 +270,7 @@ static struct rpc_service *select_service(const char *name)\n \t\tforbidden(\"Unsupported service: '%s'\", name);\n \n \tif (svc->enabled < 0) {\n-\t\tconst char *user = getenv(\"REMOTE_USER\");\n+\t\tconst char *user = getenv(remoteuser);\n \t\tsvc->enabled = (user && *user) ? 1 : 0;\n \t}\n \tif (!svc->enabled)\n@@ -315,7 +324,7 @@ done:\n static void run_service(const char **argv)\n {\n \tconst char *encoding = getenv(\"HTTP_CONTENT_ENCODING\");\n-\tconst char *user = getenv(\"REMOTE_USER\");\n+\tconst char *user = getenv(remoteuser);\n \tconst char *host = getenv(\"REMOTE_ADDR\");\n \tchar *env[3];\n \tstruct strbuf buf = STRBUF_INIT;\n-- \n1.7.7.6\n"},{"id":"188100","messageId":"7vzkazoyk3.fsf@alter.siamese.dyndns.org","threadId":"30101","inReplyTo":"1333051139-14262-1-git-send-email-willsk@bnl.gov","subject":"Re: [PATCH] Make http-backend REMOTE_USER configurable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-29T22:02:52Z","receivedAt":"2012-03-29T22:02:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"William Strecker-Kellogg <willsk@bnl.gov> writes:\n\n> The http-backend looks at $REMOTE_USER and sets $GIT_COMMITTER_NAME to\n> that for use in the hooks. At our site we have a third party\n> authentication module for our proxy (Shibboleth) which sets an alternative\n> environment variable that our backend sees instead of REMOTE USER.\n>\n> This patch adds the config option http.remoteuser which changes what\n> environment variable is inspected by the http-backend code (it defaults\n> to REMOTE_USER).\n\nWhat is the chain of systems that pass the authenticated ident down to\nthis CGI program?  Can another part of that chain stuff the value of\nSHIBBOLETH_USER (or whatever) to REMOTE_USER before running it?\n\nAs a design, I am not convinced this is a good change.  \n\nWhat if the next person wants to interoperate with an authentication\nsystem that passes the same information via a mechanism different from\nenvironment variables?  This change does not help him at all, as it is\nstill married to \"the information has to come from an environment\nvariable\" limitation.\n\nWhat if an authentication system can supply more appropriate committer\nident information other than just the uesrname part?\n\nIf it were a patch to teach the CGI program a new command line parameter,\ne.g. --log-as=\"C O Mitter <committer@example.xz>\", it may have made a lot\nmore sense, though.\n"},{"id":"188103","messageId":"20120329222230.GB1413@sigill.intra.peff.net","threadId":"30101","inReplyTo":"7vzkazoyk3.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Make http-backend REMOTE_USER configurable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-29T22:22:30Z","receivedAt":"2012-03-29T22:22:30Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Mar 29, 2012 at 03:02:52PM -0700, Junio C Hamano wrote:\n\n> William Strecker-Kellogg <willsk@bnl.gov> writes:\n> \n> > The http-backend looks at $REMOTE_USER and sets $GIT_COMMITTER_NAME to\n> > that for use in the hooks. At our site we have a third party\n> > authentication module for our proxy (Shibboleth) which sets an alternative\n> > environment variable that our backend sees instead of REMOTE USER.\n> >\n> > This patch adds the config option http.remoteuser which changes what\n> > environment variable is inspected by the http-backend code (it defaults\n> > to REMOTE_USER).\n> \n> What is the chain of systems that pass the authenticated ident down to\n> this CGI program?  Can another part of that chain stuff the value of\n> SHIBBOLETH_USER (or whatever) to REMOTE_USER before running it?\n> \n> As a design, I am not convinced this is a good change.\n> \n> What if the next person wants to interoperate with an authentication\n> system that passes the same information via a mechanism different from\n> environment variables?  This change does not help him at all, as it is\n> still married to \"the information has to come from an environment\n> variable\" limitation.\n> \n> What if an authentication system can supply more appropriate committer\n> ident information other than just the uesrname part?\n\nI agree. It seems like one could just wrap http-backend in a script like\nthis:\n\n  #!/bin/sh\n  REMOTE_USER=$SHIBBOLETH_USER\n  exec git http-backend \"$@\"\n\nand that leaves way more flexibility. I think an even better thing would\nbe for http-backend to leave GIT_COMMITTER_* alone if it exists; that is\nthe usual well-known interface for setting such things. And then you\ncould specify a detailed committer name and email if you want, or leave\nthem blank to pull from $REMOTE_USER as we do now. As it is now, even if\nyou specify GIT_COMMITTER_EMAIL, it gets overwritten with\n\"$REMOTE_USER@http.$REMOTE_ADDR\".\n\nJust today, we were looking at a similar patch for GitHub (we keep\nreflogs on all pushes, and we want to put useful information about the\npusher into the reflog). William's patch would not be flexible enough\nfor what we want to do, but setting GIT_COMMITTER_* would be easy (we\nare also stuffing more information into the reflog message, but that is\na separate issue).\n\n-Peff\n"},{"id":"188104","messageId":"20120329222632.GC1413@sigill.intra.peff.net","threadId":"30101","inReplyTo":"20120329222230.GB1413@sigill.intra.peff.net","subject":"Re: [PATCH] Make http-backend REMOTE_USER configurable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-29T22:26:32Z","receivedAt":"2012-03-29T22:26:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Mar 29, 2012 at 06:22:30PM -0400, Jeff King wrote:\n\n> I think an even better thing would be for http-backend to leave\n> GIT_COMMITTER_* alone if it exists; that is the usual well-known\n> interface for setting such things. And then you could specify a\n> detailed committer name and email if you want, or leave them blank to\n> pull from $REMOTE_USER as we do now. As it is now, even if you specify\n> GIT_COMMITTER_EMAIL, it gets overwritten with\n> \"$REMOTE_USER@http.$REMOTE_ADDR\".\n\nThat patch would look something like this:\n\n---\ndiff --git a/http-backend.c b/http-backend.c\nindex 869d515..aa892e6 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -318,7 +318,7 @@ static void run_service(const char **argv)\n \tconst char *user = getenv(\"REMOTE_USER\");\n \tconst char *host = getenv(\"REMOTE_ADDR\");\n \tchar *env[3];\n-\tstruct strbuf buf = STRBUF_INIT;\n+\tint num_env = 0;\n \tint gzipped_request = 0;\n \tstruct child_process cld;\n \n@@ -332,13 +332,17 @@ static void run_service(const char **argv)\n \tif (!host || !*host)\n \t\thost = \"(none)\";\n \n-\tmemset(&env, 0, sizeof(env));\n-\tstrbuf_addf(&buf, \"GIT_COMMITTER_NAME=%s\", user);\n-\tenv[0] = strbuf_detach(&buf, NULL);\n-\n-\tstrbuf_addf(&buf, \"GIT_COMMITTER_EMAIL=%s@http.%s\", user, host);\n-\tenv[1] = strbuf_detach(&buf, NULL);\n-\tenv[2] = NULL;\n+\tif (!getenv(\"GIT_COMMITTER_NAME\")) {\n+\t\tstruct strbuf buf = STRBUF_INIT;\n+\t\tstrbuf_addf(&buf, \"GIT_COMMITTER_NAME=%s\", user);\n+\t\tenv[num_env++] = strbuf_detach(&buf, NULL);\n+\t}\n+\tif (!getenv(\"GIT_COMMITTER_EMAIL\")) {\n+\t\tstruct strbuf buf = STRBUF_INIT;\n+\t\tstrbuf_addf(&buf, \"GIT_COMMITTER_EMAIL=%s@http.%s\", user, host);\n+\t\tenv[num_env++] = strbuf_detach(&buf, NULL);\n+\t}\n+\tenv[num_env] = NULL;\n \n \tmemset(&cld, 0, sizeof(cld));\n \tcld.argv = argv;\n@@ -359,7 +363,6 @@ static void run_service(const char **argv)\n \t\texit(1);\n \tfree(env[0]);\n \tfree(env[1]);\n-\tstrbuf_release(&buf);\n }\n \n static int show_text_ref(const char *name, const unsigned char *sha1,\n"},{"id":"188112","messageId":"7vk422q2ho.fsf@alter.siamese.dyndns.org","threadId":"30101","inReplyTo":"20120329222632.GC1413@sigill.intra.peff.net","subject":"Re: [PATCH] Make http-backend REMOTE_USER configurable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-30T01:52:35Z","receivedAt":"2012-03-30T01:52:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Thu, Mar 29, 2012 at 06:22:30PM -0400, Jeff King wrote:\n>\n>> I think an even better thing would be for http-backend to leave\n>> GIT_COMMITTER_* alone if it exists; that is the usual well-known\n>> interface for setting such things. And then you could specify a\n>> detailed committer name and email if you want, or leave them blank to\n>> pull from $REMOTE_USER as we do now. As it is now, even if you specify\n>> GIT_COMMITTER_EMAIL, it gets overwritten with\n>> \"$REMOTE_USER@http.$REMOTE_ADDR\".\n>\n> That patch would look something like this:\n\nIt would regress for somebody who is running the CGI program while\nexporting these environment variables pointing at himself and relying on\nthe fact that these are canceled by REMOTE_USER/ADDR (perhaps a web-based\neditor can write into some repository and commits made by that editor\ntakes the ident information from COMMITTER variables, while another part\nof the webserver takes a push by spawning the http backend???).\n\nWhich is very unlikely.\n\nIf somebody else comes up with a valid scenario to show why this patch is\na bad idea, I'd stand corrected but at the same time I'd be very surprised.\n\nBut I think this is the right thing to do, even though it is not related\nto the issue William wanted to address with his patch.\n\nCare to sign it off?\n"},{"id":"188121","messageId":"4F752777.2020000@bnl.gov","threadId":"30101","inReplyTo":"7vk422q2ho.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Make http-backend REMOTE_USER configurable","fromName":"William Strecker-Kellogg","fromEmail":"willsk@bnl.gov","sentAt":"2012-03-30T03:24:39Z","receivedAt":"2012-03-30T03:24:39Z","isPatch":true,"sender":{"key":"willsk@bnl.gov","avatar":null},"body":"On 03/29/2012 09:52 PM, Junio C Hamano wrote:\n> Jeff King <peff@peff.net> writes:\n> \n>> On Thu, Mar 29, 2012 at 06:22:30PM -0400, Jeff King wrote:\n>>\n>>> I think an even better thing would be for http-backend to leave\n>>> GIT_COMMITTER_* alone if it exists; that is the usual well-known\n>>> interface for setting such things. And then you could specify a\n>>> detailed committer name and email if you want, or leave them blank to\n>>> pull from $REMOTE_USER as we do now. As it is now, even if you specify\n>>> GIT_COMMITTER_EMAIL, it gets overwritten with\n>>> \"$REMOTE_USER@http.$REMOTE_ADDR\".\n>>\n>> That patch would look something like this:\n> \n> It would regress for somebody who is running the CGI program while\n> exporting these environment variables pointing at himself and relying on\n> the fact that these are canceled by REMOTE_USER/ADDR (perhaps a web-based\n> editor can write into some repository and commits made by that editor\n> takes the ident information from COMMITTER variables, while another part\n> of the webserver takes a push by spawning the http backend???).\n> \n> Which is very unlikely.\n\nAgreed.\n\n> \n> If somebody else comes up with a valid scenario to show why this patch is\n> a bad idea, I'd stand corrected but at the same time I'd be very surprised.\n> \n> But I think this is the right thing to do, even though it is not related\n> to the issue William wanted to address with his patch.\n> \n\nThe reason we're interested in this is validation -- who can push to our\nproduction puppet branch is determined by a post-update hook.  A wrapper\naround http-backend like Jeff's combined with his patch would accomplish\nwhat we need just fine.\n\n> Care to sign it off?\n> \n"},{"id":"188132","messageId":"20120330070130.GA30656@sigill.intra.peff.net","threadId":"30101","inReplyTo":"7vk422q2ho.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Make http-backend REMOTE_USER configurable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-30T07:01:30Z","receivedAt":"2012-03-30T07:01:30Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Mar 29, 2012 at 06:52:35PM -0700, Junio C Hamano wrote:\n\n> It would regress for somebody who is running the CGI program while\n> exporting these environment variables pointing at himself and relying on\n> the fact that these are canceled by REMOTE_USER/ADDR (perhaps a web-based\n> editor can write into some repository and commits made by that editor\n> takes the ident information from COMMITTER variables, while another part\n> of the webserver takes a push by spawning the http backend???).\n> \n> Which is very unlikely.\n\nYeah, I agree that is not worth worrying too much about.\n\n> But I think this is the right thing to do, even though it is not related\n> to the issue William wanted to address with his patch.\n> \n> Care to sign it off?\n\nUpdated patch is below. In addition to a commit message and signoff, I\ntweaked two things:\n\n  1. The original I posted failed to update the free() calls at the end\n     of the function (and since we now have a variable number of env\n     variables, we can't just free all elements). I ended up just\n     converting this to use argv_array, which handles the memory\n     management for us and is way shorter and easier to read.\n\n  2. I added tests, both for the default behavior and for the new one.\n     The \"127.0.0.1\" is hard-coded in the expected output (but comes\n     from apache's setting of REMOTE_ADDR). I think this is OK. The\n     lib-httpd setup code always listens on 127.0.0.1, so short of some\n     insane loopback routing setup, the REMOTE_ADDR should also be\n     127.0.0.1.\n\n-- >8 --\nSubject: http-backend: respect existing GIT_COMMITTER_* variables\n\nThe http-backend program sets default GIT_COMMITTER_NAME and\nGIT_COMMITTER_EMAIL variables based on the REMOTE_USER and\nREMOTE_ADDR variables provided by the webserver. However, it\nunconditionally overwrites any existing GIT_COMMITTER\nvariables, which may have been customized by site-specific\ncode in the webserver (or in a script wrapping http-backend).\n\nLet's leave those variables intact if they already exist,\nassuming that any such configuration was intentional. There\nis a slight chance of a regression if somebody has set\nGIT_COMMITTER_* for the entire webserver, not intending it\nto leak through http-backend. We could protect against this\nby passing the information in alternate variables.  However,\nit seems unlikely that anyone will care about that\nregression, and there is value in the simplicity of using\nthe common variable names that are used elsewhere in git.\n\nWhile we're tweaking the environment-handling in\nhttp-backend, let's switch it to use argv_array to handle\nthe list of variables. That makes the memory management much\nsimpler.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n http-backend.c          |   22 +++++++++-------------\n t/lib-httpd/apache.conf |    7 +++++++\n t/t5541-http-push.sh    |   21 +++++++++++++++++++++\n 3 files changed, 37 insertions(+), 13 deletions(-)\n\ndiff --git a/http-backend.c b/http-backend.c\nindex 869d515..f50e77f 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -7,6 +7,7 @@\n #include \"run-command.h\"\n #include \"string-list.h\"\n #include \"url.h\"\n+#include \"argv-array.h\"\n \n static const char content_type[] = \"Content-Type\";\n static const char content_length[] = \"Content-Length\";\n@@ -317,8 +318,7 @@ static void run_service(const char **argv)\n \tconst char *encoding = getenv(\"HTTP_CONTENT_ENCODING\");\n \tconst char *user = getenv(\"REMOTE_USER\");\n \tconst char *host = getenv(\"REMOTE_ADDR\");\n-\tchar *env[3];\n-\tstruct strbuf buf = STRBUF_INIT;\n+\tstruct argv_array env = ARGV_ARRAY_INIT;\n \tint gzipped_request = 0;\n \tstruct child_process cld;\n \n@@ -332,17 +332,15 @@ static void run_service(const char **argv)\n \tif (!host || !*host)\n \t\thost = \"(none)\";\n \n-\tmemset(&env, 0, sizeof(env));\n-\tstrbuf_addf(&buf, \"GIT_COMMITTER_NAME=%s\", user);\n-\tenv[0] = strbuf_detach(&buf, NULL);\n-\n-\tstrbuf_addf(&buf, \"GIT_COMMITTER_EMAIL=%s@http.%s\", user, host);\n-\tenv[1] = strbuf_detach(&buf, NULL);\n-\tenv[2] = NULL;\n+\tif (!getenv(\"GIT_COMMITTER_NAME\"))\n+\t\targv_array_pushf(&env, \"GIT_COMMITTER_NAME=%s\", user);\n+\tif (!getenv(\"GIT_COMMITTER_EMAIL\"))\n+\t\targv_array_pushf(&env, \"GIT_COMMITTER_EMAIL=%s@http.%s\",\n+\t\t\t\t user, host);\n \n \tmemset(&cld, 0, sizeof(cld));\n \tcld.argv = argv;\n-\tcld.env = (const char *const *)env;\n+\tcld.env = env.argv;\n \tif (gzipped_request)\n \t\tcld.in = -1;\n \tcld.git_cmd = 1;\n@@ -357,9 +355,7 @@ static void run_service(const char **argv)\n \n \tif (finish_command(&cld))\n \t\texit(1);\n-\tfree(env[0]);\n-\tfree(env[1]);\n-\tstrbuf_release(&buf);\n+\targv_array_clear(&env);\n }\n \n static int show_text_ref(const char *name, const unsigned char *sha1,\ndiff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf\nindex 3c12b05..de3762e 100644\n--- a/t/lib-httpd/apache.conf\n+++ b/t/lib-httpd/apache.conf\n@@ -52,8 +52,15 @@ Alias /auth/ www/auth/\n <Location /smart_noexport/>\n \tSetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}\n </Location>\n+<Location /smart_custom_env/>\n+\tSetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}\n+\tSetEnv GIT_HTTP_EXPORT_ALL\n+\tSetEnv GIT_COMMITTER_NAME \"Custom User\"\n+\tSetEnv GIT_COMMITTER_EMAIL custom@example.com\n+</Location>\n ScriptAlias /smart/ ${GIT_EXEC_PATH}/git-http-backend/\n ScriptAlias /smart_noexport/ ${GIT_EXEC_PATH}/git-http-backend/\n+ScriptAlias /smart_custom_env/ ${GIT_EXEC_PATH}/git-http-backend/\n <Directory ${GIT_EXEC_PATH}>\n \tOptions None\n </Directory>\ndiff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh\nindex cc6f081..d7964c7 100755\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -30,6 +30,7 @@ test_expect_success 'setup remote repository' '\n \tgit clone --bare test_repo test_repo.git &&\n \tcd test_repo.git &&\n \tgit config http.receivepack true &&\n+\tgit config core.logallrefupdates true &&\n \tORIG_HEAD=$(git rev-parse --verify HEAD) &&\n \tcd - &&\n \tmv test_repo.git \"$HTTPD_DOCUMENT_ROOT_PATH\"\n@@ -222,5 +223,25 @@ test_expect_success TTY 'quiet push' '\n \ttest_cmp /dev/null output\n '\n \n+test_expect_success 'http push gives sane defaults to reflog' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\ttest_commit reflog-test &&\n+\tgit push \"$HTTPD_URL\"/smart/test_repo.git &&\n+\tgit --git-dir=\"$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git\" \\\n+\t\tlog -g -1 --format=\"%gn <%ge>\" >actual &&\n+\techo \"anonymous <anonymous@http.127.0.0.1>\" >expect &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'http push respects GIT_COMMITTER_* in reflog' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\ttest_commit custom-reflog-test &&\n+\tgit push \"$HTTPD_URL\"/smart_custom_env/test_repo.git &&\n+\tgit --git-dir=\"$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git\" \\\n+\t\tlog -g -1 --format=\"%gn <%ge>\" >actual &&\n+\techo \"Custom User <custom@example.com>\" >expect &&\n+\ttest_cmp expect actual\n+'\n+\n stop_httpd\n test_done\n-- \n1.7.9.5.7.g11b89\n"},{"id":"188171","messageId":"7vvclmm5ie.fsf@alter.siamese.dyndns.org","threadId":"30101","inReplyTo":"20120330070130.GA30656@sigill.intra.peff.net","subject":"Re: [PATCH] Make http-backend REMOTE_USER configurable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-30T16:13:13Z","receivedAt":"2012-03-30T16:13:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}