Re: [PATCH 1/6] submodule.*: Introduce simple C interface for submodule lookup by path

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Friday, September 12, 2008 - 2:23 pm

Petr Baudis <pasky@suse.cz> writes:


Won't you ever have different kind of work in the future?
find_submodule_by_path(), perhaps?


This cannot happen; you made sure the thing begins with "submodule."
already.


This will miss a misconfigured "submodule.path" (two level).

I can understand if this part were:

	subkey = strrchr(key, '.');
        if (!subkey || subkey == key + strlen("submodule.") - 1)
        	return 0;


This will segfault on a misconfigured:

	[submodule "xyzzy"]
        	path


Why is this "error()", not "warning()"?


Have to wonder if it makes easier for the users if this function kept only
"xyzzy" out of "submodule.xyzzy.path", not the whole thing.  Cannot judge
without actual callers.


Style?

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/6] Submodule support for git mv and git rm, Petr Baudis, (Fri Sep 12, 2:08 pm)
[PATCH 2/6] git rm: Support for removing submodules, Petr Baudis, (Fri Sep 12, 2:09 pm)
[PATCH 3/6] git mv: Support moving submodules, Petr Baudis, (Fri Sep 12, 2:09 pm)
[PATCH 4/6] t7403: Submodule git mv, git rm testsuite, Petr Baudis, (Fri Sep 12, 2:09 pm)
Re: [PATCH 1/6] submodule.*: Introduce simple C interface ..., Junio C Hamano, (Fri Sep 12, 2:23 pm)
[PATCH] git mv: Support moving submodules, Petr Baudis, (Fri Sep 12, 2:42 pm)
Re: [PATCH 2/6] git rm: Support for removing submodules, Junio C Hamano, (Fri Sep 12, 2:49 pm)
Re: [PATCH 2/6] git rm: Support for removing submodules, Junio C Hamano, (Fri Sep 12, 2:59 pm)
Re: [PATCH] git mv: Support moving submodules, Junio C Hamano, (Fri Sep 12, 3:19 pm)
Re: [PATCH 2/6] git rm: Support for removing submodules, Junio C Hamano, (Fri Sep 12, 3:42 pm)