Re: [PATCH 1/2] Allow '-' in config variable names

4 messages, 4 authors, 2016-08-11 · open the first message on its own page

Re: [PATCH 1/2] Allow '-' in config variable names

From: Junio C Hamano <hidden>
Date: 2016-08-11 19:31:51

Junio C Hamano [off-list ref] writes:
Linus Torvalds [off-list ref] writes:
quoted
I need this in order to allow aliases of the same form as "ls-tree", 
"rev-parse" etc, so that I can use

	[alias]
		my-cat=--paginate cat-file -p

to add a "git my-cat" command.
I do not have problem with this (and would perhaps also want to
add '_' to keychar set), but people who envisioned parsing
config from scripts (i.e. Perly git) might prefer if we stayed
within alnum, since I'd suspect then they may be able to reuse
existing .ini parsers.  I do not much care about that myself,
but I am bringing it up just in case other people might.

Other than that, this sounds nice.
One thing I forgot to add.  Just like we downcase what user has
written in config file, it might make sense to also remove '-'
(and if we add '_' to keychar set, that one as well) to when
canonicalizing the key value.  That way, somewhat awkward long
configuration variables we currently have can be written more
readably, e.g. repack.use-delta-base-offset

Likes, dislikes?  It is not strictly needed, since we can do
CamelCase as well in the configuration file.
By the way, everybody seems to do "alias.xxx = -p cat-file -p"
(I have it as "git less").  Maybe we would want to make a
built-in alias for that?
Seconds?

Re: [PATCH 1/2] Allow '-' in config variable names

From: Johannes Schindelin <hidden>
Date: 2016-08-11 20:23:40

Hi,

On Mon, 30 Oct 2006, Junio C Hamano wrote:
Junio C Hamano [off-list ref] writes:
quoted
Linus Torvalds [off-list ref] writes:
quoted
I need this in order to allow aliases of the same form as "ls-tree", 
"rev-parse" etc, so that I can use

	[alias]
		my-cat=--paginate cat-file -p

to add a "git my-cat" command.
Seconds?
I personally dislike any name with "_" or "-" in it, since I am stuck with 
different keyboard layouts and keep mistyping them. I even often find 
myself hitting <TAB> just to complete a _single_ "-", since the position 
of the <TAB> key is not wildly jumping around between different keyboard 
layouts.

So I can live without it.

Ciao,
Dscho

Re: [PATCH 1/2] Allow '-' in config variable names

From: J. Bruce Fields <hidden>
Date: 2016-08-11 20:33:01

On Mon, Oct 30, 2006 at 07:02:27PM -0800, Junio C Hamano wrote:
Junio C Hamano [off-list ref] writes:
quoted
By the way, everybody seems to do "alias.xxx = -p cat-file -p"
(I have it as "git less").  Maybe we would want to make a
built-in alias for that?
Seconds?
Yes!

I'd vote for calling it just "git cat".

Re: [PATCH 1/2] Allow '-' in config variable names

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-08-11 20:35:35


On Mon, 30 Oct 2006, Junio C Hamano wrote:
One thing I forgot to add.  Just like we downcase what user has
written in config file, it might make sense to also remove '-'
(and if we add '_' to keychar set, that one as well) to when
canonicalizing the key value.  That way, somewhat awkward long
configuration variables we currently have can be written more
readably, e.g. repack.use-delta-base-offset
Well, then we need to teach "git <alias>" that "git <al-i-as>" is the same 
thing as "alias".
quoted
By the way, everybody seems to do "alias.xxx = -p cat-file -p"
(I have it as "git less").  Maybe we would want to make a
built-in alias for that?
Seconds?
I like it mainly as a great example of how to use aliases, not because I 
actually much -use- the thing, so I don't personally care.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help