From: Ramsay Jones <ramsay@ramsayjones•plus.com>
To: Stefan Beller <sbeller@google•com>
Cc: Junio C Hamano <gitster@pobox•com>,
"git@vger•kernel.org" <git@vger•kernel.org>,
Eric Sunshine <sunshine@sunshineco•com>,
Jacob Keller <jacob.keller@gmail•com>,
Norio Nomura <norio.nomura@gmail•com>
Subject: Re: [PATCHv3 0/2] Fix relative path issues in recursive submodules.
Date: Wed, 13 Apr 2016 20:21:42 +0100 [thread overview]
Message-ID: <570E9C46.6080905@ramsayjones.plus.com> (raw)
In-Reply-To: <CAGZ79kYE3E7stNc3Xbzr-qvncLGt4qRPMbv897k5h0B50-Rogg@mail.gmail.com>
On 12/04/16 16:58, Stefan Beller wrote:
> On Fri, Apr 1, 2016 at 7:41 AM, Ramsay Jones
> <ramsay@ramsayjones•plus.com> wrote:
>>
[snip[
>>> - }
>>> + sm_gitdir_rel = strbuf_detach(&sb, NULL);
>>
>> ... this is good, but ...
>>
>>> + sm_gitdir = absolute_path(sm_gitdir_rel);
>>>
>>> if (!is_absolute_path(path)) {
>>> - /*
>>> - * TODO: add prefix here once we allow calling from non root
>>> - * directory?
>>> - */
>>> - strbuf_addf(&sb, "%s/%s",
>>> - get_git_work_tree(),
>>> - path);
>>> + strbuf_addf(&sb, "%s/%s", get_git_work_tree(), path);
>>> path = strbuf_detach(&sb, 0);
>>
>> ... can you please fix this up.
>>
>> Thanks!
>>
>> ATB,
>> Ramsay Jones
>
> Looking at the current code of origin/sb/submodule-helper-clone-regression-fix
> we do not have this issue there, but I'll keep it in mind for a resend.
Hmm, actually, the above change wasn't the original culprit (as I thought), but
a different instance of the same fault. :-D
I've lost track of which version is now in 'pu' (currently @ 45a4edc "Merge branch
'sb/submodule-init' into pu"), but sparse is still warning:
SP submodule.c
submodule.c:256:43: warning: Using plain integer as NULL pointer
So, the fix looks like:
diff --git a/submodule.c b/submodule.c
index 5d1238a..4cc1c27 100644
--- a/submodule.c
+++ b/submodule.c
@@ -253,7 +253,7 @@ const char *submodule_strategy_to_string(const struct submodule_update_strategy
return NULL;
case SM_UPDATE_COMMAND:
strbuf_addf(&sb, "!%s", s->command);
- return strbuf_detach(&sb, 0);
+ return strbuf_detach(&sb, NULL);
}
return NULL;
}
Also, I note that t7406-submodule-update.sh test #4 is failing.
(looks like absolute vs relative paths)
ATB,
Ramsay Jones
next prev parent reply other threads:[~2016-04-13 19:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 0:17 [PATCHv3 0/2] Fix relative path issues in recursive submodules Stefan Beller
2016-04-01 0:17 ` [PATCH 1/2] submodule--helper, module_clone: always operate on absolute paths Stefan Beller
2016-04-01 19:18 ` Junio C Hamano
2016-04-01 19:30 ` Junio C Hamano
2016-04-01 20:09 ` Eric Sunshine
2016-04-01 20:39 ` Junio C Hamano
2016-04-01 0:17 ` [PATCH 2/2] submodule--helper, module_clone: catch fprintf failure Stefan Beller
2016-04-01 14:41 ` [PATCHv3 0/2] Fix relative path issues in recursive submodules Ramsay Jones
2016-04-12 15:58 ` Stefan Beller
2016-04-13 19:21 ` Ramsay Jones [this message]
2016-04-13 20:34 ` Stefan Beller
2016-04-13 22:23 ` Junio C Hamano
2016-04-13 22:30 ` Stefan Beller
2016-04-13 22:45 ` Junio C Hamano
2016-04-13 21:03 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=570E9C46.6080905@ramsayjones.plus.com \
--to=ramsay@ramsayjones$(echo .)plus.com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=jacob.keller@gmail$(echo .)com \
--cc=norio.nomura@gmail$(echo .)com \
--cc=sbeller@google$(echo .)com \
--cc=sunshine@sunshineco$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox