{"thread":{"id":"46880","subject":"What means \"git config bla ~/\"?","startedAt":"2017-10-02T10:13:12Z","lastAt":"2017-10-04T04:01:48Z","messageCount":6,"participants":["rpjday@crashcourse.ca","René Scharfe","Jonathan Nieder","Junio C Hamano","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"329428","messageId":"20171002061303.Horde.SL92grZCqTRV9oQkBFPELQ7@crashcourse.ca","threadId":"46880","inReplyTo":null,"subject":"What means \"git config bla ~/\"?","fromName":"","fromEmail":"rpjday@crashcourse.ca","sentAt":"2017-10-02T10:13:03Z","receivedAt":"2017-10-02T10:13:12Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"   i'm sure i'm about to embarrass myself but, in \"man git-config\",  \nOPTIONS, one reads:\n\n   --path\n\n   git-config will expand leading ~ to the value of $HOME, and ~user  \nto the   home directory for the specified user. This option has no  \neffect when setting the value (but you can use git config bla ~/ from  \nthe command line to let your shell do the expansion).\n\n   what's with that \"git config bla ~/\"? is this some config keyword  \nor something?\n\nrday\n\n"},{"id":"329445","messageId":"dd28de03-9286-d5aa-3f00-9f6b7a85d71b@web.de","threadId":"46880","inReplyTo":"20171002061303.Horde.SL92grZCqTRV9oQkBFPELQ7@crashcourse.ca","subject":"Re: What means \"git config bla ~/\"?","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2017-10-02T14:06:29Z","receivedAt":"2017-10-02T14:06:41Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"[When I try to reply to rpjday@crashcourse.ca then my SMTP server\n says \"Requested action not taken: mailbox unavailable\n invalid DNS MX or A/AAAA resource record.\", so I'm replying only\n to the list.]\n\nAm 02.10.2017 um 12:13 schrieb rpjday@crashcourse.ca:\n> i'm sure i'm about to embarrass myself but, in \"man git-config\",\n> OPTIONS, one reads:\n> \n> --path\n> \n> git-config will expand leading ~ to the value of $HOME, and ~user to\n> the   home directory for the specified user. This option has no\n> effect when setting the value (but you can use git config bla ~/ from\n> the command line to let your shell do the expansion).\n> \n> what's with that \"git config bla ~/\"? is this some config keyword or\n> something?\n\"bla\" represents any configuration option that you want to change.  It\nis not literally a keyword recognized by git config.  You could replace\nit with \"foo\", if that helps.\n\nThe comment in parentheses reminds readers that shells like bash do\ntilde expansion for command line arguments.  Consider the following\ncommand:\n\n\t$ git config format.outputDirectory ~/patches\n\nYour shell rewrites \"~/patches\" to \"/home/rpjday/patches\" (or similar,\ndepending on your user name and home directory) before actually\nexecuting git config. So even though git config doesn't expand ~ in\noption values you'll still get a result like this afterwards:\n\n\t$ git config format.outputDirectory\n\t/home/rpjday/patches\n\nRené\n"},{"id":"329463","messageId":"20171002171300.GP19555@aiede.mtv.corp.google.com","threadId":"46880","inReplyTo":"20171002061303.Horde.SL92grZCqTRV9oQkBFPELQ7@crashcourse.ca","subject":"Re: What means \"git config bla ~/\"?","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2017-10-02T17:13:00Z","receivedAt":"2017-10-02T17:13:08Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nrpjday@crashcourse.ca wrote:\n\n> i'm sure i'm about to embarrass myself but, in \"man git-config\",\n> OPTIONS, one reads:\n>\n>   --path\n>\n> git-config will expand leading ~ to the value of $HOME, and ~user\n> to the   home directory for the specified user. This option has no\n> effect when setting the value (but you can use git config bla ~/\n> from the command line to let your shell do the expansion).\n>\n> what's with that \"git config bla ~/\"? is this some config keyword\n> or something?\n\nNo need to be embarrased.  Here \"bla\" is a placeholder.  That is,\nfor example, I can run\n\n\tgit config --global include.path ~/.config/git/more-config\n\nor\n\n\tgit config --global include.path $HOME/.config/git/more-config\n\nto cause\n\n\t[include]\n\t\tpath = /home/me/.config/git/more-config\n\nto be added to my global configuration.  The expansion of ~ or $HOME\nis performed by my shell, not Git.  For comparison, if I had run\n\n\tgit config --global include.path '~/.config/git/more-config'\n\nthen that would cause\n\n\t[include]\n\t\tpath = ~/.config/git/more-config\n\nto be added to my global configuration, but it would still have the\nsame effect at run time, since Git is also able to expand ~ to my home\ndirectory.\n\nThe wording comes from\n\n\tcommit 1349484e341a3ec2ba02a86c8fbd97ea9dc8c756\n\tAuthor: Matthieu Moy <Matthieu.Moy@imag.fr>\n\tDate:   Wed Dec 30 17:51:53 2009 +0100\n\n\t    builtin-config: add --path option doing ~ and ~user expansion.\n\nI agree with you that it is less clear than it could be.  Ideas for\nclarifying it?\n\nThanks,\nJonathan\n"},{"id":"329501","messageId":"xmqqfub1m6u5.fsf@gitster.mtv.corp.google.com","threadId":"46880","inReplyTo":"20171002171300.GP19555@aiede.mtv.corp.google.com","subject":"Re: What means \"git config bla ~/\"?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-10-03T00:08:02Z","receivedAt":"2017-10-03T00:08:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n>> what's with that \"git config bla ~/\"? is this some config keyword\n>> or something?\n> ...\n>\n> I agree with you that it is less clear than it could be.  Ideas for\n> clarifying it?\n\nYeah, if it were\n\n\tgit config section.var ~/some/thing\n\nthat would be far clearer than \"bla\" that what we see is a mere\nplaceholder.\n\nAnother obvious option is to remove the parenthetical comment.\n\nOr \"(but you can give values without quoting and let your shell\nexpand it)\", without a confusing sample command that proved not to\nhelp very much.\n\n\n\n"},{"id":"329555","messageId":"1964024229.332266.1507031152104.JavaMail.zimbra@matthieu-moy.fr","threadId":"46880","inReplyTo":"xmqqfub1m6u5.fsf@gitster.mtv.corp.google.com","subject":"Re: What means \"git config bla ~/\"?","fromName":"Matthieu Moy","fromEmail":"git@matthieu-moy.fr","sentAt":"2017-10-03T11:45:52Z","receivedAt":"2017-10-03T12:26:38Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"\"Junio C Hamano\" <gitster@pobox.com> writes:\n\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n> \n>>> what's with that \"git config bla ~/\"? is this some config keyword\n>>> or something?\n>> ...\n>>\n>> I agree with you that it is less clear than it could be.  Ideas for\n>> clarifying it?\n> \n> Yeah, if it were\n> \n>\tgit config section.var ~/some/thing\n> \n> that would be far clearer than \"bla\" that what we see is a mere\n> placeholder.\n\nAgreed.\n\n> Another obvious option is to remove the parenthetical comment.\n> \n> Or \"(but you can give values without quoting and let your shell\n> expand it)\", without a confusing sample command that proved not to\n> help very much.\n\nI prefer your \"section.var\" proposal above. I think people who really understand shell quoting do not need the explanations, and others probably need the example.\n\nWhile we're there, the formatting is also wrong ('' quoting, while we normally use `` quoting for shell commands).\n\nSounds like a nice microproject for my students :-). A patch should follow soon.\n\n-- \nMatthieu Moy\nhttps://matthieu-moy.fr/\n"},{"id":"329639","messageId":"xmqqd163ftng.fsf@gitster.mtv.corp.google.com","threadId":"46880","inReplyTo":"1964024229.332266.1507031152104.JavaMail.zimbra@matthieu-moy.fr","subject":"Re: What means \"git config bla ~/\"?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-10-04T04:01:39Z","receivedAt":"2017-10-04T04:01:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <git@matthieu-moy.fr> writes:\n\n> \"Junio C Hamano\" <gitster@pobox.com> writes:\n>\n>> Jonathan Nieder <jrnieder@gmail.com> writes:\n>> \n>>>> what's with that \"git config bla ~/\"? is this some config keyword\n>>>> or something?\n>>> ...\n>>\tgit config section.var ~/some/thing\n>> ...\n>\n> I prefer your \"section.var\" proposal above. I think people who really understand shell quoting do not need the explanations, and others probably need the example.\n>\n> While we're there, the formatting is also wrong ('' quoting, while we normally use `` quoting for shell commands).\n>\n> Sounds like a nice microproject for my students :-). A patch should follow soon.\n\nOK, thanks.  Lest we forget, this is #leftoverbits for now.\n"}]}