{"thread":{"id":"544","subject":"[PATCH] Add cg-printenv command.","startedAt":"2005-05-09T01:11:10Z","lastAt":"2005-05-09T13:35:32Z","messageCount":8,"participants":["Steven Cole","Marcel Holtmann","Junio C Hamano","Sean","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"2848","messageId":"200505081911.10371.elenstev@mesatop.com","threadId":"544","inReplyTo":null,"subject":"[PATCH] Add cg-printenv command.","fromName":"Steven Cole","fromEmail":"elenstev@mesatop.com","sentAt":"2005-05-09T01:11:10Z","receivedAt":"2005-05-09T01:11:10Z","isPatch":true,"sender":{"key":"elenstev@mesatop.com","avatar":null},"body":"The cg-printenv command will print exported git environment variables.\n\nSigned-off-by: Steven Cole <elenstev@mesatop.com>\n\nIndex: Makefile\n===================================================================\n--- 3974261da777f55a7a11aff6e02f584bbfe2b475/Makefile  (mode:100644)\n+++ uncommitted/Makefile  (mode:100644)\n@@ -48,7 +48,8 @@\n SCRIPT=\tcommit-id tree-id parent-id cg-add cg-admin-lsobj cg-admin-uncommit \\\n \tcg-branch-add cg-branch-ls cg-cancel cg-clone cg-commit cg-diff \\\n \tcg-export cg-help cg-init cg-log cg-ls cg-merge cg-mkpatch cg-patch \\\n-\tcg-pull cg-restore cg-rm cg-seek cg-status cg-tag cg-tag-ls cg-update\n+\tcg-printenv cg-pull cg-restore cg-rm cg-seek cg-status cg-tag cg-tag-ls \\\n+\tcg-update\n \n LIB_SCRIPT=cg-Xlib cg-Xdiffdo cg-Xmergefile\n \nIndex: cg-help\n===================================================================\n--- 3974261da777f55a7a11aff6e02f584bbfe2b475/cg-help  (mode:100755)\n+++ uncommitted/cg-help  (mode:100755)\n@@ -35,6 +35,7 @@\n \tcg-merge\t[-c] [-b BASE_ID] FROM_ID\n \tcg-mkpatch\t[-s] [-r FROM_ID[:TO_ID]]\n \tcg-patch\t\t\t< patch on stdin\n+\tcg-printenv\n \tcg-pull\t\t[BNAME]\n \tcg-restore\t[FILE]...\n \tcg-rm\t\tFILE...\nIndex: cg-printenv\n===================================================================\n--- /dev/null  (tree:3974261da777f55a7a11aff6e02f584bbfe2b475)\n+++ uncommitted/cg-printenv  (mode:100755)\n@@ -0,0 +1,21 @@\n+#!/usr/bin/env bash\n+#\n+# Print exported git environment variables\n+# Copyright (c) Steven Cole 2005\n+#\n+#These git environment variables are used in case\n+#values other than that returned by getpwuid(getuid())\n+#are desired when performing a commit.\n+#\n+#AUTHOR_NAME\t\tAuthor's name\n+#AUTHOR_EMAIL\t\tAuthor's e-mail address\n+#AUTHOR_DATE\t\tDate, perhaps from a patch e-mail\n+#COMMIT_AUTHOR_NAME\tCommitter's name\n+#COMMIT_AUTHOR_EMAIL\tCommitter's e-mail address\n+#\n+# Takes no parameters.\n+echo \"AUTHOR_NAME=\"$AUTHOR_NAME\n+echo \"AUTHOR_EMAIL=\"$AUTHOR_EMAIL\n+echo \"AUTHOR_DATE=\"$AUTHOR_DATE\n+echo \"COMMIT_AUTHOR_NAME=\"$COMMIT_AUTHOR_NAME\n+echo \"COMMIT_AUTHOR_EMAIL=\"$COMMIT_AUTHOR_EMAIL\n"},{"id":"2849","messageId":"1115601540.8949.104.camel@pegasus","threadId":"544","inReplyTo":"200505081911.10371.elenstev@mesatop.com","subject":"Re: [PATCH] Add cg-printenv command.","fromName":"Marcel Holtmann","fromEmail":"marcel@holtmann.org","sentAt":"2005-05-09T01:19:00Z","receivedAt":"2005-05-09T01:19:00Z","isPatch":true,"sender":{"key":"marcel@holtmann.org","avatar":null},"body":"Hi Steven,\n\n> The cg-printenv command will print exported git environment variables.\n\nI like that idea. It is much more handy then using env and grep for the\nvariable names.\n\nRegards\n\nMarcel\n\n\n"},{"id":"2851","messageId":"7vpsw115v0.fsf@assigned-by-dhcp.cox.net","threadId":"544","inReplyTo":"1115601540.8949.104.camel@pegasus","subject":"Re: [PATCH] Add cg-printenv command.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-09T02:38:11Z","receivedAt":"2005-05-09T02:38:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"MH> Hi Steven,\n>> The cg-printenv command will print exported git environment variables.\nSC> +echo \"AUTHOR_NAME=\"$AUTHOR_NAME\nSC> +echo \"AUTHOR_EMAIL=\"$AUTHOR_EMAIL\nSC> +echo \"AUTHOR_DATE=\"$AUTHOR_DATE\nSC> +echo \"COMMIT_AUTHOR_NAME=\"$COMMIT_AUTHOR_NAME\nSC> +echo \"COMMIT_AUTHOR_EMAIL=\"$COMMIT_AUTHOR_EMAIL\n\nMH> I like that idea. It is much more handy then using env and grep for the\nMH> variable names.\n\nI wonder what this command is used for?  In a script to be\n\"eval\"ed?  Or just interactively by the end-user?\n\nEven if it is just for human consumption, I think the echo\ncommands I quoted above have double quotes backwards.  Wouldn't\nit make more sense to quote the variables so shell expansion\nwould not lose whitespaces inside of variable values, like this?\n\n    echo AUTHOR_NAME=\"$AUTHOR_NAME\"\n    echo AUTHOR_EMAIL=\"$AUTHOR_EMAIL\"\n    echo AUTHOR_DATE=\"$AUTHOR_DATE\"\n    echo COMMIT_AUTHOR_NAME=\"$COMMIT_AUTHOR_NAME\"\n    echo COMMIT_AUTHOR_EMAIL=\"$COMMIT_AUTHOR_EMAIL\"\n\nIf it is for eval consumption of course they have to be much\nmore careful.\n\n"},{"id":"2854","messageId":"200505082125.28521.elenstev@mesatop.com","threadId":"544","inReplyTo":"7vpsw115v0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add cg-printenv command.","fromName":"Steven Cole","fromEmail":"elenstev@mesatop.com","sentAt":"2005-05-09T03:25:28Z","receivedAt":"2005-05-09T03:25:28Z","isPatch":true,"sender":{"key":"elenstev@mesatop.com","avatar":null},"body":"On Sunday 08 May 2005 08:38 pm, Junio C Hamano wrote:\n> MH> Hi Steven,\n> >> The cg-printenv command will print exported git environment variables.\n> SC> +echo \"AUTHOR_NAME=\"$AUTHOR_NAME\n> SC> +echo \"AUTHOR_EMAIL=\"$AUTHOR_EMAIL\n> SC> +echo \"AUTHOR_DATE=\"$AUTHOR_DATE\n> SC> +echo \"COMMIT_AUTHOR_NAME=\"$COMMIT_AUTHOR_NAME\n> SC> +echo \"COMMIT_AUTHOR_EMAIL=\"$COMMIT_AUTHOR_EMAIL\n> \n> MH> I like that idea. It is much more handy then using env and grep for the\n> MH> variable names.\n> \n> I wonder what this command is used for?  In a script to be\n> \"eval\"ed?  Or just interactively by the end-user?\n\nI had intended it only as a quick check by an end-user before doing\na commit that the values had been set as desired.\n\n> \n> Even if it is just for human consumption, I think the echo\n> commands I quoted above have double quotes backwards.  Wouldn't\n> it make more sense to quote the variables so shell expansion\n> would not lose whitespaces inside of variable values, like this?\n> \n>     echo AUTHOR_NAME=\"$AUTHOR_NAME\"\n>     echo AUTHOR_EMAIL=\"$AUTHOR_EMAIL\"\n>     echo AUTHOR_DATE=\"$AUTHOR_DATE\"\n>     echo COMMIT_AUTHOR_NAME=\"$COMMIT_AUTHOR_NAME\"\n>     echo COMMIT_AUTHOR_EMAIL=\"$COMMIT_AUTHOR_EMAIL\"\n> \nMy simple testing didn't result in any meaningful whitespace loss,\nbut I only had a single blank character inside my test strings.  Your\nmethod is better.\n\n[steven@spc cogito]$ echo \"AUTHOR_NAME=\"$AUTHOR_NAME\nAUTHOR_NAME=Homer Simpson\n[steven@spc cogito]$ echo COMMIT_AUTHOR_NAME=\"$COMMIT_AUTHOR_NAME\"\nCOMMIT_AUTHOR_NAME=Two  Spaces  Here\n\n> If it is for eval consumption of course they have to be much\n> more careful.\n> \n\nIf Petr wants to add this command, he can either move the double quotes\nor I can submit a modified patch.\n\nThanks,\nSteven\n"},{"id":"2855","messageId":"2970.10.10.10.24.1115610025.squirrel@linux1","threadId":"544","inReplyTo":"200505082125.28521.elenstev@mesatop.com","subject":"Re: [PATCH] Add cg-printenv command.","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2005-05-09T03:40:25Z","receivedAt":"2005-05-09T03:40:25Z","isPatch":true,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Sun, May 8, 2005 11:25 pm, Steven Cole said:\n\n> I had intended it only as a quick check by an end-user before doing\n> a commit that the values had been set as desired.\n\nHey Steven,\n\nRather than creating a separate command, perhaps the values could\nautomatically be added to the initial commit message in a few \"CG:\" lines?\n\nSean\n\n\n"},{"id":"2857","messageId":"200505082159.59595.elenstev@mesatop.com","threadId":"544","inReplyTo":"2970.10.10.10.24.1115610025.squirrel@linux1","subject":"Re: [PATCH] Add cg-printenv command.","fromName":"Steven Cole","fromEmail":"elenstev@mesatop.com","sentAt":"2005-05-09T03:59:59Z","receivedAt":"2005-05-09T03:59:59Z","isPatch":true,"sender":{"key":"elenstev@mesatop.com","avatar":null},"body":"On Sunday 08 May 2005 09:40 pm, Sean wrote:\n> On Sun, May 8, 2005 11:25 pm, Steven Cole said:\n> \n> > I had intended it only as a quick check by an end-user before doing\n> > a commit that the values had been set as desired.\n> \n> Hey Steven,\n> \n> Rather than creating a separate command, perhaps the values could\n> automatically be added to the initial commit message in a few \"CG:\" lines?\n> \n> Sean\n\nA secondary reason for adding the cg-printenv capability was that a user would\nsee this command in the cg-help list, and cg-help printenv would give:\n\nPrint exported git environment variables\nCopyright (c) Steven Cole 2005  <--- Petr, my early version of cg-help stripped (c) lines.\n\nThese git environment variables are used in case\nvalues other than that returned by getpwuid(getuid())\nare desired when performing a commit.\n\nAUTHOR_NAME\t\tAuthor's name\nAUTHOR_EMAIL\t\tAuthor's e-mail address\nAUTHOR_DATE\t\tDate, perhaps from a patch e-mail\nCOMMIT_AUTHOR_NAME\tCommitter's name\nCOMMIT_AUTHOR_EMAIL\tCommitter's e-mail address\n\nTakes no parameters.\n-------------\nYes, I know that the environment variables are documented in Documentation/core-git.txt,\nbut having this usage right up front like this may help those who only RTFM as a last resort.\n\nIf others feel that the more obscure environment variables should be exposed here, feel\nfree to submit patches.\n\nHere is a patch with Junio's improved version:\n\n--------------------------------------------------------------------------------------\nThe cg-printenv command will print exported git environment variables.\n\nSigned-off-by: Steven Cole <elenstev@mesatop.com>\n\nIndex: Makefile\n===================================================================\n--- 3974261da777f55a7a11aff6e02f584bbfe2b475/Makefile  (mode:100644)\n+++ uncommitted/Makefile  (mode:100644)\n@@ -48,7 +48,8 @@\n SCRIPT=\tcommit-id tree-id parent-id cg-add cg-admin-lsobj cg-admin-uncommit \\\n \tcg-branch-add cg-branch-ls cg-cancel cg-clone cg-commit cg-diff \\\n \tcg-export cg-help cg-init cg-log cg-ls cg-merge cg-mkpatch cg-patch \\\n-\tcg-pull cg-restore cg-rm cg-seek cg-status cg-tag cg-tag-ls cg-update\n+\tcg-printenv cg-pull cg-restore cg-rm cg-seek cg-status cg-tag cg-tag-ls \\\n+\tcg-update\n \n LIB_SCRIPT=cg-Xlib cg-Xdiffdo cg-Xmergefile\n \nIndex: cg-help\n===================================================================\n--- 3974261da777f55a7a11aff6e02f584bbfe2b475/cg-help  (mode:100755)\n+++ uncommitted/cg-help  (mode:100755)\n@@ -35,6 +35,7 @@\n \tcg-merge\t[-c] [-b BASE_ID] FROM_ID\n \tcg-mkpatch\t[-s] [-r FROM_ID[:TO_ID]]\n \tcg-patch\t\t\t< patch on stdin\n+\tcg-printenv\n \tcg-pull\t\t[BNAME]\n \tcg-restore\t[FILE]...\n \tcg-rm\t\tFILE...\nIndex: cg-printenv\n===================================================================\n--- /dev/null  (tree:3974261da777f55a7a11aff6e02f584bbfe2b475)\n+++ uncommitted/cg-printenv  (mode:100755)\n@@ -0,0 +1,21 @@\n+#!/usr/bin/env bash\n+#\n+# Print exported git environment variables\n+# Copyright (c) Steven Cole 2005\n+#\n+#These git environment variables are used in case\n+#values other than that returned by getpwuid(getuid())\n+#are desired when performing a commit.\n+#\n+#AUTHOR_NAME\t\tAuthor's name\n+#AUTHOR_EMAIL\t\tAuthor's e-mail address\n+#AUTHOR_DATE\t\tDate, perhaps from a patch e-mail\n+#COMMIT_AUTHOR_NAME\tCommitter's name\n+#COMMIT_AUTHOR_EMAIL\tCommitter's e-mail address\n+#\n+# Takes no parameters.\n+echo AUTHOR_NAME=\"$AUTHOR_NAME\"\n+echo AUTHOR_EMAIL=\"$AUTHOR_EMAIL\"\n+echo AUTHOR_DATE=\"$AUTHOR_DATE\"\n+echo COMMIT_AUTHOR_NAME=\"$COMMIT_AUTHOR_NAME\"\n+echo COMMIT_AUTHOR_EMAIL=\"$COMMIT_AUTHOR_EMAIL\"\n\n"},{"id":"2865","messageId":"20050509072438.GB3599@pasky.ji.cz","threadId":"544","inReplyTo":"200505082159.59595.elenstev@mesatop.com","subject":"Re: [PATCH] Add cg-printenv command.","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-09T07:24:38Z","receivedAt":"2005-05-09T07:24:38Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, May 09, 2005 at 05:59:59AM CEST, I got a letter\nwhere Steven Cole <elenstev@mesatop.com> told me that...\n> On Sunday 08 May 2005 09:40 pm, Sean wrote:\n> > On Sun, May 8, 2005 11:25 pm, Steven Cole said:\n> > \n> > > I had intended it only as a quick check by an end-user before doing\n> > > a commit that the values had been set as desired.\n> > \n> > Hey Steven,\n> > \n> > Rather than creating a separate command, perhaps the values could\n> > automatically be added to the initial commit message in a few \"CG:\" lines?\n\nI was already thinking about this and I think Sean's way makes more\nsense. Also, I actually believe you should add this functionality to\ncommit-tree instead (commit-tree -n (dry-run), perhaps?) - so that the\nuser can actually check the default values commit-tree is going to use\ntoo. *That* would be useful.\n\n> A secondary reason for adding the cg-printenv capability was that a user would\n> see this command in the cg-help list, and cg-help printenv would give:\n\nNo, I think this sucks. You should just list the variables in cg-commit\ndocumentation if anything. That's where they matter anyway and where the\nuser could possibly look for them anyway.\n\nI think the command is otherwise pretty useless, and the important thing\nis, the command slots are precious (well, there are free cg-admin slots\nbut I think this one does not qualify there neither) - have too many\nuseless (or barely useful) commands and you end up as GNU Arch. So I'm\nwilling to add commands only when I'm convinced they will really help\nthe user.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"2876","messageId":"427F6724.6010705@mesatop.com","threadId":"544","inReplyTo":"20050509072438.GB3599@pasky.ji.cz","subject":"Re: [PATCH] Add cg-printenv command.","fromName":"Steven Cole","fromEmail":"elenstev@mesatop.com","sentAt":"2005-05-09T13:35:32Z","receivedAt":"2005-05-09T13:35:32Z","isPatch":true,"sender":{"key":"elenstev@mesatop.com","avatar":null},"body":"Petr Baudis wrote:\n> Dear diary, on Mon, May 09, 2005 at 05:59:59AM CEST, I got a letter\n> where Steven Cole <elenstev@mesatop.com> told me that...\n> \n>>On Sunday 08 May 2005 09:40 pm, Sean wrote:\n>>\n>>>On Sun, May 8, 2005 11:25 pm, Steven Cole said:\n>>>\n>>>\n>>>>I had intended it only as a quick check by an end-user before doing\n>>>>a commit that the values had been set as desired.\n>>>\n>>>Hey Steven,\n>>>\n>>>Rather than creating a separate command, perhaps the values could\n>>>automatically be added to the initial commit message in a few \"CG:\" lines?\n> \n> \n> I was already thinking about this and I think Sean's way makes more\n> sense. Also, I actually believe you should add this functionality to\n> commit-tree instead (commit-tree -n (dry-run), perhaps?) - so that the\n> user can actually check the default values commit-tree is going to use\n> too. *That* would be useful.\n\nI agree that having a --dry-run option here would be useful.  I frequently\nuse the 't' option when untarring an unfamiliar tarball.\n\n> \n> \n>>A secondary reason for adding the cg-printenv capability was that a user would\n>>see this command in the cg-help list, and cg-help printenv would give:\n> \n> \n> No, I think this sucks. You should just list the variables in cg-commit\n> documentation if anything. That's where they matter anyway and where the\n> user could possibly look for them anyway.\n\nOK. David has done a good job of documenting this in the git-commit-tree\nsection of Documentation/core-git.txt, and here is the information again in\nthe comment header for cg-commit.\n\nThat's the way of open source.  Post an idea, and any number of superior\nimplementations come rolling in.\n\n--------\nAdd comments to cg-commit to point out usage of git environment variables.\n\nSigned-off-by: Steven Cole <elenstev@mesatop.com>\n\n===================================================================\n--- 3974261da777f55a7a11aff6e02f584bbfe2b475/cg-commit  (mode:100755)\n+++ uncommitted/cg-commit  (mode:100755)\n@@ -13,6 +13,16 @@\n  # appended to a single commit message, each as separate paragraph.\n  # -e forces the editor to be brought up even when -m parameters were\n  # passed to cg-commit.\n+#\n+#These git environment variables are used in case\n+#values other than that returned by getpwuid(getuid())\n+#are desired when performing a commit.\n+#\n+#AUTHOR_NAME\t\tAuthor's name\n+#AUTHOR_EMAIL\t\tAuthor's e-mail address\n+#AUTHOR_DATE\t\tDate, perhaps from a patch e-mail\n+#COMMIT_AUTHOR_NAME\tCommitter's name\n+#COMMIT_AUTHOR_EMAIL\tCommitter's e-mail address\n\n  . ${COGITO_LIB}cg-Xlib\n\n\n\n"}]}