List for cgit developers and users
 help / color / mirror / Atom feed
* [RFC] Improved submodule support
@ 2011-06-15  9:12 hjemli
  2011-06-15  9:28 ` mailings
  2011-06-16 14:42 ` [PATCH] Remove bogus warning in submodule link code dpmcgee
  0 siblings, 2 replies; 4+ messages in thread
From: hjemli @ 2011-06-15  9:12 UTC (permalink / raw)


The wip-branch on hjemli.net/git now contains some patches which adds
support for `repo.module-link.<path>` options. This seems (to me) like
a reasonable way to handle repositories with more than one submodule
(or a submodule checked out at different paths in different
revisions), but I'd love to get some feedback on the design and
implementation before considering merging this to master.

-- 
larsh




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFC] Improved submodule support
  2011-06-15  9:12 [RFC] Improved submodule support hjemli
@ 2011-06-15  9:28 ` mailings
  2011-06-16 14:42 ` [PATCH] Remove bogus warning in submodule link code dpmcgee
  1 sibling, 0 replies; 4+ messages in thread
From: mailings @ 2011-06-15  9:28 UTC (permalink / raw)


On 06/15/2011 11:12 AM, Lars Hjemli wrote:
> The wip-branch on hjemli.net/git now contains some patches which adds
> support for `repo.module-link.<path>` options. This seems (to me) like
> a reasonable way to handle repositories with more than one submodule
> (or a submodule checked out at different paths in different
> revisions), but I'd love to get some feedback on the design and
> implementation before considering merging this to master.
> 
I never use submodules, so no feedback from me ;-)

-- 
Ferry Huberts




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Remove bogus warning in submodule link code
  2011-06-15  9:12 [RFC] Improved submodule support hjemli
  2011-06-15  9:28 ` mailings
@ 2011-06-16 14:42 ` dpmcgee
  2011-06-20 18:31   ` hjemli
  1 sibling, 1 reply; 4+ messages in thread
From: dpmcgee @ 2011-06-16 14:42 UTC (permalink / raw)


In reality, len should ever be unset here if the conditions are right,
but there is insufficient info for the compiler to realize this so it
spits an error. Initialize len so gcc doesn't spit an error.

Signed-off-by: Dan McGee <dpmcgee at gmail.com>
---

Fixes:

    CC ui-shared.o
	ui-shared.c: In function ?cgit_submodule_link?:
	ui-shared.c:559:7: warning: ?len? may be used uninitialized in this function [-Wuninitialized]

 ui-shared.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ui-shared.c b/ui-shared.c
index 3150d48..ac3503c 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -523,7 +523,7 @@ void cgit_submodule_link(const char *class, char *path, const char *rev)
 	struct string_list *list;
 	struct string_list_item *item;
 	char tail, *dir;
-	size_t len;
+	size_t len = 0;
 
 	tail = 0;
 	list = &ctx.repo->submodules;
-- 
1.7.5.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Remove bogus warning in submodule link code
  2011-06-16 14:42 ` [PATCH] Remove bogus warning in submodule link code dpmcgee
@ 2011-06-20 18:31   ` hjemli
  0 siblings, 0 replies; 4+ messages in thread
From: hjemli @ 2011-06-20 18:31 UTC (permalink / raw)


On Thu, Jun 16, 2011 at 16:42, Dan McGee <dpmcgee at gmail.com> wrote:
> In reality, len should ever be unset here if the conditions are right,
> but there is insufficient info for the compiler to realize this so it
> spits an error. Initialize len so gcc doesn't spit an error.

Thanks. I've applied your patch, but moved the initialization out of
the declaration block:

--- a/ui-shared.c
+++ b/ui-shared.c
@@ -525,7 +525,7 @@ void cgit_submodule_link(
 	char tail, *dir;
 	size_t len;

-	tail = 0;
+	len = tail = 0;
 	list = &ctx.repo->submodules;
 	item = lookup_path(list, path);
 	if (!item) {

--
larsh




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-20 18:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-15  9:12 [RFC] Improved submodule support hjemli
2011-06-15  9:28 ` mailings
2011-06-16 14:42 ` [PATCH] Remove bogus warning in submodule link code dpmcgee
2011-06-20 18:31   ` hjemli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).