git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/1] bundle verify: error out if called without an object database

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 27, 2019, 20:20 UTC
Message-ID
<nycvar.QRO.7.76.6.1905272219000.28524@tvgsbejvaqbjf.bet>
In-Reply-To
<20190527200838.GF8616@genre.crustytoothpaste.net>
Hi brian,
On Mon, 27 May 2019, brian m. carlson wrote:
Show 8 quoted lines
> On 2019-05-27 at 19:59:14, Johannes Schindelin via GitGitGadget wrote:
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > The deal with bundles is: they really are thin packs, with very little
>
> Generally a colon can only follow what could be a complete sentence, so
> maybe we want to say something like "The deal with bundles is that they
> really are…" or "The deal with bundles is this: they really are…".
Thanks for educating me.
Show 40 quoted lines
> > sugar on top. So we really need a repository (or more appropriately, an
> > object database) to work with, when asked to verify a bundle.
> >
> > Let's error out with a useful error message if `git bundle verify` is
> > called without such an object database to work with.
> >
> > Reported by Konstantin Ryabitsev.
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> >  bundle.c                | 3 +++
> >  t/t5607-clone-bundle.sh | 6 ++++++
> >  2 files changed, 9 insertions(+)
> >
> > diff --git a/bundle.c b/bundle.c
> > index b45666c49b..b5d21cd80f 100644
> > --- a/bundle.c
> > +++ b/bundle.c
> > @@ -142,6 +142,9 @@ int verify_bundle(struct repository *r,
> >  	int i, ret = 0, req_nr;
> >  	const char *message = _("Repository lacks these prerequisite commits:");
> >
> > +	if (!r || !r->objects || !r->objects->odb)
> > +		return error(_("need a repository to verify a bundle"));
> > +
> >  	repo_init_revisions(r, &revs, NULL);
> >  	for (i = 0; i < p->nr; i++) {
> >  		struct ref_list_entry *e = p->list + i;
> > diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh
> > index cf39e9e243..2a0fb15cf1 100755
> > --- a/t/t5607-clone-bundle.sh
> > +++ b/t/t5607-clone-bundle.sh
> > @@ -14,6 +14,12 @@ test_expect_success 'setup' '
> >  	git tag -d third
> >  '
> >
> > +test_expect_success '"verify" needs a worktree' '
>
> Did you want to say "needs a repository"? Or do we really need a
> worktree?

Right, that was a place I meant to change after making up my mind what is actually required, but forgot.

> Other than that, this looks fine to me. This is a much better experience
> than a BUG and a nice improvement overall.
Thank you! v2 incoming.

Ciao, Dscho

Previous: brian m. carlsonNext: Jeff King
Message 4 of 11 in “bundle verify: improve the user experience when called without a .git/ directory”
  1. 0/1 bundle verify: improve the user experience when called without a .git/ directoryJohannes Schindelin via GitGitGadget, May 27, 2019
  2. 1/1 bundle verify: error out if called without an object databaseJohannes Schindelin via GitGitGadget, May 27, 2019
  3. brian m. carlsonMay 27, 2019
  4. Johannes SchindelinMay 27, 2019
  5. Jeff KingMay 28, 2019
  6. Johannes SchindelinMay 28, 2019
  7. Jeff KingMay 28, 2019
  8. Junio C HamanoMay 28, 2019
  9. Jeff KingMay 28, 2019
  10. Junio C HamanoMay 28, 2019
  11. brian m. carlsonMay 27, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.