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

Re: [PATCH v3] stash: avoid recursive hard reset on submodules

From
Jakob Jarmar <jakob.j@gmail.com>
Date
Oct 12, 2019, 15:24 UTC
Message-ID
<20191012152416.GA743557@OJAN-PAAVO.localdomain>
In-Reply-To
<xmqqsgnyenwj.fsf@gitster-ct.c.googlers.com>
On Sat, Oct 12, 2019 at 10:46:36AM +0900, Junio C Hamano wrote:
Show 20 quoted lines
> > +	git init sub &&
> > +	(
> > +		cd sub &&
> > +		test_commit sub_file
> > +	) &&
> > +	git init main &&
> > +	(
> > +		cd main &&
> > +		git submodule add ../sub &&
> > +		test_commit main_file
> > +	) &&
> > +	test_when_finished "rm -rf main sub"
> 
> Have test_when_finished that removes main and sub _before_ you start
> creating sub and main.  
> 
> When the &&-cascade breaks anywhere, the control may not even reach
> your test_when_finished that registers the clean-up procedure.
> Imagine "git init sub" succeeds but "git init main" somehow
> fails---you still want to clean up "sub".
Ah, of course, will fix this (and the other point as well).
> Other than that, looks reasonably well done.  
Thanks. This was fun to figure out and fix.
Previous: Junio C HamanoNext: Jakob Jarmar
Message 6 of 8 in “stash: avoid recursive hard reset on submodules”
  1. stash: avoid recursive hard reset on submodulesJakob Jarmar, Oct 10, 2019
  2. stash: avoid recursive hard reset on submodulesJakob Jarmar, Oct 11, 2019
  3. Junio C HamanoOct 11, 2019
  4. stash: avoid recursive hard reset on submodulesJakob Jarmar, Oct 11, 2019
  5. Junio C HamanoOct 12, 2019
  6. Jakob JarmarOct 12, 2019
  7. stash: avoid recursive hard reset on submodulesJakob Jarmar, Oct 12, 2019
  8. Junio C HamanoOct 15, 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.