Re: [PATCH/WIP v2 03/19] am: implement skeletal builtin am
- From
Paul Tan <pyokagan@gmail.com>
- Date
- Jun 15, 2015, 17:20 UTC
- Message-ID
- <CACRoPnS9fkNQTB8bEKdOBqFgV1E1Mff7oE8rBFDUK+c-woxqZg@mail.gmail.com>
- In-Reply-To
- <xmqqwpz4ao6l.fsf@gitster.dls.corp.google.com>
On Tue, Jun 16, 2015 at 1:14 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 31 quoted lines
> Paul Tan <pyokagan@gmail.com> writes:
>
>> On Mon, Jun 15, 2015 at 6:08 AM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Paul Tan <pyokagan@gmail.com> writes:
>>>> diff --git a/git.c b/git.c
>>>> index 44374b1..42328ed 100644
>>>> --- a/git.c
>>>> +++ b/git.c
>>>> @@ -370,6 +370,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
>>>>
>>>> static struct cmd_struct commands[] = {
>>>> { "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
>>>> + { "am", cmd_am, RUN_SETUP | NEED_WORK_TREE },
>>>
>>> Would this, especially having RUN_SETUP, keep the same behaviour
>>> when the command is run from a subdirectory of a working tree?
>>> e.g.
>>>
>>> save messages to ./inbox
>>> $ cd sub/dir
>>> $ git am ../../inbox
>>>
>>
>> Yes, in 05/19, where the splitting of patches is implemented, we
>> prefix the mbox paths with the path to the working tree.
>
> I wasn't wondering about your new code.
>
> The scripted Porcelain is spawned after applying patches 1-3 from
> here, when you do not have _GIT_USE_BUILTIN_AM exported. Haven't
> RUN_SETUP code did its thing by that time?Ah right, the RUN_SETUP code would have chdir()-ed to the working directory root, so git-am.sh will be unable to find the original working directory. To aid it, we would have to chdir() back to the original working directory, and unset GIT_DIR.
Thanks, Paul