git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* What means "git config bla ~/"?
@ 2017-10-02 10:13 rpjday
  2017-10-02 14:06 ` René Scharfe
  2017-10-02 17:13 ` Jonathan Nieder
  0 siblings, 2 replies; 6+ messages in thread
From: rpjday @ 2017-10-02 10:13 UTC (permalink / raw)
  To: git

   i'm sure i'm about to embarrass myself but, in "man git-config",  
OPTIONS, one reads:

   --path

   git-config will expand leading ~ to the value of $HOME, and ~user  
to the   home directory for the specified user. This option has no  
effect when setting the value (but you can use git config bla ~/ from  
the command line to let your shell do the expansion).

   what's with that "git config bla ~/"? is this some config keyword  
or something?

rday


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: What means "git config bla ~/"?
  2017-10-02 10:13 What means "git config bla ~/"? rpjday
@ 2017-10-02 14:06 ` René Scharfe
  2017-10-02 17:13 ` Jonathan Nieder
  1 sibling, 0 replies; 6+ messages in thread
From: René Scharfe @ 2017-10-02 14:06 UTC (permalink / raw)
  To: git; +Cc: Matthieu Moy

[When I try to reply to rpjday@crashcourse.ca then my SMTP server
 says "Requested action not taken: mailbox unavailable
 invalid DNS MX or A/AAAA resource record.", so I'm replying only
 to the list.]

Am 02.10.2017 um 12:13 schrieb rpjday@crashcourse.ca:
> i'm sure i'm about to embarrass myself but, in "man git-config",
> OPTIONS, one reads:
> 
> --path
> 
> git-config will expand leading ~ to the value of $HOME, and ~user to
> the   home directory for the specified user. This option has no
> effect when setting the value (but you can use git config bla ~/ from
> the command line to let your shell do the expansion).
> 
> what's with that "git config bla ~/"? is this some config keyword or
> something?
"bla" represents any configuration option that you want to change.  It
is not literally a keyword recognized by git config.  You could replace
it with "foo", if that helps.

The comment in parentheses reminds readers that shells like bash do
tilde expansion for command line arguments.  Consider the following
command:

	$ git config format.outputDirectory ~/patches

Your shell rewrites "~/patches" to "/home/rpjday/patches" (or similar,
depending on your user name and home directory) before actually
executing git config. So even though git config doesn't expand ~ in
option values you'll still get a result like this afterwards:

	$ git config format.outputDirectory
	/home/rpjday/patches

René

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: What means "git config bla ~/"?
  2017-10-02 10:13 What means "git config bla ~/"? rpjday
  2017-10-02 14:06 ` René Scharfe
@ 2017-10-02 17:13 ` Jonathan Nieder
  2017-10-03  0:08   ` Junio C Hamano
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Nieder @ 2017-10-02 17:13 UTC (permalink / raw)
  To: rpjday; +Cc: git

Hi,

rpjday@crashcourse.ca wrote:

> i'm sure i'm about to embarrass myself but, in "man git-config",
> OPTIONS, one reads:
>
>   --path
>
> git-config will expand leading ~ to the value of $HOME, and ~user
> to the   home directory for the specified user. This option has no
> effect when setting the value (but you can use git config bla ~/
> from the command line to let your shell do the expansion).
>
> what's with that "git config bla ~/"? is this some config keyword
> or something?

No need to be embarrased.  Here "bla" is a placeholder.  That is,
for example, I can run

	git config --global include.path ~/.config/git/more-config

or

	git config --global include.path $HOME/.config/git/more-config

to cause

	[include]
		path = /home/me/.config/git/more-config

to be added to my global configuration.  The expansion of ~ or $HOME
is performed by my shell, not Git.  For comparison, if I had run

	git config --global include.path '~/.config/git/more-config'

then that would cause

	[include]
		path = ~/.config/git/more-config

to be added to my global configuration, but it would still have the
same effect at run time, since Git is also able to expand ~ to my home
directory.

The wording comes from

	commit 1349484e341a3ec2ba02a86c8fbd97ea9dc8c756
	Author: Matthieu Moy <Matthieu.Moy@imag.fr>
	Date:   Wed Dec 30 17:51:53 2009 +0100

	    builtin-config: add --path option doing ~ and ~user expansion.

I agree with you that it is less clear than it could be.  Ideas for
clarifying it?

Thanks,
Jonathan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: What means "git config bla ~/"?
  2017-10-02 17:13 ` Jonathan Nieder
@ 2017-10-03  0:08   ` Junio C Hamano
  2017-10-03 11:45     ` Matthieu Moy
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2017-10-03  0:08 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: rpjday, git

Jonathan Nieder <jrnieder@gmail.com> writes:

>> what's with that "git config bla ~/"? is this some config keyword
>> or something?
> ...
>
> I agree with you that it is less clear than it could be.  Ideas for
> clarifying it?

Yeah, if it were

	git config section.var ~/some/thing

that would be far clearer than "bla" that what we see is a mere
placeholder.

Another obvious option is to remove the parenthetical comment.

Or "(but you can give values without quoting and let your shell
expand it)", without a confusing sample command that proved not to
help very much.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: What means "git config bla ~/"?
  2017-10-03  0:08   ` Junio C Hamano
@ 2017-10-03 11:45     ` Matthieu Moy
  2017-10-04  4:01       ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Matthieu Moy @ 2017-10-03 11:45 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonathan Nieder, rpjday, Git Mailing List

"Junio C Hamano" <gitster@pobox.com> writes:

> Jonathan Nieder <jrnieder@gmail.com> writes:
> 
>>> what's with that "git config bla ~/"? is this some config keyword
>>> or something?
>> ...
>>
>> I agree with you that it is less clear than it could be.  Ideas for
>> clarifying it?
> 
> Yeah, if it were
> 
>	git config section.var ~/some/thing
> 
> that would be far clearer than "bla" that what we see is a mere
> placeholder.

Agreed.

> Another obvious option is to remove the parenthetical comment.
> 
> Or "(but you can give values without quoting and let your shell
> expand it)", without a confusing sample command that proved not to
> help very much.

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.

While we're there, the formatting is also wrong ('' quoting, while we normally use `` quoting for shell commands).

Sounds like a nice microproject for my students :-). A patch should follow soon.

-- 
Matthieu Moy
https://matthieu-moy.fr/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: What means "git config bla ~/"?
  2017-10-03 11:45     ` Matthieu Moy
@ 2017-10-04  4:01       ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2017-10-04  4:01 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: Jonathan Nieder, rpjday, Git Mailing List

Matthieu Moy <git@matthieu-moy.fr> writes:

> "Junio C Hamano" <gitster@pobox.com> writes:
>
>> Jonathan Nieder <jrnieder@gmail.com> writes:
>> 
>>>> what's with that "git config bla ~/"? is this some config keyword
>>>> or something?
>>> ...
>>	git config section.var ~/some/thing
>> ...
>
> 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.
>
> While we're there, the formatting is also wrong ('' quoting, while we normally use `` quoting for shell commands).
>
> Sounds like a nice microproject for my students :-). A patch should follow soon.

OK, thanks.  Lest we forget, this is #leftoverbits for now.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-04  4:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-02 10:13 What means "git config bla ~/"? rpjday
2017-10-02 14:06 ` René Scharfe
2017-10-02 17:13 ` Jonathan Nieder
2017-10-03  0:08   ` Junio C Hamano
2017-10-03 11:45     ` Matthieu Moy
2017-10-04  4:01       ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).