git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 3/3] git: submodule honor -c credential.* from command line

From
Jacob Keller <jacob.keller@gmail.com>
Date
Feb 26, 2016, 22:19 UTC
Message-ID
<CA+P7+xpArLkv2_3juxMFBct1=31hf-gdaOT43pN9CbpuHaz5AQ@mail.gmail.com>
In-Reply-To
<CAGZ79kZnR3EsESCFdORq84awWnRZZ9A_+mcH_54ULZZJfD8xyQ@mail.gmail.com>
On Fri, Feb 26, 2016 at 11:41 AM, Stefan Beller <sbeller@google.com> wrote:
Show 7 quoted lines
>
> In the future, would you mind to try interdiffs in a cover letter?
>
> (I do git diff HEAD...$(previousSeries) with previousSerier either
> local branch or rather what Junio picked up already. There is also tbdiff,
> which should be better and easier than this work flow)
>

Yes, I should do that. I could just use the reflog for this actually, for my workflow.

Show 9 quoted lines
>
>> +                */
>> +               strbuf_addstr(&quoted, var);
>> +               strbuf_addch(&quoted, '=');
>> +               strbuf_addstr(&quoted, value);
>
> This could be `strbuf_addf("%s=%s", var, value);` (?)
> which then gets quoted below
>

Is there such a thing as sq_quote_buf equivalent of this? If not, should I add one? I think that might be preferable since we'd drop the entire extra strbuf variable.

Show 6 quoted lines
>> +                       git_config_from_parameters(sanitize_submodule_config,
>> +                                                  &sanitized_config);
>> +                       argv_array_pushf(out, "%s=%s", *var, sanitized_config.buf);
>
> like here?
>

Ya, I just wasn't thinking of strbuf_addf. But I think I'd rather have sq_quote_f or something created instead to drop the need of a separate strbuf.

Show 7 quoted lines
>> -                       subsha1=$(clear_local_git_env; cd "$sm_path" &&
>> +                       subsha1=$(sanitize_submodule_env; cd "$sm_path" &&
>>                                 git rev-parse --verify HEAD) ||
>
> While at it, we could discuss if we want to replace the pattern cd
> <somewhere> && git-command
> by `git -C <somewhere> <command>` eventually (not in this patch) ?

Yes, we should use git -C instead, but probably not worth too much effort if our plan is to drop the shell code eventually? Might be worth the cleanup, especially if it lets us avoid a subshell. If we still need the subshell for other non-git commands I would prefer to leave it as "(cd <somewhere> && git command && other commands && ... && )

Thanks, Jake

Previous: Stefan Beller
Message 5 of 5 in “t/lib-httpd: load mod_unixd”
  1. 1/3 t/lib-httpd: load mod_unixdJacob Keller, Feb 26, 2016
  2. 2/3 sumodule--helper: fix submodule--helper clone usage and check argc countJacob Keller, Feb 26, 2016
  3. 3/3 git: submodule honor -c credential.* from command lineJacob Keller, Feb 26, 2016
  4. Stefan BellerFeb 26, 2016
  5. Jacob KellerFeb 26, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.