Thread (42 messages) flat view 42 messages, 6 authors, 2018-10-29

Re: [PATCH] alias: detect loops in mixed execution mode

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2018-10-20 10:52:29

On Fri, Oct 19 2018, Jeff King wrote:
On Fri, Oct 19, 2018 at 10:28:22AM +0200, Ævar Arnfjörð Bjarmason wrote:
quoted
quoted
-		string_list_append(&cmd_list, *argv[0]);
+		add_cmd_history(&env, &cmd_list, *argv[0]);

 		/*
 		 * It could be an alias -- this works around the insanity
Just to sanity check an assumption of mine: One thing I didn't do is use
sq_quote_buf() and sq_dequote_to_argv() like we do for
CONFIG_DATA_ENVIRONMENT. This is because in the case of config we need
to deal with:

    $ git config alias.cfgdump
    !env
    $ git -c x.y=z -c "foo.bar='baz'" cfgdump|grep baz
    GIT_CONFIG_PARAMETERS='x.y=z' 'foo.bar='\''baz'\'''

But in this case I don't see how a command-name would ever contain
whitespace. So we skip quoting and just delimit by space.
Alias names cannot currently contain whitespace, because it's not
allowed in the key. However, we've discussed making the syntax
alias.<name>.command, which would then make it possible.

Whether anyone would use that is a different question, but hey,
apparently some people think "My Documents" is a good name for a
directory. ;)
I'll just leave this part as it is for now. If we ever have commands
with whitespace this'll be the least of our worries.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help