Re: [PATCH 12/17] update submodules: add submodule_move_head

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Mar 11, 2017 at 11:09 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Brandon Williams <bmwill@xxxxxxxxxx> writes:
>
>>> diff --git a/submodule.c b/submodule.c
>>> index 0b2596e88a..bc5fecf8c5 100644
>>> --- a/submodule.c
>>> +++ b/submodule.c
>>> @@ -1239,6 +1239,141 @@ int bad_to_remove_submodule(const char *path, unsigned flags)
>>>      return ret;
>>>  }
>>>
>>> +static int submodule_has_dirty_index(const struct submodule *sub)
>>> +{
>>> +    struct child_process cp = CHILD_PROCESS_INIT;
>>> +
>>> +    prepare_submodule_repo_env_no_git_dir(&cp.env_array);
>>> +
>>> +    cp.git_cmd = 1;
>>> +    argv_array_pushl(&cp.args, "diff-index", "--quiet", \
>>> +                                    "--cached", "HEAD", NULL);
>>
>> The formatting of this line is a little odd.  Also you can drop the
>> backslash.
>
> Heh.  I think I saw and pointed out the same during the review of
> the previous round X-<.  It is a bit disappointing.

Yes. I remember having a local mixup of branches, such that I
fear I may have missed other feedback of the previous round as
well then. I do remember removing a backslash, so maybe I
got confused with another backslash as well.

I'll reroll with this fixed.

>
>>> +static void submodule_reset_index(const char *path)
>>> +{
>>> +    struct child_process cp = CHILD_PROCESS_INIT;
>>> +    prepare_submodule_repo_env_no_git_dir(&cp.env_array);
>>> +
>>> +    cp.git_cmd = 1;
>>> +    cp.no_stdin = 1;
>>> +    cp.dir = path;
>>> +
>>> +    argv_array_pushf(&cp.args, "--super-prefix=%s/", path);
>>> +    argv_array_pushl(&cp.args, "read-tree", "-u", "--reset", NULL);
>>> +
>>> +    argv_array_push(&cp.args, EMPTY_TREE_SHA1_HEX);
>
> Somewhat related; will this use of --super-prefix be affected when
> we split it into two for "adjust pathspec" prefix and "adjust
> output" prefix?

Let's see how the superproject prefixing evolves and what Brandon
sends out. When the superprefix changes its meaning I'll adjust here.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]