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

Re: [PATCH v3] builtin/clone: avoid failure with GIT_DEFAULT_HASH

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Sep 22, 2020, 09:17 UTC
Message-ID
<20200922091717.GP67496@camp.crustytoothpaste.net>
In-Reply-To
<xmqq4knrhhzx.fsf@gitster.c.googlers.com>
On 2020-09-21 at 04:27:14, Junio C Hamano wrote:
Show 16 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> 
> > +test_expect_success 'clone with GIT_DEFAULT_HASH' '
> > +	(
> > +		sane_unset GIT_DEFAULT_HASH &&
> > +		git init --object-format=sha1 test-sha1 &&
> > +		git init --object-format=sha256 test-sha256
> > +	) &&
> > +	test_commit -C test-sha1 foo &&
> > +	test_commit -C test-sha256 foo &&
> 
> Unfortunately, the 'foo' commit is created in test-sha1, but the
> next step to create 'foo' in test-sha256 fails with
> 
>         fatal: unknown repository extensions found:
>                 objectformat

I'm not seeing that with this series based on master (385c171a018f2747b329bcfa6be8eda1709e5abd). I'm doing this:

  make -j6 all && (cd t && GIT_TEST_DEFAULT_HASH=sha256 ./t5601-*.sh --verbose)
  make -j6 all && (cd t && GIT_TEST_DEFAULT_HASH=sha1 ./t5601-*.sh --verbose)
And getting this output:
  Initialized empty Git repository in /home/bmc/checkouts/git/t/trash directory.t5601-clone/test-sha1/.git/
  Initialized empty Git repository in /home/bmc/checkouts/git/t/trash directory.t5601-clone/test-sha256/.git/
  [master (root-commit) 946e985] foo
   Author: A U Thor <author@example.com>
   1 file changed, 1 insertion(+)
   create mode 100644 foo.t
  [master (root-commit) ff872d8] foo
   Author: A U Thor <author@example.com>
   1 file changed, 1 insertion(+)
   create mode 100644 foo.t
  Cloning into 'test-clone-sha256'...
  done.
  Cloning into 'test-clone-sha1'...
  done.
  On branch master
  Your branch is up to date with 'origin/master'.
  
  nothing to commit, working tree clean
  On branch master
  Your branch is up to date with 'origin/master'.
  
  nothing to commit, working tree clean
Is there something I'm missing here?
-- 
brian m. carlson: Houston, Texas, US
Previous: Junio C HamanoNext: Junio C Hamano
Message 14 of 15 in “Posible bug with GIT_DEFAULT_HASH during clone”
  1. Matheus TavaresSep 11, 2020
  2. brian m. carlsonSep 11, 2020
  3. builtin/clone: avoid failure with GIT_DEFAULT_HASHbrian m. carlson, Sep 11, 2020
  4. Taylor BlauSep 12, 2020
  5. brian m. carlsonSep 12, 2020
  6. Junio C HamanoSep 14, 2020
  7. Junio C HamanoSep 14, 2020
  8. brian m. carlsonSep 15, 2020
  9. builtin/clone: avoid failure with GIT_DEFAULT_HASHbrian m. carlson, Sep 15, 2020
  10. Junio C HamanoSep 15, 2020
  11. brian m. carlsonSep 15, 2020
  12. builtin/clone: avoid failure with GIT_DEFAULT_HASHbrian m. carlson, Sep 20, 2020
  13. Junio C HamanoSep 21, 2020
  14. brian m. carlsonSep 22, 2020
  15. Junio C HamanoSep 22, 2020

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.