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

Re: [PATCH v4] fast-import: treat filemodify with empty tree as delete

From
PBPeter Baumann <waste.manager@gmx.de>
Date
Jan 27, 2011, 20:46 UTC
Message-ID
<20110127204649.GB19378@m62s10.vlinux.de>
In-Reply-To
<20110127194844.GA20894@burratino>
On Thu, Jan 27, 2011 at 01:48:45PM -0600, Jonathan Nieder wrote:
Show 29 quoted lines
> Peter Baumann wrote:
> > On Thu, Jan 27, 2011 at 12:07:49AM -0600, Jonathan Nieder wrote:
> 
> >> +++ b/t/t9300-fast-import.sh
> >> @@ -818,6 +818,48 @@ test_expect_success \
> >>  	 compare_diff_raw expect actual'
> >>  
> >> +test_expect_success \
> >> +	'N: delete directory by copying' \
> >> +	'cat >expect <<-\EOF &&
> >> +	OBJID
> >> +	:100644 000000 OBJID OBJID D	foo/bar/qux
> >> +	OBJID
> >> +	:000000 100644 OBJID OBJID A	foo/bar/baz
> >> +	:000000 100644 OBJID OBJID A	foo/bar/qux
> >> +	EOF
> >> +	 empty_tree=$(git mktree </dev/null) &&
> >
> > [ Feel free to ignore me ... ]
> >
> > Just a (stupid?) suggestion: Why not put a $EMPTY_TREE definiton in test-lib.sh
> > (or any other global file sourced in the tests) so if another caller needs this
> > definition it won't waste cpu cycles doing the calculation via mktree < /dev/null
> > again?
> 
> Might be a good idea.  Note, though, that that would mean more cpu
> cycles used rather than less, unless we hardcode the object name
> (which I prefer not to do).
> 

Wny not? It *is* already hardcoded in the GIT source code (see grep -a1 cache.h output).

> One possibility would be a lib-object-names.sh defining EMPTY_BLOB and
> EMPTY_TREE to be sourced by tests that need it.

Hm. Might be a possibility, but if this file only contains 2 hardcoded variables I would prefer putting it into test-list.sh instead of an extra file.

Previous: Jonathan NiederNext: Peter Baumann
Message 19 of 24 in “fast-import: add 'ls' command”
  1. fast-import: add 'ls' commandDavid Barr, Dec 2, 2010
  2. fast-import: add 'ls' commandDavid Barr, Dec 2, 2010
  3. Sverre RabbelierDec 2, 2010
  4. David Michael BarrDec 2, 2010
  5. Jonathan NiederDec 2, 2010
  6. Junio C HamanoDec 2, 2010
  7. David BarrDec 2, 2010
  8. 0/3 fast-import: add 'ls' commandJonathan Nieder, Jan 3, 2011
  9. 1/3 fast-import: clarify handling of cat-blob featureJonathan Nieder, Jan 3, 2011
  10. 2/3 fast-import: treat filemodify with empty tree as deleteJonathan Nieder, Jan 3, 2011
  11. fast-import: treat filemodify with empty tree as deleteJonathan Nieder, Jan 26, 2011
  12. Sverre RabbelierJan 26, 2011
  13. fast-import: treat filemodify with empty tree as deleteJonathan Nieder, Jan 26, 2011
  14. Junio C HamanoJan 27, 2011
  15. Jonathan NiederJan 27, 2011
  16. fast-import: treat filemodify with empty tree as deleteJonathan Nieder, Jan 27, 2011
  17. Peter BaumannJan 27, 2011
  18. Jonathan NiederJan 27, 2011
  19. Peter BaumannJan 27, 2011
  20. Peter BaumannJan 27, 2011
  21. Jonathan NiederJan 28, 2011
  22. 3/3 fast-import: add 'ls' commandJonathan Nieder, Jan 3, 2011
  23. [RFC] fast-import: 'cat-blob' and 'ls' commandsJonathan Nieder, Jan 26, 2011
  24. Sam VilainJan 26, 2011

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.