Re: [PATCH 2/3] Teach read_tree_recursive() how to traverse into submodules
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 18, 2009, 21:02 UTC
- Message-ID
- <alpine.DEB.1.00.0901182201140.3586@pacific.mpi-cbg.de>
- In-Reply-To
- <8c5c35580901181145x2e14fe0fq4ab0e94c13bad38a@mail.gmail.com>
Hi,
On Sun, 18 Jan 2009, Lars Hjemli wrote:
Show 13 quoted lines
> On Sun, Jan 18, 2009 at 19:33, Johannes Schindelin > <Johannes.Schindelin@gmx.de> wrote: > > On Sun, 18 Jan 2009, Lars Hjemli wrote: > >> Actually, I want this to work for bare repositories by specifying the > >> submodule odbs in the alternates file. So if the current submodule odb > >> wasn't found my plan was to check if the commit object was accessible > >> anyways but don't die() if it wasn't. > > > > Please make that an explicit option (cannot think of a good name, though), > > otherwise I will not be able to use your feature. Making it the default > > would be inconsistent with the rest of our submodules framework. > > Would a test on is_bare_repository() suffice for your use-case?
No. Inconsistent is inconsistent.
> If this isn't good enough, how do you propose it be solved?
As I said, with an extra option that you _have_ to pass when you want that behavior.
Show 15 quoted lines
> >> >> + commit = lookup_commit(sha1);
> >> >> + if (!commit)
> >> >> + die("traverse_gitlink(): internal error");
> >> >
> >> > s/internal error/could not access commit '%s' of submodule '%s'",
> >> > sha1_to_hex(sha1), path);/
> >>
> >> Ok (I belive this codepath is virtually impossible to hit, hence the
> >> "internal error", but I could of course be mistaken).
> >
> > You make it a function that is exported to other parts of Git in cache.h.
> > So you might just as well expect it to be used by other parts at some
> > stage.
>
> This function is local to tree.c, but your point is still valid.My point is still valid because I never talked about the static function, but the non-static one which calls the static one.
Ciao, Dscho